Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1145/3673038.3673141acmotherconferencesArticle/Chapter ViewAbstractPublication PagesicppConference Proceedingsconference-collections
research-article
Open access

Extending Segment Tree for Polygon Clipping and Parallelizing using OpenMP and OpenACC Directives

Published: 12 August 2024 Publication History

Abstract

A segment tree is a versatile tree-based data structure over intervals or line segments efficiently supporting several computational operations such as stabbing query, segment arrangement, and planar point location, both theoretically and practically. Polygon clipping is a basic operation in domains such as Computer Graphics, Computer-aided Design, and Geographic Information Science (GIS). Given two polygons with n vertices, polygon clipping algorithms find the geometric intersection or union in <Formula format="inline"><TexMath><?TeX $\mathcal {O}(n^2)$?></TexMath><AltText>Math 1</AltText><File name="icpp24-103-inline1" type="svg"/></Formula> time using Foster’s all-to-all edge intersection testing and <Formula format="inline"><TexMath><?TeX $\mathcal {O}((n+k)\log n)$?></TexMath><AltText>Math 2</AltText><File name="icpp24-103-inline2" type="svg"/></Formula> time using Vatti’s sweep line-based method, where k is the number of intersections. No known segment tree implementation, including the CGAL library, supports intersection finding or polygon clipping. We extended the segment tree leveraging Chaselle’s PRAM-model augmentation, parallelized the construction of our augmented segment tree, and employed it to find line segment intersections for polygon clipping while handling degenerate cases. Augmented segment tree eliminates 99% of non-intersecting edge pairs compared to 63% by the state-of-the-art filtering based on common minimum bounding rectangle method employed in Foster’s GPU-based implementation. This, coupled with Ω(nlog n) work on a single CPU core, beats Foster’s GPU performance with <Formula format="inline"><TexMath><?TeX $\mathcal {O}(n^2)$?></TexMath><AltText>Math 3</AltText><File name="icpp24-103-inline3" type="svg"/></Formula> work. Our OpenMP directive based multi-core implementation achieves up to 4X relative speedup for clipping two polygons with 182K vertices and 5X speedup for five polygons with 398K vertices. We also offloaded the parallel kernels to a GPU using OpenACC achieving performance competitive with Foster’s GPU implementation. Our profiling indicates limitations of the compiler directives and potential for superior performance by employing pthread/cuda libraries.

References

