Parallel Volume Computation of Massive Polyhedron Union

Similar documents
Geometric Operations on Millions of Objects

ParCube. W. Randolph Franklin and Salles V. G. de Magalhães, Rensselaer Polytechnic Institute

Algorithms, libraries, and development environments to process huge geoinformatic databases on modern hardware.

Mass Properties of the Union of Millions of Polyhedra

Algorithms, libraries, and development environments to process huge geoinformatic databases on modern hardware.

Analysis of Mass Properties of the Union of Millions of Polyhedra

Efficient Parallel GIS and CAD Operations on Very Large Data Sets

Collision and Proximity Queries

Ray Tracing Acceleration Data Structures

Solid Modelling. Graphics Systems / Computer Graphics and Interfaces COLLEGE OF ENGINEERING UNIVERSITY OF PORTO

Software within building physics and ground heat storage. HEAT3 version 7. A PC-program for heat transfer in three dimensions Update manual

Lecture 17: Solid Modeling.... a cubit on the one side, and a cubit on the other side Exodus 26:13

Collision Detection. These slides are mainly from Ming Lin s course notes at UNC Chapel Hill

Line segment intersection. Family of intersection problems

Solid Modeling. Ron Goldman Department of Computer Science Rice University

CSG obj. oper3. obj1 obj2 obj3. obj5. obj4

SOME 024: Computer Aided Design. E. Rozos

Physically-Based Modeling and Animation. University of Missouri at Columbia

Homework 1: Implicit Surfaces, Collision Detection, & Volumetric Data Structures. Loop Subdivision. Loop Subdivision. Questions/Comments?

Intersection Acceleration

ADAPTIVE GRIDS FOR GEOMETRIC OPERATIONS

HARNESSING IRREGULAR PARALLELISM: A CASE STUDY ON UNSTRUCTURED MESHES. Cliff Woolley, NVIDIA

ECE276B: Planning & Learning in Robotics Lecture 5: Configuration Space

L1 - Introduction. Contents. Introduction of CAD/CAM system Components of CAD/CAM systems Basic concepts of graphics programming

9. Three Dimensional Object Representations

Anti-aliased and accelerated ray tracing. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

CPSC / Sonny Chan - University of Calgary. Collision Detection II

DiFi: Distance Fields - Fast Computation Using Graphics Hardware

Announcements. Written Assignment2 is out, due March 8 Graded Programming Assignment2 next Tuesday

Geometric Modeling Mortenson Chapter 11. Complex Model Construction

Improving Memory Space Efficiency of Kd-tree for Real-time Ray Tracing Byeongjun Choi, Byungjoon Chang, Insung Ihm

Implicit Surfaces & Solid Representations COS 426

Computer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 24 Solid Modelling

Collision handling: detection and response

Parallel Volume Computation of the Union of Many Cubes

Ray Tracing. Computer Graphics CMU /15-662, Fall 2016

Collision Detection. Jane Li Assistant Professor Mechanical Engineering & Robotics Engineering

Data Representation in Visualisation

Ray Genealogy. Raytracing: Performance. Bounding Volumes. Bounding Volume. Acceleration Classification. Acceleration Classification

Outline. CGAL par l exemplel. Current Partners. The CGAL Project.

Minkowski Sums. Dinesh Manocha Gokul Varadhan. UNC Chapel Hill. NUS CS 5247 David Hsu

Chapter 12 Solid Modeling. Disadvantages of wireframe representations

Lecture notes: Object modeling

GPGPUs in HPC. VILLE TIMONEN Åbo Akademi University CSC

Convex Hulls (3D) O Rourke, Chapter 4

Simulation in Computer Graphics Space Subdivision. Matthias Teschner

Introduction to 2D and 3D Computer Graphics. Realistic Rendering. -- Solids Modeling --

1. CONVEX POLYGONS. Definition. A shape D in the plane is convex if every line drawn between two points in D is entirely inside D.

HPC Architectures. Types of resource currently in use

Anti-aliased and accelerated ray tracing. University of Texas at Austin CS384G - Computer Graphics

