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 12:44:03 -0300

Ok! I will try!
Do you have any idea when the fix will be available?

-- Antonio Azambuja

2015-02-23 11:32 GMT-03:00 Sebastien Loriot (GeometryFactory) <>:
On 02/23/2015 03:16 PM, Antonio Carlos Pereira de Azambuja wrote:
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?

Indeed, the class Handle_for is not yet thread-safe.
We'll provide soon an official fix for that.

In the meantime you can try the one provided in this mailing list:
https://sympa.inria.fr/sympa/arc/cgal-discuss/2015-01/msg00073.html

Sebastien.


Thanks
-- Antonio Azambuja



2015-02-12 11:54 GMT-02:00 Sebastien Loriot (GeometryFactory)
< <mailto:>>:

    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
    <https://sympa.inria.fr/sympa/info/cgal-discuss>





--
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