Abstract
We introduce Finch, a Julia-based domain specific language (DSL) for solving partial differential equations in a discretization agnostic way, currently including finite element and finite volume methods. A key focus is code generation for various internal or external software targets. Internal targets use a modular set of tools in Julia providing a direct solution within the framework. In contrast, external code generation produces a set of code files to be compiled and run with external libraries or frameworks. Examples include a matlab target, for smaller problems or prototyping, or C++/MPI based targets for larger problems needing scalability. This allows us to take advantage of their capabilities without needlessly duplicating them, and provides options tailored to the needs of the domain scientist. The modular design of Finch allows ongoing development of these target modules resulting in a more extensible framework and a broader set of applications. The support for multiple discretizations, including finite element and finite volume methods, also contributes to this goal. Another focus of this project is complex systems containing a large set of coupled PDEs that could be challenging to efficiently code and optimize by hand, but that are relatively simple to specify using the DSL. In this paper we present the key features of Finch that set it apart from many other DSL options, and demonstrate the basic usage and current capabilities through examples.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Alnæs, M.S., Logg, A., Ølgaard, K.B., Rognes, M.E., Wells, G.N.: Unified form language: a domain-specific language for weak formulations of partial differential equations. ACM Trans. Math. Softw. 40(2) (2014). https://doi.org/10.1145/2566630
Alnaes, M.S., et al.: The fenics project version 1.5. Arch. Numer. Softw. 3(100), 9–23 (2015). https://doi.org/10.11588/ans.2015.100.20553
Arndt, D., et al.: The deal.II library, version 9.2. J. Numer. Math. 28(3), 131–146 (2020). https://doi.org/10.1515/jnma-2020-0043, https://dealii.org/deal92-preprint.pdf
Cantwell, C., et al.: Nektar++: an open-source spectral/HP element framework. Comput. Phys. Commun. 192, 205–219 (2015). https://doi.org/10.1016/j.cpc.2015.02.008
Dorozhinskii, R., Bader, M.: Seissol on distributed multi-GPU systems: Cuda code generation for the modal discontinuous galerkin method. In: The International Conference on High Performance Computing in Asia-Pacific Region, pp. 69–82. HPC Asia 2021, ACM Press, New York (2021). https://doi.org/10.1145/3432261.3436753
Dune: Dune (2022). https://www.dune-project.org
Fernando, M., Neilsen, D., Lim, H., Hirschmann, E., Sundar, H.: Massively parallel simulations of binary black hole intermediate-mass-ratio inspirals. SIAM J. Sci. Comput. 42(2), 97–138 (2019). https://doi.org/10.1137/18M1196972
Fernando, M., Neilsen, D., Sundar, H.: A scalable framework for adaptive computational general relativity on heterogeneous clusters. In: Proceedings of the ACM International Conference on Supercomputing, pp. 1–12. ICS 2019, ACM Press, New York (2019). https://doi.org/10.1145/3330345.3330346
Fernando, M., Sundar, H.: Dendro home page (2020). https://octree.org
Foundation, T.O.: Openfoam (2022). https://openfoam.org
Hammer, J.: Pycachesim: python cache hierarchy simulator (2001). https://github.com/RRZE-HPC/pycachesim
Hecht, F.: New development in freefem++. J. Numer. Math. 20(3–4), 251–265 (2012), https://freefem.org/
Heisler, E., Deshmukh, A., Sundar, H.: Finch code repository (2022). https://github.com/paralab/Finch
Hesthaven, J.S., Warburton, T.: Nodal Discontinuous Galerkin Methods: Algorithms, Analysis, and Applications. Springer, New York (2008). https://doi.org/10.1007/978-0-387-72067-8
Homolya, M., Kirby, R.C., Ham, D.A.: Exposing and exploiting structure: optimal code generation for high-order finite element methods (2017). https://arxiv.org/abs/1711.02473
JuliaLang.org: Julia benchmarks (2021). https://julialang.org/benchmarks
Kempf, D., Heß, R., Müthing, S., Bastian, P.: Automatic code generation for high-performance discontinuous galerkin methods on modern architectures. ACM Trans. Math. Software 47(1), 1–31 (2020). https://doi.org/10.1145/3424144
Kirby, R.C., Logg, A.: A compiler for variational forms. ACM Trans. Math. Softw. 32(3), 417–444 (2006). https://doi.org/10.1145/1163641.1163644
Logg, A., Wells, G.N.: Dolfin: Automated finite element computing. ACM Trans. Math. Softw. 37(2) (2010). https://doi.org/10.1145/1731022.1731030
Louboutin, M., et al.: Devito (v3.1.0): an embedded domain-specific language for finite differences and geophysical exploration. Geoscientific Model Dev. 12(3), 1165–1187 (2019). https://doi.org/10.5194/gmd-12-1165-2019
Macià, S., Martínez-Ferrer, P.J., Mateo, S., Beltran, V., Ayguadé, E.: Assembling a high-productivity dsl for computational fluid dynamics. In: Proceedings of the Platform for Advanced Scientific Computing Conference, pp. 1–11. PASC 2019, ACM Press, New York (2019). https://doi.org/10.1145/3324989.3325721
McRae, A.T.T., Bercea, G.T., Mitchell, L., Ham, D.A., Cotter, C.J.: Automated generation and symbolic manipulation of tensor product finite elements. SIAM J. Sci. Comput. 38(5), 25–47 (2016). https://doi.org/10.1137/15M1021167
Pietro, D.A.D., Gratien, J.M., Häberlein, F., Michel, A., Prud’homme, C.: Basic concepts to design a dsl for parallel finite volume applications: extended abstract. In: Proceedings of the 8th workshop on Parallel/High-Performance Object-Oriented Scientific Computing, pp. 1–12. POOSC 2009, ACM Press, New York (2009). https://doi.org/10.1145/1595655.1595658
Rackauckas, C., Nie, Q.: Differentialequations.jl-a performant and feature-rich ecosystem for solving differential equations in julia. J. Open Res. Softw. 5(1), 15 (2017)
Rathgeber, F., et al.: Firedrake: automating the finite element method by composing abstractions. ACM Trans. Math. Softw. 43(3), 1–27 (2016). https://doi.org/10.1145/2998441
Sundar, H., Sampath, R., Biros, G.: Bottom-up construction and 2:1 balance refinement of linear octrees in parallel. SIAM J. Sci. Comput. 30(5), 2675–2708 (2008)
Tran, H., Sundar, H.: A scalable adaptive-matrix spmv for heterogeneous architectures. In: Proceedings of the IEEE International Parallel and Distributed Processing Symposium. IPDPS 2022, accepted for publication (2022)
Uphoff, C., Bader, M.: Yet another tensor toolbox for discontinuous galerkin methods and other applications. ACM Trans. Math. Software 46(4), 1–40 (2020). https://doi.org/10.1145/3406835
Xie, J., Ehmann, K., Cao, J.: Metafem: a generic fem solver by meta-expressions (2021)
Acknowledgements
This work was funded by National Science Foundation grants 1808652 and 2008772. The computing resources on Frontera were through an allocation by the Texas Advanced Computing Center PHY20033.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Heisler, E., Deshmukh, A., Sundar, H. (2022). Finch: Domain Specific Language and Code Generation for Finite Element and Finite Volume in Julia. In: Groen, D., de Mulatier, C., Paszynski, M., Krzhizhanovskaya, V.V., Dongarra, J.J., Sloot, P.M.A. (eds) Computational Science – ICCS 2022. ICCS 2022. Lecture Notes in Computer Science, vol 13350. Springer, Cham. https://doi.org/10.1007/978-3-031-08751-6_9
Download citation
DOI: https://doi.org/10.1007/978-3-031-08751-6_9
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-08750-9
Online ISBN: 978-3-031-08751-6
eBook Packages: Computer ScienceComputer Science (R0)