Solid Modeling Lecture Series. Prof. Gary Wang Department of Mechanical and Manufacturing Engineering The University of Manitoba

11 - Spatial Data Structures

Constructive Solid Geometry and Procedural Modeling. Stelian Coros

Spatial Data Structures. Steve Rotenberg CSE168: Rendering Algorithms UCSD, Spring 2017

Offset Triangular Mesh Using the Multiple Normal Vectors of a Vertex

Collision Detection based on Spatial Partitioning

Elementary maths for GMT. Algorithm analysis Part II

Robotic Motion Planning: Cell Decompositions (with some discussion on coverage and pursuer/evader)

Spatial Data Structures

The Processor Memory Hierarchy

Outline of the presentation

Computer Graphics Ray Casting. Matthias Teschner

Some Open Problems in Graph Theory and Computational Geometry

Spatial Data Structures

Universiteit Leiden Computer Science

Accelerated Raytracing

Abstract. Introduction. Kevin Todisco

Geometry proxies (in 2D): a Convex Polygon

Indirect Volume Rendering

References. Additional lecture notes for 2/18/02.

CS S Lecture February 13, 2017

Spatial Data Structures

Hardware Accelerated Volume Visualization. Leonid I. Dimitrov & Milos Sramek GMI Austrian Academy of Sciences

Graphics Interface '82

Spatial Data Structures

Occluder Simplification using Planar Sections

CS 5630/6630 Scientific Visualization. Volume Rendering III: Unstructured Grid Techniques

Invariant Measures. The Smooth Approach

Geometric and Solid Modeling. Problems

Algorithms for GIS. Spatial data: Models and representation (part I) Laura Toma. Bowdoin College

An efficient map-reduce algorithm for spatio-temporal analysis using Spark (GIS Cup)

Spatial Data Structures

Geometric Representations. Stelian Coros

Triangle meshes I. CS 4620 Lecture 2

Who has worked on a voxel engine before? Who wants to? My goal is to give the talk I wish I would have had before I started on our procedural engine.

CS368: Geometric Algorithms Handout # 2 Design and Analysis Stanford University Monday, 17 April 2006

Direct Rendering. Direct Rendering Goals

Week 7 Convex Hulls in 3D

Geometric Modeling. Introduction

Software Structures for Virtual Environments

Topological Issues in Hexahedral Meshing

ECE 485/585 Microprocessor System Design

CPSC GLOBAL ILLUMINATION

CIS 467/602-01: Data Visualization

CS 532: 3D Computer Vision 14 th Set of Notes

OpenACC Based GPU Parallelization of Plane Sweep Algorithm for Geometric Intersection. Anmol Paudel Satish Puri Marquette University Milwaukee, WI

The Ball-Pivoting Algorithm for Surface Reconstruction

Polygon decomposition. Motivation: Art gallery problem

Scientific Visualization Example exam questions with commented answers

Accelerated Load Balancing of Unstructured Meshes

Transcription:

Parallel Volume Computation of Massive Polyhedron Union W. Randolph Franklin Rensselaer Polytechnic Institute Troy, NY, USA FWCG 2013, 25 Oct 2013 Partially supported by NSF grant IIS-1117277. Franklin (RPI) Parallel Volume Computation of Massive Polyhedron Union 25 Oct 2013 1 / 25

Large Geometric Datasets vs New HW Capabilities Large Geometric Datasets vs New HW Capabilities Larger geometric datasets 10 6 objects New parallel HW restricted capabilities Need new algorithms, data structures. Why parallel HW? More processing faster clock speed faster more electrical power faster smaller features on chip smaller greater electrical resistance! = =. Serial processors have hit a wall. Franklin (RPI) Parallel Volume Computation of Massive Polyhedron Union 25 Oct 2013 2 / 25

Parallel HW features Parallel HW features IBM Blue Gene / Intel / NVidia GPU / other. Most laptops have NVidia GPUs. Thousands of cores / CPUs / GPUs. Lower clock speed 750MHz vs 3.4GHz. Hierarchy of memory: small/fast big/slow. Communication cost computation cost. Reads much faster than writes. Semaphores protecting parallel writes are very slow. Regular memory access much faster than random. Efficient for blocks of threads to execute SIMD. OS: 187th fastest machine in 6/2013 top500.org runs Windows. 1 186 run Linux variants. Franklin (RPI) Parallel Volume Computation of Massive Polyhedron Union 25 Oct 2013 3 / 25

