Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Is CGAL::Orthogonal_k_neighbor_search thread-safe?

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Is CGAL::Orthogonal_k_neighbor_search thread-safe?


Chronological Thread 
  • From: Antonio Carlos Pereira de Azambuja <>
  • To:
  • Subject: Re: [cgal-discuss] Is CGAL::Orthogonal_k_neighbor_search thread-safe?
  • Date: Mon, 23 Feb 2015 11:16:46 -0300

Hello, Sebastien!

I just can't get my test work. I'm trying to test if serial code and parallel code performing CGAL::Orthogonal_k_neighbor_search work on 4D. Both should return the same results for the same queries. If I run the test for some time executing the same test in an outside loop (it means, allocating and deallocation everytime) some problems occurs with deallocation at some point and a segfault arises.

Considering the statements below are correct:

  i) Cartesian_d<double>::Point_d  inherits from PointCd2
 ii) PointCd2 inherits from Handle_for<tuple..>
iii) Handle_for uses reference counters.

I am wondering if the reference counting strategy (in Handle_for) could be the cause of this errors?

Thanks
-- Antonio Azambuja



2015-02-12 11:54 GMT-02:00 Sebastien Loriot (GeometryFactory) <>:
On 02/12/2015 02:53 PM, Antonio Carlos Pereira de Azambuja wrote:
Hi,

I am using CGAL to solve nearest neighbor search in 4 dimensional.

I would like to know if I can build a single kdtree object and perform
parallel searches in each thread of an OMP loop. Each thread has its own
search object. The problem could be illustrated by the draft code below:

int main(void)
{

     // create a kdTree from a point cloud
     CGAL::Orthogonal_k_neighbor_search<Traits>::Tree   *kdTree;
     kdTree = new CGAL::Orthogonal_k_neighbor_search<Traits>::Tree(
points.begin(), points.end() )
     .
     .
     .
     // perform several searches in an OMP loop
#pragma omp parallel .....
    for (counter =0; ....)
   {
      .
      .
      CGAL::Cartesian_d<FT>::Point_d query(......); // define a query point
      CGAL::Orthogonal_k_neighbor_search<Traits>      search( *kdTree,
query, 1);
      .
      .
   } //end for
}//end main


Thanks in advance for any help.
-- Antonio Azambuja

Yes it is.

Sebastien.

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss






Archive powered by MHonArc 2.6.18.

Top of Page