liu.seSearch for publications in DiVA
Change search
Link to record
Permanent link

Direct link
BETA
Sjölund, Martin
Publications (10 of 22) Show all publications
Pop, A., Östlund, P., Casella, F., Sjölund, M. & Franke, R. (2019). A New OpenModelica Compiler High Performance Frontend. In: Anton Haumer: OTH Regensburg, Germany (Ed.), Proceedings of the 13th International Modelica Conference, Regensburg, Germany, March 4–6, 2019: . Paper presented at The 13th International Modelica Conference, Regensburg, Germany, March 4–6, 2019. Linköping
Open this publication in new window or tab >>A New OpenModelica Compiler High Performance Frontend
Show others...
2019 (English)In: Proceedings of the 13th International Modelica Conference, Regensburg, Germany, March 4–6, 2019 / [ed] Anton Haumer: OTH Regensburg, Germany, Linköping, 2019Conference paper, Published paper (Refereed)
Abstract [en]

The equation-based object-oriented Modelica language allows easy composition of models from components. It is very easy to create very large parametrized models using component arrays of models. Current open-source and commercial Modelica tools can with ease handle models with a hundred thousand equations and a thousand states. However, when the system size goes above half a million (or more) equations the tools begin to have problems with scalability. This paper presents the new frontend of the OpenModelica compiler, designed with scalability in mind. The new OpenModelica frontend can handle much larger systems than the current one with better time and memory performance. The new frontend was validated against large models from the ScalableTestSuite library and Modelica Standard Library, with good results.

Place, publisher, year, edition, pages
Linköping: , 2019
Series
Linköping Electronic Conference Proceedings, ISSN 1650-3686, E-ISSN 1650-3740 ; 157
Keywords
OpenModelica, compiler, flattening, frontend, modelling, simulation, equation-based, scalability
National Category
Computer Systems
Identifiers
urn:nbn:se:liu:diva-154345 (URN)10.3384/ecp19157689 (DOI)978-91-7685-122-7 (ISBN)
Conference
The 13th International Modelica Conference, Regensburg, Germany, March 4–6, 2019
Funder
VINNOVA, 2015-03027
Available from: 2019-02-06 Created: 2019-02-06 Last updated: 2019-02-14Bibliographically approved
Fritzson, P., Pop, A., Sjölund, M. & Asghar, A. (2019). MetaModelica – A Symbolic-Numeric Modelica Language and Comparison to Julia. In: Anton Haumer: OTH Regensburg, Germany (Ed.), Proceedings of the 13th International Modelica Conference, Regensburg, Germany, March 4–6, 2019: . Paper presented at The 13th International Modelica Conference, Regensburg, Germany, March 4–6, 2019. Linköping
Open this publication in new window or tab >>MetaModelica – A Symbolic-Numeric Modelica Language and Comparison to Julia
2019 (English)In: Proceedings of the 13th International Modelica Conference, Regensburg, Germany, March 4–6, 2019 / [ed] Anton Haumer: OTH Regensburg, Germany, Linköping, 2019Conference paper, Published paper (Refereed)
Abstract [en]

The need for integrating system modeling with advanced tool capabilities is becoming increasingly pronounced. For example, a set of simulation experiments may give rise to new data that are used to systematically construct a series of new models, e.g. for further simulation and design optimization. Such combined symbolic-numeric capabilities have been pioneered by dynamically typed interpreted languages such as Lisp and Mathematica. Such capabilities are also relevant for advanced modeling and simulation applications but lacking in the standard Modelica language. Therefore, this is a topic of long-running design discussions in the Modelica Design group. One contribution in this direction is MetaModelica, that has been developed to extend Modelica with symbolic operations and advanced data structures, while preserving safe engineering practices through static type checking and a compilation-based efficient implementation. Another recent effort is Modia, implemented using the Julia macro mechanism, making it dynamically typed but also adding new capabilities. The Julia language has appeared rather recently and has expanded into a large and fast-growing ecosystem. It is dynamically typed, provides both symbolic and numeric operations, advanced data structures, and has a just-intime compilation-based efficient implementation. Despite independent developments there are surprisingly many similarities between Julia and MetaModelica. This paper presents MetaModelica and its environment as a large case study, together with a short comparison to Julia. Since Julia may be important for the future Modelica, some integration options between Modelica tools and Julia are also discussed, including a possible approach for implementing MetaModelica (and OpenModelica) in Julia.