[1]
[1] 2022. https://www.naturalearthdata.com/
[2]
Danial Aghajarian, Satish Puri, and Sushil Prasad. 2016. GCMF: an efficient end-to-end spatial join system over large polygonal datasets on GPGPU platform. In Proceedings of the 24th ACM SIGSPATIAL International Conference on Advances in Geographic Information Systems. 1–10.
[3]
M K Buddhi Ashan, Satish Puri, and Sushil K Prasad. 2023. Efficient PRAM and Practical GPU Algorithms for Large Polygon Clipping with Degenerate Cases. In 2023 IEEE/ACM 23rd International Symposium on Cluster, Cloud and Internet Computing (CCGrid). IEEE, 579–591.
[4]
Samuel Audet, Cecilia Albertsson, Masana Murase, and Akihiro Asahara. 2013. Robust and efficient polygon overlay on parallel stream processors. In Proceedings of the 21st ACM SIGSPATIAL International Conference on Advances in Geographic Information Systems. 304–313.
[5]
Jon Louis Bentley. 1977. Solutions to Klee’s rectangle problems. Unpublished manuscript (1977), 282–300.
[6]
CGAL Editorial Board. 2022. CGAL: Computational Geometry Algorithms Library. https://www.cgal.org/
[7]
Albert Chan, Frank Dehne, and Andrew Rau-Chaplin. 1999. Coarse-grained parallel geometric search. J. Parallel and Distrib. Comput. 57, 2 (1999), 224–235.
[8]
Bernard Chaselle. 1984. Intersecting is easier than sorting. In Proceedings of the sixteenth annual ACM symposium on Theory of computing. 125–134.
[9]
Frank Dehne and Andrew Rau-Chaplin. 1990. Implementing data structures on a hypercube multiprocessor, and applications in parallel computational geometry. In Graph-Theoretic Concepts in Computer Science: 15th International Workshop WG’89 Castle Rolduc, The Netherlands, June 14–16, 1989 Proceedings 15. Springer, 316–329.
[10]
Ahmed Eldawy and Mohamed F. Mokbel. 2015. SpatialHadoop: A MapReduce framework for spatial data. In 31st IEEE International Conference on Data Engineering, ICDE 2015, Seoul, South Korea, April 13-17, 2015, Johannes Gehrke, Wolfgang Lehner, Kyuseok Shim, Sang Kyun Cha, and Guy M. Lohman (Eds.). IEEE Computer Society, 1352–1363. https://doi.org/10.1109/ICDE.2015.7113382
[11]
Erich L Foster, Kai Hormann, and Romeo Traian Popa. 2019. Clipping simple polygons with degenerate intersections. Computers & Graphics: X 2 (2019), 100007.
[12]
Chao Gao, Furqan Baig, Hoang Vo, Yangyang Zhu, and Fusheng Wang. 2018. Accelerating cross-matching operation of geospatial datasets using a CPU-GPU hybrid platform. In 2018 IEEE International Conference on Big Data (Big Data). IEEE, 3402–3411.
[13]
Alexandros V Gerbessiotis. 2006. An architecture independent study of parallel segment trees. Journal of Discrete Algorithms 4, 1 (2006), 1–24.
[14]
Michael T Goodrich. 1989. Intersecting line segments in parallel with an output-sensitive number of processors. In Proceedings of the first annual ACM symposium on Parallel algorithms and architectures. 127–137.
[15]
Günther Greiner and Kai Hormann. 1998. Efficient clipping of arbitrary polygons. ACM Transactions on Graphics (TOG) 17, 2 (1998), 71–83.
[16]
Joseph JáJá. 1992. An introduction to parallel algorithms. Addison Wesley Longman Publishing Co., Inc.
[17]
You-Dong Liang and Brian A Barsky. 1983. An analysis and algorithm for polygon clipping. Commun. ACM 26, 11 (1983), 868–877.
[18]
Patrick Gilles Maillot. 1992. A new, fast method for 2D polygon clipping: analysis and software implementation. ACM Transactions on Graphics (TOG) 11, 3 (1992), 276–290.
[19]
de Berg Mark, Cheong Otfried, van Kreveld Marc, and Overmars Mark. 2008. Computational geometry algorithms and applications. Spinger.
[20]
Francisco Martinez, Antonio Jesus Rueda, and Francisco Ramon Feito. 2009. A new algorithm for computing Boolean operations on polygons. Computers & Geosciences 35, 6 (2009), 1177–1185.
[21]
Rogue Modron. 2011. Polygon Clipping: a Wrapper, a Benchmark. https://rogue-modron.blogspot.com/2011/04/polygon-clipping-wrapper-benchmark.html
[22]
Jürg Nievergelt and Franco P Preparata. 1982. Plane-sweep algorithms for intersecting geometric figures. Commun. ACM 25, 10 (1982), 739–747.
[23]
Anmol Paudel. 2022. Acceleration of Computational Geometry Algorithms for High Performance Computing Based Geo-Spatial Big Data Analysis. Ph. D. Dissertation. Marquette University.
[24]
Satish Puri and Sushil K Prasad. 2014. Output-sensitive parallel algorithm for polygon clipping. In 2014 43rd International Conference on Parallel Processing. IEEE, 241–250.
[25]
Satish Puri and Sushil K Prasad. 2015. A parallel algorithm for clipping polygons with improved bounds and a distributed overlay processing system using MPI. In 2015 15th IEEE/ACM International Symposium on Cluster, Cloud and Grid Computing. IEEE, 576–585.
[26]
B-O Schneider and Jim van Welzen. 1998. Efficient polygon clipping for an SIMD graphics pipeline. IEEE Transactions on Visualization and Computer Graphics 4, 3 (1998), 272–285.
[27]
Guobin Shen, Changxi Zheng, Wei Pu, and Shipeng Li. 2007. Distributed segment tree: A unified architecture to support range query and cover query. Technical Report. Technical Report, Microsoft Research Asia.
[28]
Lucanus J Simonson. 2010. Industrial strength polygon clipping: A novel algorithm with applications in VLSI CAD. Computer-Aided Design 42, 12 (2010), 1189–1196.
[29]
Peter Su and Scot Drysdale. 1992. Building segment trees in parallel. Technical Report. Dartmouth College.
[30]
Ivan E Sutherland and Gary W Hodgman. 1974. Reentrant polygon clipping. Commun. ACM 17, 1 (1974), 32–42.
[31]
Bala R Vatti. 1992. A generic solution to polygon clipping. Commun. ACM 35, 7 (1992), 56–63.
[32]
Kevin Weiler and Peter Atherton. 1977. Hidden surface removal using polygon area sorting. ACM SIGGRAPH computer graphics 11, 2 (1977), 214–222.
[33]
Changxi Zheng, Guobin Shen, Shipeng Li, and Scott Shenker. 2006. Distributed Segment Tree: Support of Range Query and Cover Query over DHT. In IPTPS.

Index Terms

  1. Extending Segment Tree for Polygon Clipping and Parallelizing using OpenMP and OpenACC Directives

    Recommendations

    Comments

    Please enable JavaScript to view thecomments powered by Disqus.

    Information & Contributors

    Information

    Published In

    cover image ACM Other conferences
    ICPP '24: Proceedings of the 53rd International Conference on Parallel Processing
    August 2024
    1279 pages
    ISBN:9798400717932
    DOI:10.1145/3673038
    This work is licensed under a Creative Commons Attribution International 4.0 License.

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 12 August 2024

    Check for updates

    Author Tags

    1. Degenerate cases for intersection
    2. Foster’s algorithm
    3. OpenACC
    4. OpenMP
    5. Polygon clipping
    6. Segment tree
    7. Vatti’s algorithm
    8. computational geometry

    Qualifiers

    • Research-article
    • Research
    • Refereed limited

    Conference

    ICPP '24

    Acceptance Rates

    Overall Acceptance Rate 91 of 313 submissions, 29%

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • 0
      Total Citations
    • 121
      Total Downloads
    • Downloads (Last 12 months)121
    • Downloads (Last 6 weeks)34
    Reflects downloads up to 16 Nov 2024

    Other Metrics

    Citations

    View Options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    HTML Format

    View this article in HTML Format.

    HTML Format

    Login options

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media