skip to main content
research-article
Open Access

Simit: A Language for Physical Simulation

Published:29 March 2016Publication History
Skip Abstract Section

Abstract

With existing programming tools, writing high-performance simulation code is labor intensive and requires sacrificing readability and portability. The alternative is to prototype simulations in a high-level language like Matlab, thereby sacrificing performance. The Matlab programming model naturally describes the behavior of an entire physical system using the language of linear algebra. However, simulations also manipulate individual geometric elements, which are best represented using linked data structures like meshes. Translating between the linked data structures and linear algebra comes at significant cost, both to the programmer and to the machine. High-performance implementations avoid the cost by rephrasing the computation in terms of linked or index data structures, leaving the code complicated and monolithic, often increasing its size by an order of magnitude.

In this article, we present Simit, a new language for physical simulations that lets the programmer view the system both as a linked data structure in the form of a hypergraph and as a set of global vectors, matrices, and tensors depending on what is convenient at any given time. Simit provides a novel assembly construct that makes it conceptually easy and computationally efficient to move between the two abstractions. Using the information provided by the assembly construct, the compiler generates efficient in-place computation on the graph. We demonstrate that Simit is easy to use: a Simit program is typically shorter than a Matlab program; that it is high performance: a Simit program running sequentially on a CPU performs comparably to hand-optimized simulations; and that it is portable: Simit programs can be compiled for GPUs with no change to the program, delivering 4 to 20× speedups over our optimized CPU code.

Skip Supplemental Material Section

Supplemental Material