Place, publisher, year, edition, pages
Linköping: , 2019
Series
Linköping Electronic Conference Proceedings, ISSN 1650-3686, E-ISSN 1650-3740 ; 157
Keywords
Modelica, MetaModelica, symbolic, Julia, meta-programming, language, compilation
National Category
Computer Systems
Identifiers
urn:nbn:se:liu:diva-154346 (URN)10.3384/ecp19157289 (DOI)978-91-7685-122-7 (ISBN)
Conference
The 13th International Modelica Conference, Regensburg, Germany, March 4–6, 2019
Funder
VINNOVA, 2015-03027
Available from: 2019-02-06 Created: 2019-02-06 Last updated: 2019-02-15Bibliographically approved
Berger, L., Sjölund, M. & Thiele, B. (2017). Code Generation for STM32F4 Boards with Modelica Device Drivers: [Work in Progress]. In: Proceedings of the 8th International Workshop on Equation-Based Object-Oriented Modeling Languages and Tools: . Paper presented at EOOOLT 2017, 8th International Workshop on Equation-Based Object-Oriented Modeling Languages and Tools, December 1, Munich, Germany (pp. 77-80). Association for Computing Machinery (ACM)
Open this publication in new window or tab >>Code Generation for STM32F4 Boards with Modelica Device Drivers: [Work in Progress]
2017 (English)In: Proceedings of the 8th International Workshop on Equation-Based Object-Oriented Modeling Languages and Tools, Association for Computing Machinery (ACM), 2017, p. 77-80Conference paper, Published paper (Refereed)
Place, publisher, year, edition, pages
Association for Computing Machinery (ACM), 2017
Keywords
Modelica, Embedded, STM32F4
National Category
Computer Sciences
Identifiers
urn:nbn:se:liu:diva-152480 (URN)10.1145/3158191.3158204 (DOI)978-1-4503-6373-0 (ISBN)
Conference
EOOOLT 2017, 8th International Workshop on Equation-Based Object-Oriented Modeling Languages and Tools, December 1, Munich, Germany
Available from: 2018-11-04 Created: 2018-11-04 Last updated: 2018-12-03
Sjölund, M. (2015). Tools and Methods for Analysis, Debugging, and Performance Improvement of Equation-Based Models. (Doctoral dissertation). Linköping: Linköping University Electronic Press
Open this publication in new window or tab >>Tools and Methods for Analysis, Debugging, and Performance Improvement of Equation-Based Models
2015 (English)Doctoral thesis, monograph (Other academic)
Abstract [en]

Equation-based object-oriented (EOO) modeling languages such as Modelica provide a convenient, declarative method for describing models of cyber-physical systems. Because of the ease of use of EOO languages, large and complex models can be built with limited effort.

However, current state-of-the-art tools do not provide the user with enough information when errors appear or simulation results are wrong. It is of paramount importance that such tools should give the user enough information to correct errors or understand where the problems that lead to wrong simulation results are located. However, understanding the model translation process of an EOO compiler is a daunting task that not only requires knowledge of the numerical algorithms that the tool executes during simulation, but also the complex symbolic transformations being performed.

As part of this work, methods have been developed and explored where the EOO tool, an enhanced Modelica compiler, records the transformations during the translation process in order to provide better diagnostics, explanations, and analysis. This information is used to generate better error-messages during translation. It is also used to provide better debugging for a simulation that produces unexpected results or where numerical methods fail.

Meeting deadlines is particularly important for real-time applications. It is usually essential to identify possible bottlenecks and either simplify the model or give hints to the compiler that enable it to generate faster code. When profiling and measuring execution times of parts of the model the recorded information can also be used to find out why a particular system model executes slowly.

Combined with debugging information, it is possible to find out why this system of equations is slow to solve, which helps understanding what can be done to simplify the model. A tool with a graphical user interface has been developed to make debugging and performance profiling easier. Both debugging and profiling have been combined into a single view so that performance metrics are mapped to equations, which are mapped to debugging information.

The algorithmic part of Modelica was extended with meta-modeling constructs (MetaModelica) for language modeling. In this context a quite general approach to debugging and compilation from (extended) Modelica to C code was developed. That makes it possible to use the same executable format for simulation executables as for compiler bootstrapping when the compiler written in MetaModelica compiles itself.

Finally, a method and tool prototype suitable for speeding up simulations has been developed. It works by partitioning the model at appropriate places and compiling a simulation executable for a suitable parallel platform.