Geometric Databases Geometric Databases Larger and larger geometric databases now available, with tens of millions of primitive components. Needed operations: interference detection boolean: intersection, union planar graph overlay mass property computation of the results of some boolean operation Apps: Volume of an object defined as the union of many overlapping primitives. Two object interfere iff the volume of intersection is positive. Interpolate population data from census tracts to flood zones. Franklin (RPI) Parallel Volume Computation of Massive Polyhedron Union 25 Oct 2013 4 / 25

Algorithm Themes Algorithm Themes I/O more limiting than computation minimize storage For N 1000000, lg N nontrivial deprecate binary trees Minimize explicit topology, expecially 3D. Plan for 3D; many 2D data structures not easily extensible to 3D, e.g., line sweep. E.g., Voronoi diagram: 2D is Θ(N lg N). 3D is Θ ( N 2) Optimize function composition, e.g. Volume o union. Franklin (RPI) Parallel Volume Computation of Massive Polyhedron Union 25 Oct 2013 5 / 25

Unifying Example: Volume of Union of Many Cubes Unifying Example: Volume of Union of Many Cubes Nice unifying illustration of several ideas. Do a prototype on an easy subcase (congruent axis-aligned cubes). Idea extends to general polyhedra. Not statistical sampling exact output, apart from roundoff. Not subdivision-into-voxel method the cubes coordinates can be any representable numbers. Franklin (RPI) Parallel Volume Computation of Massive Polyhedron Union 25 Oct 2013 6 / 25

Application: Cutting Tool Path Application: Cutting Tool Path Represent path of a tool as piecewise line. Each piece sweeps a polyhedron. Volume of material removed is (approx) volume of union of those polyhedra. Image is from Surfware Inc s Surfcam website. Franklin (RPI) Parallel Volume Computation of Massive Polyhedron Union 25 Oct 2013 7 / 25

Traditional N-Polygon Union Traditional N-Polygon Union Construct pairwise unions of primitives. Iterate. Time depends on intermediate swell, and elementary intersection time. Let P = size of union of an M-gon and an N-gon. Then P=O(MN). Time for union (using line sweep) T = Θ(P lg P). Total T = O(N 2 lg N). Hard to parallelize upper levels of computation tree. Franklin (RPI) Parallel Volume Computation of Massive Polyhedron Union 25 Oct 2013 8 / 25

Problems With Traditional Method Problems With Traditional Method lg N levels in computation tree cause lg N factor in execution time. Consider N > 20. Intermediate swell: worse as overlap is worse. Intermediate computations may be much larger than final result. The explicit output polyhedron has complicated topology: unknown genus, loops of edges, shells of faces, nonmanifold adjacancies. Tricky to get right. However explicit output not needed for computing mass properties. Set of vertices with neighborhoods suffices. Franklin (RPI) Parallel Volume Computation of Massive Polyhedron Union 25 Oct 2013 9 / 25

Volume Determination Volume Determination Box: V = i s ix i y i z i s i : +1or 1 General rectilinear polygons: 8 types of vertices, based on neighborhood 4 are type +, 4 Area = i s ix i y i Rectilinear polyhedra: V = i s ix i y i z i formulae for general polyhedra. Franklin (RPI) Parallel Volume Computation of Massive Polyhedron Union 25 Oct 2013 10 / 25

Properties Properties Represent output union polyhedron as set of vertices with neighborhoods. no explicit edges; no edge loops. no explicit faces; no face shells. no component containment info. general polygons ok: multiple nested or separate comps. any mass property determinable in one pass thru the set. parallelizable. This is very useful because computing only the output vertices and neighborhoods is much faster than also computing the edges, faces, and global topology. Franklin (RPI) Parallel Volume Computation of Massive Polyhedron Union 25 Oct 2013 11 / 25

