A Parallel Delaunay algorithm for CGAL David Millman Advisor: Sylvain Pion July 26th 2007.
-
date post
20-Dec-2015 -
Category
Documents
-
view
224 -
download
1
Transcript of A Parallel Delaunay algorithm for CGAL David Millman Advisor: Sylvain Pion July 26th 2007.
![Page 1: A Parallel Delaunay algorithm for CGAL David Millman Advisor: Sylvain Pion July 26th 2007.](https://reader033.fdocuments.in/reader033/viewer/2022052701/56649d4d5503460f94a2b568/html5/thumbnails/1.jpg)
A Parallel Delaunay algorithm for CGAL
David Millman
Advisor: Sylvain Pion
July 26th 2007
![Page 2: A Parallel Delaunay algorithm for CGAL David Millman Advisor: Sylvain Pion July 26th 2007.](https://reader033.fdocuments.in/reader033/viewer/2022052701/56649d4d5503460f94a2b568/html5/thumbnails/2.jpg)
Goal
To create a parallel implementation of Delaunay Triangulation in R3 with CGAL for shared memory parallel machines using OpenMP.
![Page 3: A Parallel Delaunay algorithm for CGAL David Millman Advisor: Sylvain Pion July 26th 2007.](https://reader033.fdocuments.in/reader033/viewer/2022052701/56649d4d5503460f94a2b568/html5/thumbnails/3.jpg)
Motivation
• Delaunay’s many uses– Meshing in finite element theory– computational biology– geometric modeling– anything that can be done with a Voronoi diagram
• Multi-Processor systems– more common– multi core systems
![Page 4: A Parallel Delaunay algorithm for CGAL David Millman Advisor: Sylvain Pion July 26th 2007.](https://reader033.fdocuments.in/reader033/viewer/2022052701/56649d4d5503460f94a2b568/html5/thumbnails/4.jpg)
Motivation (cont.)
• Big data sets– Robust algorithms to mesh billions of points– Sequentially CGAL
• 1 processor and 16GB ram, 10 million points ~120 seconds and uses 5.5GB ram
– Blandford, Belloch, Kadow ‘06 • 64 processors and 200GB ram 1 billion points 5512
seconds and used 197GB
![Page 5: A Parallel Delaunay algorithm for CGAL David Millman Advisor: Sylvain Pion July 26th 2007.](https://reader033.fdocuments.in/reader033/viewer/2022052701/56649d4d5503460f94a2b568/html5/thumbnails/5.jpg)
Tools
• CGAL - Computational Geometry Algorithms Librarywww.cgal.org
• OpenMP - API for shared memory parallel programming www.openmp.org
• Capricorne2 quad core processors (8 cores)16GB ram
![Page 6: A Parallel Delaunay algorithm for CGAL David Millman Advisor: Sylvain Pion July 26th 2007.](https://reader033.fdocuments.in/reader033/viewer/2022052701/56649d4d5503460f94a2b568/html5/thumbnails/6.jpg)
CGAL Delaunay Algorithm
• Locate
• Find Conflict Region
• Create New Cells
• Remove invalid cells
![Page 7: A Parallel Delaunay algorithm for CGAL David Millman Advisor: Sylvain Pion July 26th 2007.](https://reader033.fdocuments.in/reader033/viewer/2022052701/56649d4d5503460f94a2b568/html5/thumbnails/7.jpg)
Steps to Parallelization
• Compact Container
• Locate
• Find Conflict Region
• Create New Cells
![Page 8: A Parallel Delaunay algorithm for CGAL David Millman Advisor: Sylvain Pion July 26th 2007.](https://reader033.fdocuments.in/reader033/viewer/2022052701/56649d4d5503460f94a2b568/html5/thumbnails/8.jpg)
Locks
• OpenMP provides– Test lock– Wait lock
• Priority lock– Lock and priority pair– Test lock– Priority lock
![Page 9: A Parallel Delaunay algorithm for CGAL David Millman Advisor: Sylvain Pion July 26th 2007.](https://reader033.fdocuments.in/reader033/viewer/2022052701/56649d4d5503460f94a2b568/html5/thumbnails/9.jpg)
CGAL Locks• Omp_lock_traits
– Export types• Lock_type• Priority_type
– Constants• max_num_threads• is_parallel
– Static function to handle omp functions• static void set_num_threads(int i)• static size_t get_num_threads()• static void wait_lock(Lock_type* lock)
– Priority lock• bool priority_lock(Priority_type p)• bool test_lock(Priority_type p)• void unset_lock()• bool is_priority(Priority_type p) const
• Omp_empty_lock_traits– Same interface
![Page 10: A Parallel Delaunay algorithm for CGAL David Millman Advisor: Sylvain Pion July 26th 2007.](https://reader033.fdocuments.in/reader033/viewer/2022052701/56649d4d5503460f94a2b568/html5/thumbnails/10.jpg)
Compact Container
• STL like container• Pointers to 4 byte
aligned objects• Iterators are not
invalidated during insert and delete
• Memory
Free List
n n
![Page 11: A Parallel Delaunay algorithm for CGAL David Millman Advisor: Sylvain Pion July 26th 2007.](https://reader033.fdocuments.in/reader033/viewer/2022052701/56649d4d5503460f94a2b568/html5/thumbnails/11.jpg)
MT-Compact Container
• Each thread maintains its own free list– Insert– Delete– Allocate
• Only lock for allocation
• • Size Formula
• Memory size capacity freeList
ii
Free List
n NT * nWhere NT = number of threads
![Page 12: A Parallel Delaunay algorithm for CGAL David Millman Advisor: Sylvain Pion July 26th 2007.](https://reader033.fdocuments.in/reader033/viewer/2022052701/56649d4d5503460f94a2b568/html5/thumbnails/12.jpg)
MT-Compact Container (cont.)
• Old:– Compact_container<T, Allocator = Default_allocator>
• New:– Compact_container<T, Allocatror = Default_allocator,
Lock_type = Omp_empty_lock_traits>– No new functions– Free list array is a boost array parameterized on
lock_traits::max_num_threads
![Page 13: A Parallel Delaunay algorithm for CGAL David Millman Advisor: Sylvain Pion July 26th 2007.](https://reader033.fdocuments.in/reader033/viewer/2022052701/56649d4d5503460f94a2b568/html5/thumbnails/13.jpg)
Locate point p
• Start at some cell, cx
y
z
• Determine which face, f, of c, p is outside of
• Continue until p is contained in the current cell
• Repeat with the adjacent cell that shares f with c
c
![Page 14: A Parallel Delaunay algorithm for CGAL David Millman Advisor: Sylvain Pion July 26th 2007.](https://reader033.fdocuments.in/reader033/viewer/2022052701/56649d4d5503460f94a2b568/html5/thumbnails/14.jpg)
MT-Locate
• Same steps as Locate, but we must lock and unlock the vertices of the cells, to avoid the cell being destroyed.
z
x
y
![Page 15: A Parallel Delaunay algorithm for CGAL David Millman Advisor: Sylvain Pion July 26th 2007.](https://reader033.fdocuments.in/reader033/viewer/2022052701/56649d4d5503460f94a2b568/html5/thumbnails/15.jpg)
Find Conflict Region
• Initialize c, be the cell containing p
• If p is in the circumcircle of the vertices of the c mark it as conflict
• Expand until conflict region is found
![Page 16: A Parallel Delaunay algorithm for CGAL David Millman Advisor: Sylvain Pion July 26th 2007.](https://reader033.fdocuments.in/reader033/viewer/2022052701/56649d4d5503460f94a2b568/html5/thumbnails/16.jpg)
MT-Find Conflict Region
• Once again, same steps, but we must lock and unlock vertices to avoid deadlocks
![Page 17: A Parallel Delaunay algorithm for CGAL David Millman Advisor: Sylvain Pion July 26th 2007.](https://reader033.fdocuments.in/reader033/viewer/2022052701/56649d4d5503460f94a2b568/html5/thumbnails/17.jpg)
Create New Cell
• Remove cells which are in conflict creating a hole
• Triangulate the hole with a star
![Page 18: A Parallel Delaunay algorithm for CGAL David Millman Advisor: Sylvain Pion July 26th 2007.](https://reader033.fdocuments.in/reader033/viewer/2022052701/56649d4d5503460f94a2b568/html5/thumbnails/18.jpg)
MT-Create New Cell
The same as Create New Cell
…Just release the locks at the end.
• Remove cells which are in conflict creating a hole
• Triangulate the hole with a star
![Page 19: A Parallel Delaunay algorithm for CGAL David Millman Advisor: Sylvain Pion July 26th 2007.](https://reader033.fdocuments.in/reader033/viewer/2022052701/56649d4d5503460f94a2b568/html5/thumbnails/19.jpg)
TDS
• Vertex base– Old: TDS_vertex_base<TDS>
– New: TDS_vertex_base<TDS, LT=Omp_empty_lock_traits>
– Private derivation of Priority_lock
– Functions for locking, unlocking, etc.
• Cell base – no changes• TDS
– Added functions to help with locking and unlocking• priority_lock_cell, priority_lock_mirror_vertex, • is_locked (vertex and cell)• lock (vertex and cell)
![Page 20: A Parallel Delaunay algorithm for CGAL David Millman Advisor: Sylvain Pion July 26th 2007.](https://reader033.fdocuments.in/reader033/viewer/2022052701/56649d4d5503460f94a2b568/html5/thumbnails/20.jpg)
Triangulation_3 and Delaunay_3
• Triangulation_3– parallel_locate(Point p, Vertex start)
• vertex as hint
• cell returned is locked
– error_vertex • query and access functions (similar to infinite vertex)
• Delaunay_3– parallel_insert(Iterator begin, Iterator end, int num_threads)
![Page 21: A Parallel Delaunay algorithm for CGAL David Millman Advisor: Sylvain Pion July 26th 2007.](https://reader033.fdocuments.in/reader033/viewer/2022052701/56649d4d5503460f94a2b568/html5/thumbnails/21.jpg)
CC Results (cont.)
![Page 22: A Parallel Delaunay algorithm for CGAL David Millman Advisor: Sylvain Pion July 26th 2007.](https://reader033.fdocuments.in/reader033/viewer/2022052701/56649d4d5503460f94a2b568/html5/thumbnails/22.jpg)
Compact Comtainer Results
![Page 23: A Parallel Delaunay algorithm for CGAL David Millman Advisor: Sylvain Pion July 26th 2007.](https://reader033.fdocuments.in/reader033/viewer/2022052701/56649d4d5503460f94a2b568/html5/thumbnails/23.jpg)
Locate Results
![Page 24: A Parallel Delaunay algorithm for CGAL David Millman Advisor: Sylvain Pion July 26th 2007.](https://reader033.fdocuments.in/reader033/viewer/2022052701/56649d4d5503460f94a2b568/html5/thumbnails/24.jpg)
Locate Results (cont.)
![Page 25: A Parallel Delaunay algorithm for CGAL David Millman Advisor: Sylvain Pion July 26th 2007.](https://reader033.fdocuments.in/reader033/viewer/2022052701/56649d4d5503460f94a2b568/html5/thumbnails/25.jpg)
Delaunay Results
![Page 26: A Parallel Delaunay algorithm for CGAL David Millman Advisor: Sylvain Pion July 26th 2007.](https://reader033.fdocuments.in/reader033/viewer/2022052701/56649d4d5503460f94a2b568/html5/thumbnails/26.jpg)
Delaunay Results (cont.)
![Page 27: A Parallel Delaunay algorithm for CGAL David Millman Advisor: Sylvain Pion July 26th 2007.](https://reader033.fdocuments.in/reader033/viewer/2022052701/56649d4d5503460f94a2b568/html5/thumbnails/27.jpg)
Delaunay Results (cont.)
![Page 28: A Parallel Delaunay algorithm for CGAL David Millman Advisor: Sylvain Pion July 26th 2007.](https://reader033.fdocuments.in/reader033/viewer/2022052701/56649d4d5503460f94a2b568/html5/thumbnails/28.jpg)
Results Summary
• Compact Container
• Locate
• Delaunay
![Page 29: A Parallel Delaunay algorithm for CGAL David Millman Advisor: Sylvain Pion July 26th 2007.](https://reader033.fdocuments.in/reader033/viewer/2022052701/56649d4d5503460f94a2b568/html5/thumbnails/29.jpg)
Future work
• Optimize
• Optimize
• Optimize
• Optimize
• Parallel mesh refinement
• Mesh compression
![Page 30: A Parallel Delaunay algorithm for CGAL David Millman Advisor: Sylvain Pion July 26th 2007.](https://reader033.fdocuments.in/reader033/viewer/2022052701/56649d4d5503460f94a2b568/html5/thumbnails/30.jpg)
Thank you
• INRIA, NSF, REUSSI, Sylvain Pion and Chee Yap and Everyone responsible for putting this program together.