Place, publisher, year, edition, pages
Linköping: Linköping University Electronic Press, 2015. p. 243
Series
Linköping Studies in Science and Technology. Dissertations, ISSN 0345-7524 ; 1664
Keywords
Simulation, modeling, debugging, profiling, optimization, parallelism, Modelica
National Category
Computer Sciences
Identifiers
urn:nbn:se:liu:diva-116346 (URN)10.3384/diss.diva-116346 (DOI)978-91-7519-071-6 (ISBN)
Public defence
2015-06-01, Visionen, Hus B, Campus Valla, Linköping, 13:15 (English)
Opponent
Supervisors
Funder
VINNOVA, RTSIMVINNOVA, ITEA2/MODPRODVINNOVA, ITEA2/MODRIOSwedish Foundation for Strategic Research , ProViking/HIPOSwedish Foundation for Strategic Research , ProViking/EDOPCUGS (National Graduate School in Computer Science)
Available from: 2015-05-11 Created: 2015-03-26 Last updated: 2018-01-11Bibliographically approved
Sjölund, M., Fritzson, P. & Pop, A. (2014). Bootstrapping a Compiler for an Equation-Based Object-Oriented Language. Modeling, Identification and Control, 35(1), 1-19
Open this publication in new window or tab >>Bootstrapping a Compiler for an Equation-Based Object-Oriented Language
2014 (English)In: Modeling, Identification and Control, ISSN 0332-7353, E-ISSN 1890-1328, Vol. 35, no 1, p. 1-19Article in journal (Refereed) Published
Abstract [en]

What does it mean to bootstrap a compiler, and why do it? This paper reports on the first bootstrapping of a full-scale EOO (Equation-based Object-Oriented) modeling language such as Modelica. Bootstrapping means that the compiler of a language can compile itself. However, the usual application area for the Modelica is modeling and simulation of complex physical systems. Fortunately it turns out that with some minor extensions, the Modelica language is well suited for the modeling of language semantics. We use the name MetaModelica for this slightly extended Modelica. This is a prerequisite for bootstrapping which requires that the language can be used to model and/or implement itself. The OpenModelica Compiler (OMC) has been written in this MetaModelica language. It originally supported only the standard Modelica language but has been gradually extended to also cover the MetaModelica language extensions. After substantial work, OMC is able to quickly compile itself and produces an executable with good performance. The benefits include a more extensible and maintainable compiler by introducing improved language constructs and a more powerful runtime that makes it easy to add functionality such as parser generators, debuggers, and profiling tools. Future work includes extracting and restructuring parts of OMC, making the compiler smaller and more modular and extensible. This will also make it easier to interface with OMC, making it possible to create more powerful and user-friendly OpenModelica-based tools. The compiler and its bootstrapping is a major effort -- it is currently about 330 000 lines of code, and the MetaModelica extensions are used routinely by approximately ten developers on a daily basis. 

Place, publisher, year, edition, pages
Norwegian Society of Automatic Control, 2014
Keywords
compilation, equation-based, object-oriented, meta-programming, modeling
National Category
Computer Sciences
Identifiers
urn:nbn:se:liu:diva-104894 (URN)10.4173/mic.2014.1.1 (DOI)000333248800001 ()
Available from: 2014-03-02 Created: 2014-03-02 Last updated: 2018-01-11Bibliographically approved
Sjölund, M., Casella, F., Dan Iosif Pop, A., Asghar, A., Fritzson, P., Braun, W., . . . Bachmann, B. (2014). Integrated Debugging of Equation-Based Models. In: Hubertus Tummescheit and Karl-Erik Årzén (Ed.), Proceedings of the 10th International Modelica Conference: . Paper presented at Modelica Conference (pp. 195-204). Linköping University Electronic Press
Open this publication in new window or tab >>Integrated Debugging of Equation-Based Models
Show others...
2014 (English)In: Proceedings of the 10th International Modelica Conference / [ed] Hubertus Tummescheit and Karl-Erik Årzén, Linköping University Electronic Press, 2014, p. 195-204Conference paper, Published paper (Refereed)
Abstract [en]

The high abstraction level of equation-based object-oriented languages (EOO) such as Modelica has the drawback that programming and modeling errors are often hard to find. In this paper we present the first integrated debugger for equation-based languages like Modelica; which can combine static and dynamic methods for run-time debugging of equation-based Modelica models during simulations. This builds on and extends previous results from a transformational static equation debugger and a dynamic debugger for the algorithmic subset of Modelica.

