Industry utilises simulation software to reduce costs, during system design (reducing the need for physical prototypes) and also during operation, e.g. for diagnostic purposes. There are various tools on the market, each with their respective language: some are specific to a single domain (e.g., electronics) while others are domain-neutral (physical simulations of different kinds). Among the latter, the most used language is Modelica. The description of a model, often through equations, must be translated into simulation code. The compiler has the task to make the transition from a language to the other possible, and the impact of the time spent and memory necessary makes the simulation (and compilation) of large models unfeasible with the current Modelica tools. This thesis has the purpose of enriching HiPerMod, a framework for benchmarking Modelica compilers, with a test case that needs a solver able to handle differential and algebraic equations, some of which nonlinear. The test cases include hand-written cpp code that can be taken as an ideal model for the performances of existing simulators. This new benchmark has been embedded in the existing project, and the simulation and compilation times of the cpp version have been compared with the performances of the leader-of-the-market open-source Modelica software, OpenModelica. Spacial and temporal complexities have been evaluated, and the compilation time complexity has been discussed as well. It has been shown how the hand-written code, keeping the array structure of the data of the equations and the for loops, allows to reduce the simulation time and the memory size of the executable file. Moreover, we show how OpenModelica's compilation time depends on the number of scalar equations of the model, while keeping the data structures and for loops allows for constant compilation time.

Il mondo dell'industria utilizza i software di simulazione sia durante la progettazione (riducendo il bisogno di prototipi fisici), sia per scopi diagnostici durante il funzionamento. Sono presenti sul mercato tool di vario genere, ognuno con il rispettivo linguaggio: da quelli specifici a un singolo ambito (ad esempio, l'elettronica) a quelli più neutrali (simulazioni fisiche di vario genere). Tra questi ultimi, il linguaggio più utilizzato è Modelica. La descrizione di un modello, spesso attraverso equazioni, deve essere tradotta in codice di simulazione. Il compilatore ha il compito di rendere possibile il passaggio da un linguaggio all'altro, e l'impatto del tempo speso e della memoria necessaria rendono impossibile la simulazione (e compilazione) di grandi modelli scritti in Modelica con gli strumenti attuali. Questa tesi ha come obiettivo arricchire HiPerMod, un framework per il benchmarking dei compilatori del linguaggio Modelica, con un caso di test che richieda un risolutore di sistemi di equazioni differenziali e algebriche anche non lineari. È stato scritto il codice che funge da modello ideale per le prestazioni dei simulatori esistenti, incorporato nel progetto esistente, e confrontato con le prestazioni del software open-source leader del mercato, OpenModelica. Sono valutate le complessità spaziale e temporale, ed è discussa la complessità del tempo di compilazione del codice sorgente. Si mostra come il codice scritto a mano, mantenendo la struttura ad array delle equazioni e i cicli for, permette di ridurre il tempo di esecuzione e la memoria occupata dal file eseguibile. Inoltre, si mostra come il tempo di compilazione di OpenModelica dipende dal numero di equazioni scalari del modello, mentre mantenendo la struttura dei dati e i cicli for questo rimane costante.

A benchmarking framework for performance evaluation of Modelica compilers

Nikolic, Marina
2021/2022

Abstract

Industry utilises simulation software to reduce costs, during system design (reducing the need for physical prototypes) and also during operation, e.g. for diagnostic purposes. There are various tools on the market, each with their respective language: some are specific to a single domain (e.g., electronics) while others are domain-neutral (physical simulations of different kinds). Among the latter, the most used language is Modelica. The description of a model, often through equations, must be translated into simulation code. The compiler has the task to make the transition from a language to the other possible, and the impact of the time spent and memory necessary makes the simulation (and compilation) of large models unfeasible with the current Modelica tools. This thesis has the purpose of enriching HiPerMod, a framework for benchmarking Modelica compilers, with a test case that needs a solver able to handle differential and algebraic equations, some of which nonlinear. The test cases include hand-written cpp code that can be taken as an ideal model for the performances of existing simulators. This new benchmark has been embedded in the existing project, and the simulation and compilation times of the cpp version have been compared with the performances of the leader-of-the-market open-source Modelica software, OpenModelica. Spacial and temporal complexities have been evaluated, and the compilation time complexity has been discussed as well. It has been shown how the hand-written code, keeping the array structure of the data of the equations and the for loops, allows to reduce the simulation time and the memory size of the executable file. Moreover, we show how OpenModelica's compilation time depends on the number of scalar equations of the model, while keeping the data structures and for loops allows for constant compilation time.
CASELLA, FRANCESCO
CATTANEO, DANIELE
CHERUBIN, STEFANO
LEVA, ALBERTO
TERRANEO, FEDERICO
ING - Scuola di Ingegneria Industriale e dell'Informazione
21-dic-2021
2021/2022
Il mondo dell'industria utilizza i software di simulazione sia durante la progettazione (riducendo il bisogno di prototipi fisici), sia per scopi diagnostici durante il funzionamento. Sono presenti sul mercato tool di vario genere, ognuno con il rispettivo linguaggio: da quelli specifici a un singolo ambito (ad esempio, l'elettronica) a quelli più neutrali (simulazioni fisiche di vario genere). Tra questi ultimi, il linguaggio più utilizzato è Modelica. La descrizione di un modello, spesso attraverso equazioni, deve essere tradotta in codice di simulazione. Il compilatore ha il compito di rendere possibile il passaggio da un linguaggio all'altro, e l'impatto del tempo speso e della memoria necessaria rendono impossibile la simulazione (e compilazione) di grandi modelli scritti in Modelica con gli strumenti attuali. Questa tesi ha come obiettivo arricchire HiPerMod, un framework per il benchmarking dei compilatori del linguaggio Modelica, con un caso di test che richieda un risolutore di sistemi di equazioni differenziali e algebriche anche non lineari. È stato scritto il codice che funge da modello ideale per le prestazioni dei simulatori esistenti, incorporato nel progetto esistente, e confrontato con le prestazioni del software open-source leader del mercato, OpenModelica. Sono valutate le complessità spaziale e temporale, ed è discussa la complessità del tempo di compilazione del codice sorgente. Si mostra come il codice scritto a mano, mantenendo la struttura ad array delle equazioni e i cicli for, permette di ridurre il tempo di esecuzione e la memoria occupata dal file eseguibile. Inoltre, si mostra come il tempo di compilazione di OpenModelica dipende dal numero di equazioni scalari del modello, mentre mantenendo la struttura dei dati e i cicli for questo rimane costante.
File allegati
File Dimensione Formato  
Nikolic_thesis.pdf

Open Access dal 25/11/2022

Dimensione 1.1 MB
Formato Adobe PDF
1.1 MB Adobe PDF Visualizza/Apri

I documenti in POLITesi sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/10589/182365