Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Heap corruption when constructing AABB tree with OPENMP

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Heap corruption when constructing AABB tree with OPENMP


Chronological Thread 
  • From: Yifang Zhao <>
  • To: "" <>
  • Subject: Re: [cgal-discuss] Heap corruption when constructing AABB tree with OPENMP
  • Date: Sat, 22 Feb 2020 23:08:19 +0000
  • Accept-language: zh-CN, nl-NL, en-US
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:34xbYBZkOHN+/3+2ytOuie3/LSx+4OfEezUN459isYplN5qZrsy6bnLW6fgltlLVR4KTs6sC17OK9fC/EjRZqb+681k8M7V0HycfjssXmwFySOWkMmbcaMDQUiohAc5ZX0Vk9XzoeWJcGcL5ekGA6ibqtW1aFRrwLxd6KfroEYDOkcu3y/qy+5rOaAlUmTaxe7x/IAi5oAnLtcQbg4RuJrosxhDUvnZGZuNayH9nKl6Ugxvy/Nq78oR58yRXtfIh9spAXrv/cq8lU7FWDykoPn4s6sHzuhbNUQWA5n0HUmULiRVIGBTK7Av7XpjqrCT3sPd21TSAMs33SbA0Ximi77tuRRT1hioLKyI1/WfKgcF2kalVog+upwZnzoDUfo+bKeZ+cK3ec9MUR2VOQsleWjdbDY+gaosCFfYNMfpaooT7ulAArQG+BQ6pBO73yDBIh3H20rc80+QuDArJ3wwgEMgJsH/Jq9j6Nr0eXuO1zKbSyjXPdu5a1DTm5YjTbhAhvOyDUqx2ccrN00UvCx7FgUiOpozhMTOVyv4Bs26f7+d5U++klmApqwZ0oje1x8csjJHEiZ4ayl/e8SV12oE1Jce3SEJjZN6kEYdftzudN4ttRcMiTX1otDwmxb0BvJ62ejUBxpc/xxPHdvCKfZSE7gj+WOuQPDt0nm9pdbyiixqo8UWs0uP8Wde33VpWqydIl9rBum0C2hDN78WKSuZy80S81juK1A3c9P9ILEExmKXGNpEu36M/m5wOukrZBCD2gl/5jKqOe0Uk5Oeo7+Pnb63jppCGNo90jhr+Pbo0msyhAOQ3LhYBU3KH+eShybLs40n5QLtWjvEslKnZtIjWJcUdpqGnHw9Yypsv5hijAzu8zdgVnGQLIEhYdB+JkoTlIVHDLOj9DfilglSslDlrx+rBPr3kGpjCLGLPn7Thfbln7E5Q0Rc/wNNE6pJPFrEBPe/8VVH3tNzEFBM5LxG0zPv5B9V52IMeRXiDAqmdMK/Kq1+H+vovI/WQZI8SoDvyN/cl6OTqjXMghFAdfLKp0ocKaHCjBfRrOF6ZYHrpgtcZC2gGpAs+TOrwiF2DSzFffXiyX7hvrg08XcitAo7HA4ysm7ecxzyTH5tMZ2kABErGWSPjeIyAHvsNcymPOdRJkzoeVLHnRZV3hj+0swqv+rtpJ+zbsh8YvJWrgOkz1e3aklRrpRRvE9mR3meRCX1pkm4MSSNw2qQp8h818UuKzaUt268QLtdU/f4cCl5rZ66Z9PRzDpXJYiyEe96ITFi8RdD8WWMqUs89ztkSJVpgF9imgAyF2S74WuZIxYzOP4Q99+fn51a0J8t5zCyahqwojl09T9FRNGarwLJi+wXXCZKPlUHLz//2J5RZ5zbE8SK49UTLpFtRClYiSrnYUX0Zeg3KsNj04k3eCbmqW+wq

Brilliant! It really helps me a lot! Btw, the Package you recommend is quite related to my work and I will dig into it later! Thanks!

Sent from my iPhone

On Feb 22, 2020, at 11:25 PM, Andreas Fabri <> wrote:




You could determine what primitives intersect in parallel with Epic and

OutputIterator CGAL::AABB_tree< Tr >::all_intersected_primitives ( const Query &  query,


OutputIterator  out 

)
const

https://doc.cgal.org/latest/AABB_tree/classCGAL_1_1AABB__tree.html#a9f40594599eded5f9a79f74186710697

and then in a sequential pass compute the intersections.


By the way, did you have a look at the slicer:

https://doc.cgal.org/latest/Polygon_mesh_processing/index.html#title52

Best,

Andreas


On 2/22/2020 11:12 PM, Yifang Zhao wrote:
But I need to compute the exact intersections between a plane and the polyhedron. That’s why I am using epec for aabbtree. Is there any solutions to do this? Or it is not possible yet?

Sent from my iPhone


Epec is currently not multi-threading safe.
The AABB Tree does not need exact constructions, so we should think
about a way to use the points/triangles/planes for Epic, together with
the face handles of the Polyhedron parameterized with Epec.

andreas

On 2/22/2020 9:55 PM, Yifang Zhao wrote:

I am using EPEC Kernel.

 

 

Sent from Mail for Windows 10

 

From: Andreas Fabri
Sent: 2020
222 21:54
To:
Subject: Re: [cgal-discuss] Heap corruption when constructing AABB tree with OPENMP

 

What kernel do you use?

On 2/22/2020 9:51 PM, Yifang Zhao wrote:

I have a for loop containing approximately 1,000,000 iterations of calling AABBTree.all_intersections() method. Thus, I use #pragma omp parallel for to speed up the program. However, I got an error as "A heap has been corrupted". The cpp file is roughly like the following:

Polyhedron polyhedron;
Facet_tree m_facet_tree(faces(m_polyhedron).first, faces(m_polyhedron).second, m_polyhedon);
 
#pragma omp parallel for
for (int i = 0; i<100; ++i){
    Plane plane = Plane(1, 0, 0, 0);
 
    // Compute intersections
    typedef std::vector<Facet_tree::Object_and_primitive_id> Intersections;
    Intersections intersections;
    m_facet_tree.all_intersections(plane, std::back_inserter(intersections));
}
Finally, The program will break here:
    ~Handle()
    {
    if ( PTR && (--PTR->count == 0))
        delete PTR;
    }
What are the possible reasons that cause this problem? Thanks a lot!

Kind Regards,

Yifang Zhao.

 

Sent from Mail for Windows 10

 

-- 
Andreas Fabri, PhD
Chief Officer, GeometryFactory
Editor, The CGAL Project

phone: +33.492.954.912    skype: andreas.fabri
-- 
Andreas Fabri, PhD
Chief Officer, GeometryFactory
Editor, The CGAL Project

phone: +33.492.954.912    skype: andreas.fabri
-- 
Andreas Fabri, PhD
Chief Officer, GeometryFactory
Editor, The CGAL Project

phone: +33.492.954.912    skype: andreas.fabri



Archive powered by MHonArc 2.6.18.

Top of Page