Place, publisher, year, edition, pages
Linköping University Electronic Press, 2014
Series
Linköping Electronic Conference Proceedings, ISSN 1650-3686, E-ISSN 1650-3740
National Category
Computer Sciences
Identifiers
urn:nbn:se:liu:diva-117525 (URN)10.3384/ecp14096195 (DOI)978-91-7519-380-9 (ISBN)
Conference
Modelica Conference
Available from: 2015-04-30 Created: 2015-04-30 Last updated: 2018-01-11
Pop, A., Sjölund, M., Asghar, A., Fritzson, P. & Casella, F. (2014). Integrated Debugging of Modelica Models. Modeling, Identification and Control, 35(2), 93-107
Open this publication in new window or tab >>Integrated Debugging of Modelica Models
Show others...
2014 (English)In: Modeling, Identification and Control, ISSN 1890-1328, Vol. 35, no 2, p. 93-107Article in journal (Refereed) Published
Abstract [en]

The high abstraction level of equation-based object-oriented (EOO) languages such as Modelica has the drawback that programming and modeling errors are often hard to find. In this paper we present integrated static and dynamic debugging methods for Modelica models and a debugger prototype that addresses several of those problems. The goal is an integrated debugging framework that combines classical debugging techniques with special techniques for equation-based languages partly based on graph visualization and interaction. To our knowledge, this is the first Modelica debugger that supports both equation-based transformational and algorithmic code debugging in an integrated fashion.

Place, publisher, year, edition, pages
Norwegian Society of Automatic Control, 2014
Keywords
Modelica, Debugging, Modeling and Simulation, Transformations, Equations
National Category
Electrical Engineering, Electronic Engineering, Information Engineering
Identifiers
urn:nbn:se:liu:diva-109729 (URN)10.4173/mic.2014.2.3 (DOI)000344366300003 ()
Available from: 2014-08-27 Created: 2014-08-27 Last updated: 2017-12-13Bibliographically approved
Sjölund, M., Gebremedhin, M. & Fritzson, P. (2013). Parallelizing Equation-Based Models for Simulation on Multi-Core Platforms by Utilizing Model Structure. In: : . Paper presented at 17th International Workshop on Compilers for Parallel Computing (CPC 2013), Lyon, France, July 3-5, 2013.
Open this publication in new window or tab >>Parallelizing Equation-Based Models for Simulation on Multi-Core Platforms by Utilizing Model Structure
2013 (English)Conference paper, Published paper (Refereed)
Abstract [en]

In today’s world of high tech manufacturing and computer-aided design simulations of models is at the heart of the whole manufacturing process. Trying to represent and study the variables of real world models using simulation computer programs can turn out to be a very expensive and time consuming task. On the other hand advancements in modern multi-core CPUs promise remarkable computational power. Modern modeling environments provide different optimization and parallelization options to take advantage of the available computational power. Some of these parallelization approaches are based on automatically extracting parallelism with the help of the model compiler or translator. Another approach is to provide the model programmers with the necessary language constructs to express any potential parallelism in their models.

In this paper we present an automatic parallelization approach for Modelica models using Transmission Line Modeling (TLM). TLM is suitable for parallel simulations because larger models can be partitioned into smaller independent sub-models. TLM introduces parallelism into the system by decoupling subsystems using delays greater than the step size of the numerical solver. A prototype has been implemented in the OpenModelica Compiler (OMC) framework. Our approach re-uses the dependency analysis from the sequential translation step of OMC. With the help of the dependency analysis information the set of equations for a model is partitioned into a number of sub-systems. The resulting independent sub-systems are scheduled and executed in parallel. The run-time system for OMC has been improved to provide thread safety and handle parallelism while keeping the introduced overhead to minimum for normal sequential operation and maintaining portability.

Keywords
Transmission Line Modeling; Parallel Computing;Simulation; Modelica; Compiler; Multi-Core
National Category
Electrical Engineering, Electronic Engineering, Information Engineering
Identifiers
urn:nbn:se:liu:diva-110322 (URN)
Conference
17th International Workshop on Compilers for Parallel Computing (CPC 2013), Lyon, France, July 3-5, 2013
Available from: 2014-09-08 Created: 2014-09-08 Last updated: 2014-10-14Bibliographically approved
Sjölund, M. (2013). Tools for Understanding, Debugging, and Simulation Performance Improvement of Equation-based Models. (Licentiate dissertation). Linköping: Linköping University Electronic Press
Open this publication in new window or tab >>Tools for Understanding, Debugging, and Simulation Performance Improvement of Equation-based Models
2013 (English)Licentiate thesis, monograph (Other academic)
Abstract [en]

