Towards introducing just-in-time compilation in a Modelica compiler
2019 (English)In: EOOLT '19: Proceedings of the 9th International Workshop on Equation-based Object-oriented Modeling Languages and Tools / [ed] Association for Computing Machinery, New York, NY, United States: ACM Press, 2019, p. 11-19Conference paper, Published paper (Refereed)
Abstract [en]
We are investigating ways of introducing just-in-time compilation in a standard-compliant Modelica compiler, the Open-Modelica compiler (OMC). The main motivations are enabling extensions to support dynamically varying model structure, faster compilation, and faster recompilation of models after changes. We are investigating two approaches.
The first approach is to adapt the low-level OpenModelica intermediate representation (IR) before code generation to be compatible with LLVM. In that way we can avoid generating intermediate C-code and instead generate LLVM IR in memory for just-in-time compilation (JIT).
The second approach is to translate OMC itself written in MetaModelica to Julia, and thereby gain access to the JIT capabilities of LLVM. Another benefit of the second approach is the access to the Julia ecosystem, including a rich set of libraries for numerical computing.
We have done a preliminary investigation of both approaches, with measurements on a selected sample of algorithms, and discovered that compilation-time of generated Julia code is slower compared to generating LLVM IR directly. We conclude that providing a standard-compliant Modelica compiler which supports a dynamically varying model structure is feasible and possible, and we believe that such a compiler can be provided by using Julia or MetaModelica.
Place, publisher, year, edition, pages
New York, NY, United States: ACM Press, 2019. p. 11-19
Series
International Workshop on Equation-based Object-oriented Modeling Languages and Tools
Keywords [en]
OpenModelica, Modelica, LLVM, Julia, MetaModelica
National Category
Computer and Information Sciences
Identifiers
URN: urn:nbn:se:liu:diva-169770DOI: 10.1145/3365984.3365990ISBN: 9781450377133 (print)OAI: oai:DiVA.org:liu-169770DiVA, id: diva2:1468904
Conference
EOOLT '19: 9th International Workshop on Equation-Based Object-Oriented Modeling Languages and Tools, Berlin, Germany, November 5, 2019
Funder
Swedish Foundation for Strategic Research 2020-09-182020-09-182021-08-18Bibliographically approved