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