Equation-based object-oriented (EOO) modelling languages provide a convenient, declarative method for describing models of cyber-physical systems.Because of the ease of use of EOO languages, large and complex models can be built with limited effort.However, current state-of-the-art tools do not provide the user with enough information when errors appear or simulation results are wrong.It is paramount that the tools give the user enough information to correct errors or understand where the problems that lead to wrong simulation results are located.However, understanding the model translation process of an EOO compiler is a daunting task that not only requires knowledge of the numerical algorithms that the tool executes during simulation, but also the complex symbolic transformations being performed.

In this work, we develop and explore methods where the EOO tool records the transformations during the translation process in order to provide better diagnostics, explanations, and analysis.This information can be used to generate better error-messages during translation.It can also be used to provide better debugging for a simulation that produces unexpected results or where numerical methods fail.

Meeting deadlines is particularly important for real-time applications.It is usually important to identify possible bottlenecks and either simplify the model or give hints to the compiler that enables it to generate faster code.When profiling and measuring execution times of parts of the model the recorded information can also be used to find out why a particular system is slow.Combined with debugging information, it is possible to find out why this system of equations is slow to solve, which helps understanding what can be done to simplify the model.

Finally, we provide a method and tool prototype suitable for speeding up simulations by compiling a simulation executable for a parallel platform by partitioning the model at appropriate places.

Place, publisher, year, edition, pages
Linköping: Linköping University Electronic Press, 2013. p. 93
Series
Linköping Studies in Science and Technology. Thesis, ISSN 0280-7971 ; 1592
Keywords
Simulation, modelling, debugging, profiling, optimisation, parallelism, Modelica
National Category
Computer Sciences
Identifiers
urn:nbn:se:liu:diva-90096 (URN)LIU-TEK-LIC-2013:26 (Local ID)978-91-7519-624-4 (ISBN)LIU-TEK-LIC-2013:26 (Archive number)LIU-TEK-LIC-2013:26 (OAI)
Presentation
2013-05-27, Alan Turing, Hus E, Campus Valla, Linköping University, Linköping, 13:15 (English)
Opponent
Supervisors
Available from: 2013-04-19 Created: 2013-03-19 Last updated: 2018-01-11Bibliographically approved
Asghar, A., Pop, A., Sjölund, M. & Fritzson, P. (2012). Efficient Debugging of Large Algorithmic Modelica Applications. In: : . Paper presented at 7th Vienna International Conference on Mathematical Modelling (MATHMOD 2012), Vienna, Austria, February 15-17, 2012.
Open this publication in new window or tab >>Efficient Debugging of Large Algorithmic Modelica Applications
2012 (English)Conference paper, Published paper (Refereed)
Abstract [en]

Modelica models often contain functions with algorithmic code. The fraction of algorithmiccode is increasing in Modelica models since Modelica, in addition to equation-based modeling, is also used for embedded system control code and symbolic model transformations in compilers using the MetaModelica language extension. For these reasons, debugging of algorithmic Modelica code is becoming increasingly relevant.

Our earlier work in debuggers for the algorithmic subset of Modelica used trace-based techniques. These have the advantages of being very portable, but turned out to have too much overhead for very large applications.

The new debugger is the first Modelica debugger that can operate without trace information. Instead it communicates with a low-level C-language symbolic debugger, the Gnu debugger GDB, to directly extract information from a running executable, set and remove breakpoints, etc. This is made possible by the new bootstrapped OpenModelica compiler which keeps track of a detailed mapping from the high level Modelica code down to the generated C code compiled to machine code.

The debugger is operational, supports browsing of both standard Modelica data structures and tree/list data structures, and operates efficiently on large applications such as the OpenModelica compiler with more than 100 000 lines of code.

Keywords
Modelica, Run-time Debugging, Modeling and Simulation, Algorithmic code, Eclipse
National Category
Electrical Engineering, Electronic Engineering, Information Engineering
Identifiers
urn:nbn:se:liu:diva-110304 (URN)
Conference
7th Vienna International Conference on Mathematical Modelling (MATHMOD 2012), Vienna, Austria, February 15-17, 2012
Available from: 2014-09-05 Created: 2014-09-05 Last updated: 2014-10-14Bibliographically approved
Organisations

Search in DiVA

Show all publications