Volume Computation Overview Volume Computation Overview Find all vertices of output object. For each vertex, find location and local geometry. Map-reduce sum over vertices, applying formula. Challenge: to find those vertices in expected constant time per vertex. Franklin (RPI) Parallel Volume Computation of Massive Polyhedron Union 25 Oct 2013 12 / 25

Finding the Vertices Finding the Vertices 3 types of output vertex: Input vertex, Edge face intersection, Face face face intersection. Find possible output vertices, and filter. An output vertex must not be contained in any input cube. Isn t intersecting all triples of faces, then testing each candidate output vertex against every input cube too slow? No, if we do it right. Franklin (RPI) Parallel Volume Computation of Massive Polyhedron Union 25 Oct 2013 13 / 25

3D Uniform Grid 3D Uniform Grid Summary Overlay a uniform 3D grid on the universe. For each input primitive cube, face, edge find overlapping cells. In each cell, store set of overlapping primitives. Properties Simple, sparse, uses little memory if well programmed. Parallelizable. Robust against moderate data nonuniformities. Bad worst-case performance on extremely nonuniform data. Ditto any hierarchical method like octree. Advantage Intersecting primitives must occupy the same cell. The grid filters the set of possible intersections. Franklin (RPI) Parallel Volume Computation of Massive Polyhedron Union 25 Oct 2013 14 / 25

Adding the Cubes Themselves to the Grid Adding the Cubes Themselves to the Grid For each cube, find cells it completely covers. When a cell is completely covered by a cube: nothing in that cube can contribute to the output. So: Find covered cells first. Do not insert objects into covered cells. Intersect pairs and triples of objects in noncovered cells. For cell size somewhat smaller than edge size, almost no hidden intersections found. Good. Expected time = Θ(size(input) + size(useful intersections)). Franklin (RPI) Parallel Volume Computation of Massive Polyhedron Union 25 Oct 2013 15 / 25

Uniform Grid Qualities Uniform Grid Qualities Major disadvantage: It s so simple that it apparently cannot work, especially for nonuniform data. Major advantage: For the operations I want to do (intersection, containment, etc), it works very well for any real data I ve ever tried. USGS Digital Line Graph VLSI Design Mesh Franklin (RPI) Parallel Volume Computation of Massive Polyhedron Union 25 Oct 2013 16 / 25

Uniform Grid Time Analysis Uniform Grid Time Analysis Show that time to find edge edge intersections in E 2 is linear in input+output size regardless of varying number of edges per cell. N edges, length 1/L, G G grid, η edges per cell. η = λ η = N G 2 (G/L + 1) Poisson distribution, parameter λ η. Expected number of edge edge tests: (η 2 η) η = λ η and η 2 = λ η 2 + λ η. Expected number of intersection tests per cell: λ 2 η = N2 (G/L + 1) 2 G 4 Expected total number of intersection tests, over the G 2 cells: N 2 (G/L + 1) 2. G 2 Total time: ( insert edges into cells + ) test for intersections T = Θ N(LG + 1) + N2 (G/L + 1) 2. G 2 Minimized when G = Θ(L), giving T = Θ ( N + N 2 L 2). Q.E.D. Franklin (RPI) Parallel Volume Computation of Massive Polyhedron Union 25 Oct 2013 17 / 25

Face Face Face Intersection Details Face Face Face Intersection Details Iterate over grid cells. In each cell, test all triples of faces, each from a different cube. Three faces intersect if their planes intersect, and the intersection is inside each face (2D point containment). Then look up s i in a table and update accumulating volume. Cubes are easier than general polyhedra. Franklin (RPI) Parallel Volume Computation of Massive Polyhedron Union 25 Oct 2013 18 / 25

Point Containment Testing Point Containment Testing Question: P is a possible vertex of the output union polyhedron. Is point P contained in any input cube? Answer: Find which cell, C, (if any) contains P. If C is completely covered by some cube then P is inside the covering cube. Otherwise, test P against all the cubes that overlap C. Expected number of such cubes is constant, under broad conditions. Expect test time per P: constant. Franklin (RPI) Parallel Volume Computation of Massive Polyhedron Union 25 Oct 2013 19 / 25

