Hi Julien,

Yes, you would need to go into the C-code. Not the generated code, but the simulation runtime. If you want to compare euler and dassl solvers you'd need to write the code twice since the event handling systems and initialization is done differently for both.

The high-precision timer functions are different on windows and unix, which adds another level of pain to implementing this in OpenModelica. It should probably be done in the future though.

--
Martin Sjölund

On 2010-08-19 09:15, Bonifay, Julien (E F ES EN 1 2) wrote:
Hi Martin,

We would like to compare the performances of OMC and Dymola. We will thus try to use 
outputFormat="bin" as you suggested.

Our main interest is the simulation time after initialisation.

You wrote that we can add some timing functions to the C runtime. It's on my 
side not entirely clear. I guess we will need for that to add some functions in 
the OMC C-Code?

We would like just to know the total CPU time for one simulation run (and after 
initialisation). Is there any simple way to have this total time (without going 
into the OMC C-Code)?


Thank you,

Best Regards

Julien



-----Ursprüngliche Nachricht-----
Von: [email protected] 
[mailto:[email protected]] Im Auftrag von Martin Sjölund
Gesendet: Mittwoch, 18. August 2010 16:40
An: [email protected]
Betreff: Re: Performance Measurement in OpenModelica

Hi Kilian,

Assuming that you want CPU time including initialization and setup, it
is available in OpenModelica since we generate executables.

The following will give CPU and system time (after you have generated
the executable, e.g. by running simulate(MyModel). There is probably a
Windows equivalent as well.

system("/usr/bin/time MyModel>  log");
readFile("log");

If you want time after initialization, you need to add some timing
functions to the C runtime.

I do not recommend using timing(simulate(MyModel)) in OMShell as that
returns the time it takes to flatten, build, compile and simulate a model.


If you want to simulate without file I/O, you can change the output
format of the simulation (simulate(..., outputFormat="empty")

outputFormat="plt" is the default, and the only one that works with
plot() or val()

outputFormat="csv" reduces memory consumption by a lot (plt needs to
store the whole simulation results in memory before output; csv outputs
after each time step)

outputFormat="bin" reduces memory and CPU consumption by a lot, but
almost impossible to read the data back (the names or number of
variables is not stored!). It's experimental and basically there to
compare speed to Dymola since they use a binary format (double to String
conversion takes up a lot of the OpenModelica simulation)

outputFormat="empty" runs the simulation, but discards all results.
Useful if controlling an environment through external functions/etc is
what you want, and not simulation results.

I believe it's part of the 1.5.0 executable, but lacks documentation
since it doesn't work with the plot() commands anyway.

--
Martin Sjölund

On 2010-08-18 15:04, Link, Kilian (E F ES EN 1 2) wrote:
Hej,

we try to compare the performance of different Modelica environments recently. 
In Dymola the CPU time is accessible. Is something similar available in 
OpenModelica?

So far the OMC performance with the latest binary for windows of the chosen 
test case seems to be very poor. Is there a chance to get some hints without 
profiling of the C-Code?

Best Regards,
Kilian


Reply via email to