References

  1. Bruce G. Baumgart. 1972. Winged Edge Polyhedron Representation. Technical Report. Stanford University. Google ScholarGoogle Scholar
  2. Nathan Bell and Michael Garland. 2008. Efficient Sparse Matrix-Vector Multiplication on CUDA. Technical Report. Nvidia Technical Report NVR-2008-004, Nvidia Corporation.Google ScholarGoogle Scholar
  3. Guy E. Blelloch. 1990. Vector Models for Data-Parallel Computing. Vol. 356. MIT Press, Cambridge. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. David Blythe. 2006. The direct3d 10 system. ACM Transactions on Graphics 25, 3 (July 2006), 724--734. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Mario Botsch, David Bommes, and Leif Kobbelt. 2005. Efficient linear system solvers for mesh processing. In Mathematics of Surfaces XI. Springer, 62--83. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Mario Botsch, Stefan Steinberg, Stephan Bischoff, and Leif Kobbelt. 2002. OpenMesh -- A generic and efficient polygon mesh data structure. (2002).Google ScholarGoogle Scholar
  7. CGAL. 2015. Computational Geometry Algorithms Library. Retrieved from http://www.cgal.org. (2015). Accessed: 2015-09-24.Google ScholarGoogle Scholar
  8. Edgar F. Codd. 1970. A relational model of data for large shared data banks. Communications of the ACM 13, 6 (1970), 377--387. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. COMSOL AB. 2005. COMSOL Multiphysics User’s Guide. Version: September (2005).Google ScholarGoogle Scholar
  10. Erwin Coumans and others. 2006. Bullet physics library. Open Source: Bulletphysics.org 4, 6 (2006).Google ScholarGoogle Scholar
  11. Denis Demidov. 2015. AMGCL. Retrieved from http://ddemidov.github.io/amgcl.Google ScholarGoogle Scholar
  12. Zachary DeVito, Niels Joubert, Francisco Palacios, Stephen Oakley, Montserrat Medina, Mike Barrientos, Erich Elsen, Frank Ham, Alex Aiken, Karthik Duraisamy, Eric Darve, Juan Alonso, and Pat Hanrahan. 2011. Liszt: A domain specific language for building portable mesh-based PDE solvers. In Proceedings of 2011 International Conference for High Performance Computing, Networking, Storage and Analysis (SC’11). ACM, New York, NY, Article 9, 12 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Christian Dick, Joachim Georgii, and Rüdiger Westermann. 2011. A real-time multigrid finite hexahedra method for elasticity simulation using CUDA. Simulation Modelling Practice and Theory 19, 2 (2011), 801--816.Google ScholarGoogle ScholarCross RefCross Ref
  14. Pradeep Dubey, Pat Hanrahan, Ronald Fedkiw, Michael Lentine, and Craig Schroeder. 2011. PhysBAM: Physically based simulation. In ACM SIGGRAPH 2011 Courses (SIGGRAPH’11). ACM, New York, NY, Article 10, 22 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Caroline M. Eastman and Stephen F. Weiss. 1982. Tree structures for high dimensionality nearest neighbor searching. Information Systems 7, 2 (1982), 115--122.Google ScholarGoogle ScholarCross RefCross Ref
  16. Albert Einstein. 1916. The foundation of the general theory of relativity. Annalen der Physik 354 (1916), 769--822.Google ScholarGoogle ScholarCross RefCross Ref
  17. Conal Elliott. 2001. Functional image synthesis. In Proceedings of Bridges.Google ScholarGoogle Scholar
  18. François Faure, Jérémie Allard, Stéphane Cotin, Paul Neumann, Pierre-Jean Bensoussan, Christian Duriez, Hervé Delingette, and Laurent Grisoni. 2007. SOFA: A modular yet efficient simulation framework. In Surgetica 2007 - Computer-Aided Medical Interventions: Tools and Applications (Surgetica 2007, Gestes médicaux chirurgicaux assistés par ordinateur), Philippe Merloz and Jocelyne Troccaz (Eds.). Chambéry, France, 101--108.Google ScholarGoogle Scholar
  19. Eitan Grinspun, Anil N. Hirani, Mathieu Desbrun, and Peter Schröder. 2003. Discrete shells. In Proceedings of the 2003 ACM SIGGRAPH/Eurographics Symposium on Computer Animation (SCA’03). Eurographics Association, Aire-la-Ville, Switzerland, Switzerland, 62--67. http://dl.acm.org/citation.cfm?id=846276.846284 Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Gaël Guennebaud, Benoît Jacob, and others. 2010. Eigen v3. Retrieved from http://eigen.tuxfamily.org.Google ScholarGoogle Scholar
  21. Brian Guenter and Sung-Hee Lee. 2009. Symbolic Dynamics and Geometry. AK Peters.Google ScholarGoogle Scholar
  22. Leonidas Guibas and Jorge Stolfi. 1985. Primitives for the manipulation of general subdivisions and the computation of Voronoi diagrams. ACM Transactions on Graphics 4, 2 (1985), 74--123. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Richard Hamming. 2003. History of computer—software. In Art of Doing Science and Engineering: Learning to Learn. CRC Press.Google ScholarGoogle Scholar
  24. Pat Hanrahan and Jim Lawson. 1990. A language for shading and lighting calculations. In Computer Graphics (Proceedings of SIGGRAPH’90). 289--298. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Frédéric Hecht. 2015. Private communication. (May 2015).Google ScholarGoogle Scholar
  26. Hibbit, Karlsson and Sorensen Inc. 1998. ABAQUS/Standard: User’s Manual. Vol. 1. Hibbit, Karlsson and Sorensen Inc.Google ScholarGoogle Scholar
  27. Gerard J. Holzmann. 1988. Beyond Photography. Prentice Hall.Google ScholarGoogle Scholar
  28. Monica S. Lam, Jiwon Seo, and Stephen Guo. 2013. SociaLite: Datalog extensions for efficient social network analysis. In Proceedings of the IEEE 29th International Conference on Data Engineering. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. David R. Kincaid, Thomas C. Oppe, and David M. Young. 1989. ITPACKV 2D User’s Guide.Google ScholarGoogle Scholar
  30. Peter Kohnke. 1999. ANSYS Theory Reference. Ansys.Google ScholarGoogle Scholar
  31. Karen Liu. 2014. Dynamic animation and robotics toolkit. http://dartsim.github.io.Google ScholarGoogle Scholar
  32. Yucheng Low, Joseph Gonzalez, Aapo Kyrola, Danny Bickson, Carlos Guestrin, and Joseph M. Hellerstein. 2010. GraphLab: A new parallel framework for machine learning. In Proceedings of the Conference on Uncertainty in Artificial Intelligence. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. William R. Mark, R. Steven Glanville, Kurt Akeley, and Mark J. Kilgard. 2003. Cg: A system for programming graphics hardware in a c-like language. ACM Transactions on Graphics 22, 3 (July 2003), 896--907. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. MATLAB. 2014. Version 8.3.0 (R2014a). MathWorks Inc., Natick, MA.Google ScholarGoogle Scholar
  35. Aleka McAdams, Yongning Zhu, Andrew Selle, Mark Empey, Rasmus Tamstorf, Joseph Teran, and Eftychios Sifakis. 2011. Efficient elasticity for character skinning with contact and collisions. ACM Transactions on Graphics (TOG) 30 (2011), 37. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. M. Mooney. 1940. A theory of large elastic deformation. Journal of Applied Physics 11, 9 (1940), 582--592.Google ScholarGoogle ScholarCross RefCross Ref
  37. Steven G. Parker, James Bigler, Andreas Dietrich, Heiko Friedrich, Jared Hoberock, David Luebke, David McAllister, Morgan McGuire, Keith Morley, Austin Robison, and others. 2010. Optix: A general purpose ray tracing engine. ACM Transactions on Graphics (TOG) 29, 4 (2010), 66. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Keshav Pingali, Donald Nguyen, Milind Kulkarni, Martin Burtscher, M. Amber Hassaan, Rashid Kaleem, Tsung-Hsien Lee, Andrew Lenharth, Roman Manevich, Mario Méndez-Lojo, Dimitrios Prountzos, and Xin Sui. 2011. The tao of parallelism in algorithms. In Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI’11). ACM, New York, NY, 12--25. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Julien Pommier and Yves Renard. 2005. Getfem++, an open source generic C++ library for finite element methods. http://download.gna.org/getfem/html/homepage/.Google ScholarGoogle Scholar
  40. Jonathan Ragan-Kelley, Andrew Adams, Sylvain Paris, Marc Levoy, Saman Amarasinghe, and Frédo Durand. 2012. Decoupling algorithms from schedules for easy optimization of image processing pipelines. ACM Transactions on Graphics 31, 4, Article 32 (July 2012), 12 pages. DOI:http://dx.doi.org/10.1145/2185520.2185528 Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Gregorio Ricci-Curbastro and Tullio Levi-Civita. 1901. Mthodes de calcul diffrentiel absoluet leurs applications. Mathematische Annalen 54 (1901), 125--201. http://eudml.org/doc/157997Google ScholarGoogle ScholarCross RefCross Ref
  42. Mark Segal and Kurt Akeley. 1994. The OpenGL Graphics System: A Specification. Silicon Graphics, Inc.Google ScholarGoogle Scholar
  43. Fun Shing Sin, Daniel Schroeder, and J. Barbič. 2013. Vega: Non-linear FEM deformable object simulator. In Computer Graphics Forum, Vol. 32. 36--48.Google ScholarGoogle ScholarCross RefCross Ref
  44. Russell Smith. 2004. Open Dynamics Engine v0.5 User Guide.Google ScholarGoogle Scholar
  45. Eric Sedlar, Sungpack Hong, Hassan Chafi, and Kunle Olukotun. 2012. Green-Marl: A DSL for easy and efficient graph analysis. In 17th International Conference on Architectural Support for Programming Languages and Operating Systems. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. Kiril Vidimče, Szu-Po Wang, Jonathan Ragan-Kelley, and Wojciech Matusik. 2013. Openfab: A programmable pipeline for multi-material fabrication. ACM Transactions on Graphics (TOG) 32, 4 (2013), 136. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. Richard Vuduc, James W. Demmel, and Katherine A. Yelick. 2005. OSKI: A library of automatically tuned sparse matrix kernels. In Proceedings of SciDAC, Journal of Physics: Conference Series, Vol. 16. 521--530. DOI:http://dx.doi.org/10.1088/1742-6596/16/1/071Google ScholarGoogle ScholarCross RefCross Ref
  48. Daniel Weber, Jan Bender, Markus Schnoes, Andre Stork, and Dieter Fellner. 2013. Efficient GPU data structures and methods to solve sparse linear systems in dynamics applications. Computer Graphics Forum 32, 1 (2013).Google ScholarGoogle Scholar

Index Terms

  1. Simit: A Language for Physical Simulation

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      • Published in

        cover image ACM Transactions on Graphics
        ACM Transactions on Graphics  Volume 35, Issue 2
        May 2016
        154 pages
        ISSN:0730-0301
        EISSN:1557-7368
        DOI:10.1145/2882845
        Issue’s Table of Contents

        Copyright © 2016 Owner/Author

        Permission to make digital or hard copies of part or all of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for third-party components of this work must be honored. For all other uses, contact the Owner/Author.

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 29 March 2016
        • Accepted: 1 December 2015
        • Revised: 1 October 2015
        • Received: 1 May 2015
        Published in tog Volume 35, Issue 2

        Check for updates

        Qualifiers

        • research-article
        • Research
        • Refereed

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader