Abstract
Computational topology is of interest in visualization because it summarizes useful global properties of a dataset. The greatest need for such abstractions is in massive data, and to date most implementations have opted for low-level languages to obtain space and time-efficient implementations. Such code is complex, and is becoming even more so with the need to operate efficiently on a range of parallel hardware. Motivated by rapid advances in functional programming and compiler technology, this chapter investigates whether a shift in programming paradigm could reduce the complexity of the task. Focusing on contour tree generation as a case study, the chapter makes three contributions. First, it sets out the development of a concise functional implementation of the algorithm. Second, it shows that the sequential functional code can be tuned to match the performance of an imperative implementation, albeit at some cost in code clarity. Third, it outlines new possiblilities for parallelisation using functional tools, and notes similarities between functional abstractions and emerging ideas in extreme-scale visualization.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
This is a simplification. Technically, lazy evaluation is the combination of normal order reduction with overwriting the root of reducible expressions to ensure that arguments are evaluated at most once.
- 2.
- 3.
Timings were performed on an Apple MacBook, measured using the unix ‘time’ command. Programs were compiled with -O2 -prof -rtsopts -auto-all -rtsopts, enabling optimization and run-time profiling.
References
L. Arge, M. Revsbaek, Robust on-line computation of reeb graphs: simplicity and speed. Algorithms Comput. 5878, 1155–1165 (2009)
J. Backus, Can programming be liberated from the von Neumann style? A functional style and its algebra of programs. Commun. ACM 21(8), 75–94 (1978)
H. Carr, J. Snoeyink, U. Axen, Computing contour trees in all dimensions. Comput. Geom. 24(2), 75–94 (2003)
M. Chakravarty, G. Keller, S. Lee, T. McDonell, V. Grover, Accelerating haskell array codes with multicore GPUs, in Proceedings of the Declarative Aspects of Multicore Programming, Austin (ACM, 2011), pp. 3–14
C. Chiw, G. Kindlmann, J. Reppy, L. Samuels, N. Seltzer, Diderot: a parallel DSL for image analysis and visualization, in Proceedings of the Conference on Programming Language Design and Implementation, Beijing (ACM, 2012), pp. 111–120
Data.IntMap, www.haskell.org/ghc/docs/7.4-latest/html/libraries/containers-0.4.2.1/Data-IntMap.html. Last accessed Nov 2012
D. Duke, R. Borgo, C. Runciman, M. Wallace, Huge data but small programs: visualization design via multiple embedded DSLs, in Proceedings of the Practical Applications of Declarative Languages, Savannah, vol. 5418 (Springer, 2009), pp. 31–45
D. Duke, H. Carr, A. Knoll, N. Schunck, H. Nam, A. Staszczak, Visualizing nuclear scission through a multifield extension of topological analysis. Trans. Vis. Comput. Graph. 18(12), 2033–2040 (2012)
D. Duke, M. Wallace, R. Borgo, C. Runciman, Fine-grained visualization pipelines and lazy functional languages. Trans. Vis. Comput. Graph. 12(5), 973–980 (2006)
D. Günther, J. Reininghaus, H. Wagner, I. Hotz, Efficient computation of 3D morse-smale complexes and persistent homology using discrete morse theory. Vis. Comput. 28(10), 959–969 (2012)
B. Lippmeier, M. Chakravarty, G. Keller, S. Peyton Jones, Guiding parallel array fusion with indexed types, in Proceedings of the Haskell Symposium, Copenhagen (ACM, 2012), pp. 25–36
S. Maadasamy, H. Doraiswamy, V. Natarajan, A hybrid parallel algorithm for computing and tracking level set topology, in International Conference on High Performance Computing, Pune (IEEE, 2012)
S. Marlow, P. Maier, H.W. Loidl, M. Aswad, P. Trinder, Seq no more: better strategies for parallel haskell, in Proceedings of the Haskell Symposium, Baltimore (ACM, 2010), pp. 91–102
S. Marlow, R. Newton, S. Peyton Jones, A monad for deterministic parallelism, in Proceedings of the Haskell Symposium, Tokyo (ACM, 2011), pp. 71–82
J. Meredith, S. Ahern, D. Pugmire, R. Sisneros, EAVL: the extreme-scale analysis and visualization library, in Eurographics Symposium on Parallel Graphics and Visualization, Cagliari, 2012
K. Moreland, U. Ayachit, B. Geveci, K.L. Ma, Dax toolkit: a proposed framework for data analysis and visualization at extreme scale, in Symposium on Large Data Analysis and Visualization, Providence (IEEE Computer Society, 2011), pp. 97–104
B. O’Sullivan, J. Goerzen, D. Stewart, Real World Haskell (O’Reilly Media, Sebastopol, 2008)
V. Pascucci, K. Cole-McLaughlin, Parallel computation of the topology of level sets. Algorithmica 38(1), 249–268 (2004)
V. Pascucci, G. Scorzelli, P.T. Bremer, A. Mascarenhas, Robust on-line computation of reeb graphs: simplicity and speed. Trans. Graph. 26(3), 58 (2007)
N. Shivashankar, M. Senthilnathan, V. Natarajan, Parallel computation of 2D morse-smale complexes. Trans. Vis. Comput. Graph. 18(10), 1757–1770 (2012)
The Haskell Programming Language, www.haskell.org. Last accessed Nov 2012
Acknowledgements
Support for this work was provided by the UK Engineering and Physical Sciences Research Council under Grant EP/J013072/1.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2014 Springer International Publishing Switzerland
About this paper
Cite this paper
Duke, D., Carr, H. (2014). Computational Topology via Functional Programming: A Baseline Analysis. In: Bremer, PT., Hotz, I., Pascucci, V., Peikert, R. (eds) Topological Methods in Data Analysis and Visualization III. Mathematics and Visualization. Springer, Cham. https://doi.org/10.1007/978-3-319-04099-8_5
Download citation
DOI: https://doi.org/10.1007/978-3-319-04099-8_5
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-04098-1
Online ISBN: 978-3-319-04099-8
eBook Packages: Mathematics and StatisticsMathematics and Statistics (R0)