Face Face-Face Intersection Execution Time Face Face-Face Intersection Execution Time N: number of cubes; 1/L: edge length; 1 1 1 universe. Expected number of 3-face intersections = Θ ( N 3 L 6). Effect of Grid Choose G: number of grid cells on a side = 2L. Number of face triples: N 3 Prob. of a 3-face test succeeding = N 2 L 6. Depending on asymptotic behavior of L(N), this tends to 0. Prob. of 3 tested faces actually intersecting = c, indep. of N and L(N). Big improvement! Effect of Covered Cells Expected number of 3-face intersections = Θ(N 3 L 6 ). However, for uniform i.i.d. input, expected visible number: Θ(N). Prob. computed intersection is visible = c, indep. of N and L(N). Time to test if a point is inside any cube also constant. Total time reduces to Θ(N). Franklin (RPI) Parallel Volume Computation of Massive Polyhedron Union 25 Oct 2013 20 / 25

Parallel Implementation Parallel Implementation 32 thread OpenMP. Dual 3.4GHx Xeon, 128GB memory. Don t slice up the input spatially. Inserting objects into cells uses atomic increment and capture. Very compact data structures. Compute element-cell incidences twice: 1st time just to count size of each cell. Then allocate ragged array. Finally compute again and populate array. Intersection testing and volume computation writes only with sum reduce. 824 executable lines of C++. Franklin (RPI) Parallel Volume Computation of Massive Polyhedron Union 25 Oct 2013 21 / 25

Results Results Fast small datasets: N=1000, L=10: V=0.573, A=19, T=0.02s. Medium: N=1,000,000, L=100, G = 200: V=0.6, T=3.3s. Feasible large datasets: N=100,000,000, L=400, G=1000: V=0.765, A=831, 57GB, T=473s. 10x faster with 32 threads than with one thread. 258,461,149 of the 1,000,000,000 grid cells were completely covered by some cube. Smaller cubes are faster: N=100,000,000, L=500, G=1000: T=396s, 50GB. Output vertex types for big case: 186,366,729 of the 800,000,000 input vertices outside all cubes. 395,497,686 of the intersections of 3 of the 600,000,000 input faces. 811,328,383 of the intersections of one of the 600,000,000 input faces with one of the 1,200,000,000 input edges. Franklin (RPI) Parallel Volume Computation of Massive Polyhedron Union 25 Oct 2013 22 / 25

Implementation Validation Implementation Validation It compiles and runs w/o crashing; why look for trouble? Terms summed for volume are large and mostly cancel. Errors unlikely to total to a number in [0,1]. Expected volume: 1 ( 1 L 3) N. Compare to computed volume. Assume that coincidental equivalence is unlikely. Construct specific, maybe degenerate, examples with known volume. Franklin (RPI) Parallel Volume Computation of Massive Polyhedron Union 25 Oct 2013 23 / 25

Extensions Extensions To general boolean ops: Intersection of many convex polyhedra quite easy. Any boolean op expressible in CNF as union of intersections (common technique in logic design for computer HW). To general polyhedra: Formulae are messier. Roundoff error would be biggest problem. Fatal to miss an intersection. Compute using rationals, perhaps with GMPXX. Time cost: factor of 100? Testing polyhedron validity: Illegal volume or volume change after rigid transformation invalid. Franklin (RPI) Parallel Volume Computation of Massive Polyhedron Union 25 Oct 2013 24 / 25

Summary To Process Big Geometric Datasets on Parallel Machines Summary To Process Big Geometric Datasets on Parallel Machines Guiding principles: Use minimal possible topology, and compact data structures. Short circuit the evaluation of volume(union(cubes)). I/O sensitive: design for expected input. Use lots of memory; run BIG examples to show the linear time. Allows very large 3-D datasets to be processed quickly. Source code (prototype quality) freely available for nonprofit research and education; I welcome stress tests and error reports. Franklin (RPI) Parallel Volume Computation of Massive Polyhedron Union 25 Oct 2013 25 / 25