Subject: CGAL users discussion list
List archive
Re: [cgal-discuss] AABBTree very slow performance when using openmp multithreading
Chronological Thread
- From: Rash <>
- To: "" <>
- Subject: Re: [cgal-discuss] AABBTree very slow performance when using openmp multithreading
- Date: Wed, 4 Jul 2018 21:07:17 +0200
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=None ; spf=None
- Ironport-phdr: 9a23:zKC7nBIfvHuBawihiNmcpTZWNBhigK39O0sv0rFitYgRL/jxwZ3uMQTl6Ol3ixeRBMOHs6wC07KempujcFRI2YyGvnEGfc4EfD4+ouJSoTYdBtWYA1bwNv/gYn9yNs1DUFh44yPzahANS47xaFLIv3K98yMZFAnhOgppPOT1HZPZg9iq2+yo9JDffwRFiCChbb9uMR67sRjfus4KjIV4N60/0AHJonxGe+RXwWNnO1eelAvi68mz4ZBu7T1et+ou+MBcX6r6eb84TaFDAzQ9L281/szrugLdQgaJ+3ART38ZkhtMAwjC8RH6QpL8uTb0u+ZhxCWXO9D9QLYpUjqg8qhrUgflhjoHOTAn6mHXhM9+gqxVrx2upRNw34HabZqJNPd9ZK7RYc8WSGRDU8tXSidPApm8b4wKD+cZIehXtZL9p1sTpha5HwmjHvjvyj9JhnDrxqA61uUhEQXc0wM8GNIOtW7Yo8jrO6oLV+2+0arGzS3bYv5V2Trx8pXEfx47rf2RU799ddDdxVQsGg7GllmctI/oMjCP2ukJsmWX9fdsWOGxh2I9tQ19vjiiy8ExgYfTnI0V0ErL9SBhzYY1O9K4TEl7bMa5H5RNqi2XM4R7Tt0tTm1yuyY10KYGuYWlcygQ1pQo2QTfZ+abfIiP5xLvTOeRITFmi3J5YL+yhBa//VK9xuDyTMW4zVhHoy5fntXRtX0A1ATf6s2dRft8+keh1yyP1wfW6uxcO0A7j7HbK54gwrEtjZcTtEXDHivsl0rqi6+Wc18o9fW25Oj/eLXpuoecN5NoigH5KqkhhsO/Dv48MgQXQmeb+P+826H+/U3iW7VHleY2k6ncsJDCP8sXvK+5AwlP0oYi8RmzFTmm0M5L1UUAeRhOdxuDyoToIFrTO+vQDPGlgl3qni0hj6TNMbTlR5nMNXPei6zJfLBn6kcaxhBlnupS/5ZFNrZUK/36Xgr9tcfTEwQiGw2y2efuTttnha0EXmfaOKaCMOuGq1aT5uMjC+yNYIYevzO7J/VztK2mtmMwhVJIJfrh5pAQcn3tRq03cXXcWmLlh5I6KUlPuwM/SOLwj1jbC2xWZnK7VKU5oD02Wtr/UdXzA7u1ibnE5x+VW4VMbzkcWFWNFX7jcIDCV/peMHvPcP8kqSQNUP2ac6Fk1Ryqs1WhmbZrd7uIoHFetpv4z9Vv+eDJ0xo18G4sAg==
Please ignore this mail, the problem was the scene, where only one 1/4 contains geometrie. The better stepping y=y+number_of_threads was responsible for the speedup. Sorry for wasting your time.
Am 04.07.2018 um 20:32 schrieb Rash:
It looks like that AABBTree is locked when an other thread is using it. When you are using a single tree per thread you get the full speed. I am using the CGAL::Simple_cartesian<double> Kernel.
Runtime 16 secs, independ of #pragma omp parallel for, only one core is used in system manager (ubuntu):
#pragma omp parallel for
for(size_t y = 0; y < number_of_ray_y; y++)
{
for(size_t x = 0; x < number_of_ray_x; x++)
{
Ray_intersection hit = tree.first_intersection(rays[this->transformCoordinates(y,x)]);
}
}
Runtime 4 secs 4 cores are used:
#pragma omp parallel
{
Tree localtree(faces(mesh).first, faces(mesh).second, mesh);
std::cout << "Start: " << omp_get_wtime() << std::endl;
size_t tid = omp_get_thread_num();
size_t number_of_threads = omp_get_num_procs();
for(size_t y = tid; y < number_of_ray_y; y=y+number_of_threads)
{
if(y >= number_of_ray_y)
{
break;
}
for(size_t x = 0; x < number_of_ray_x; x++)
{
Ray_intersection hit = localtree.first_intersection(rays[this->transformCoordinates(y,x)]);
}
}
}
This is very troubling, an acceleration structure can have a pretty huge memory footprint. Am I using something wrong?
typedef CGAL::AABB_face_graph_triangle_primitive<Polyhedron> Primitive;
typedef CGAL::AABB_traits<Kernel, Primitive> Traits;
typedef CGAL::AABB_tree<Traits> Tree;
Kind regards
Rashid
- [cgal-discuss] AABBTree very slow performance when using openmp multithreading, Rash, 07/04/2018
- Re: [cgal-discuss] AABBTree very slow performance when using openmp multithreading, Rash, 07/04/2018
Archive powered by MHonArc 2.6.18.