Opened 6 years ago

Closed 6 years ago

#5030 closed defect (fixed)

Profiling is broken

Reported by: Francesco Casella Owned by: Adeel Asghar
Priority: blocker Milestone: 1.14.0
Component: OMEdit Version:
Keywords: Cc: Adeel Asghar, Willi Braun, Martin Sjölund

Description

As it is apparent from this page the profiler is broken.

You can also run any MSL model (e.g. Modelica.Blocks.Examples.Filter with OMEdit turning on profiling+html profiling; the following output is obtained:

LOG_SUCCESS | info | <p>The simulation finished successfully.</p>
stdout | error | <p>W</p>
stdout | error | <p>arning: empty y range [1e-030:1e-030], adjusti</p>
stdout | error | <p>ng to [9.9e-031:1e-030] <br>

This needs to be fixed before the 1.13.0 release.

stdout | error | <p>W</p>
stdout | error | <p>arning: empty y range [1e-030:1e-030], ad</p>
stdout | error | <p>justing to [9.9e-031:1e-030] <br>

stdout | error | <p>W</p>
stdout | error | <p>arning: empty y range [1e-030:1e-030], adjust</p>
stdout | error | <p>ing to [9.9e-031:1e-030] <br>

stdout | error | <p>W</p>
stdout | error | <p>arning: empty y range [1e-030:1e-</p>
stdout | error | <p>030], adjusting to [9.9e-031</p>
stdout | error | <p>:1e-030] <br>

stdout | error | <p>W</p>
stdout | error | <p>arning: empty y range [1e-030:1e</p>
stdout | error | <p>-030], adjusting to [9.9e-031:</p>
stdout | error | <p>1e-030] <br>

stdout | error | <p>W</p>
stdout | error | <p>arning: empty y range [1e-030:1e-</p>
stdout | error | <p>030], adjusting to [9.9e-031:1e-0</p>
stdout | error | <p>30] <br>

stdout | error | <p>W</p>
stdout | error | <p>arning: empty y range [1e-030:1e-030], a</p>
stdout | error | <p>djusting to [9.9e-031:1e-030] <br>

stdout | error | <p>W</p>
stdout | error | <p>arning: empty y range [1e-030:1e-030], adjusting</p>
stdout | error | <p> to [9.9e-031:1e-030] <br>

stdout | error | <p>W</p>
stdout | error | <p>arning: empty y range [1e-030:1e-03</p>
stdout | error | <p>0], adjusting to [9.9e-031:1e-030</p>
stdout | error | <p>] <br>

stdout | error | <p>W</p>
stdout | error | <p>arning: empty y range [1e-030:1e-030]</p>
stdout | error | <p>, adjusting to [9.9e-031:1e-0</p>
stdout | error | <p>30] <br>

stdout | error | <p>W</p>
stdout | error | <p>arning: empty y range [1e-030:1e-030], adju</p>
stdout | error | <p>sting to [9.9e-031:1e-030] <br>

stdout | error | <p>W</p>
stdout | error | <p>arning: empty y range [1e-030:1e-030], </p>
stdout | error | <p>adjusting to [9.9</p>
stdout | error | <p>e-031:1e-030] <br>

stdout | error | <p>W</p>
stdout | error | <p>arning: empty y range [1e-030:1e-03</p>
stdout | error | <p>0], adjusting to [9.9e-031:1e-030</p>
stdout | error | <p>] <br>

stdout | error | <p>W</p>
stdout | error | <p>arning: empty y range [1e-030:1e-030], </p>
stdout | error | <p>adjusting to [9.9e-031:1e-030]</p>
stdout | error | <p> <br>

stdout | error | <p>W</p>
stdout | error | <p>arning: empty y range [1e-030:1e-030], adjusting to [9.9e-031:1e-030] <br>

stdout | error | <p>W</p>
stdout | error | <p>arning: empty y range [1e-030:1e-030], adjusting to [9.9e-031:1e-030] <br>

stdout | error | <p>W</p>
stdout | error | <p>arning: empty y range [1e-030:1e-030], ad</p>
stdout | error | <p>justing to [9.9e-031:1e-030] <br>

stdout | error | <p>W</p>
stdout | error | <p>arning: empty y range [1e-030:1e-030], adjusting to [9.9e-031:1e</p>
stdout | error | <p>-030] <br>

stdout | error | <p>W</p>
stdout | error | <p>arning: empty y range [1e-030:1e-0</p>
stdout | error | <p>3</p>
stdout | error | <p>0</p>
stdout | error | <p>]</p>
stdout | error | <p>, adjusting to [9.9e-</p>
stdout | error | <p>0</p>
stdout | error | <p>31</p>
stdout | error | <p>:1e-030] <br>

stdout | error | <p>W</p>
stdout | error | <p>arning: empty y range [1e-030:1e-030], adju</p>
stdout | error | <p>sting to [9.9e-031:1e-030] <br>

stdout | error | <p>W</p>
stdout | error | <p>arning: empty y range [1e-030:1e-030], adjusting to [9.9e-0</p>
stdout | error | <p>31:1e-030] <br>

stdout | error | <p>W</p>
stdout | error | <p>arning: empty y range [1e-030:1e-030], adjusting to</p>
stdout | error | <p> [9.9e-031:1e-030] <br>

stdout | error | <p>W</p>
stdout | error | <p>arning: empty y range [1e-030:1e-030], adju</p>
stdout | error | <p>sting to [9.9e-031:1e-030]</p>
stdout | error | <p> <br>

stdout | error | <p>W</p>
stdout | error | <p>arning: empty y range [1e-030:1e-030], </p>
stdout | error | <p>adjusting to [9.9e-031:1e-030]</p>
stdout | error | <p> <br>

stdout | error | <p>W</p>
stdout | error | <p>arning: empty y range [1e-030:1e-030</p>
stdout | error | <p>], adjusting to [9.9e-031:1e-030</p>
stdout | error | <p>] <br>

stdout | error | <p>W</p>
stdout | error | <p>arning: empty y range [1e-030:1e-030], a</p>
stdout | error | <p>djusting to [9.9e-031:1e-030] <br>

stdout | info | <p>Time measurements are stored in C:/Users/casella/AppData/Local/Temp/OpenModelica/OMEdit/Modelica.Blocks.Examples.Filter/Modelica.Blocks.Examples.Filter_prof.html (human-readable) and C:/Users/casella/AppData/Local/Temp/OpenModelica/OMEdit/Modelica.Blocks.Examples.Filter/Modelica.Blocks.Examples.Filter_prof.xml (for XSL transforms or more details)</p>
stdout | error | <p>Process crashed</p>
stdout | error | <p>Process crashed<br>
Simulation process failed. Exited with code -1073740940.</p>

Change History (18)

comment:1 by Francesco Casella, 6 years ago

Owner: changed from Martin Sjölund to Adrian Pop
Status: newassigned

Adrian will look into this

comment:2 by Francesco Casella, 6 years ago

Adrian reports issues with some XML tags. He will check with Martin.

comment:3 by Francesco Casella, 6 years ago

We should also add a test to avoid people breaking this feature with their commits. @adrpo can you please add that?

comment:4 by Francesco Casella, 6 years ago

@adrpo, if you can't make it by Wednesday, we can postpone this fix to 1.13.1 in January, no need to further delay the 1.13.0 release.

comment:5 by Adrian Pop, 6 years ago

The error on the page here: https://openmodelica.org/doc/OpenModelicaUsersGuide/latest/profiler.html
is actually put there manually by @sjoelund a while back (2016!):
https://github.com/OpenModelica/OpenModelica-doc/commit/7af6b5108c8c34830a04caabd54e0eb24e7a1629
So, the profiling actually works fine, at least partially.

Last edited 6 years ago by Adrian Pop (previous) (diff)

comment:6 by Adrian Pop, 6 years ago

Cc: Martin Sjölund added

comment:7 by Adrian Pop, 6 years ago

There are some issues with displaying equations in the html page and also the fact that some models crash at the end of the simulation.

comment:8 by Adrian Pop, 6 years ago

Milestone: 1.13.01.14.0

PR https://github.com/OpenModelica/OMCompiler/pull/2841 fixes equation listing and variable references.

There are more things to fix until we get the profiling to fully work.
As far as I can tell some code generation needs to change so that the profiling is added to all types of equations/systems/functions. Currently all the called functions report no calls in Modelica.Blocks.Examples.Filter.

I'll make this a blocker for 1.14.0, we cannot hold the 1.13.0 anymore.

comment:9 by Francesco Casella, 6 years ago

OK, very good

comment:10 by Francesco Casella, 6 years ago

@adrpo, I followed the instructions to get the profiling info in the OMEdit debugger, but if I run Modelica.Blocks.Examples.Filters I still don't get any profiling information.

I also tried Modelica.Fluid.Examples.HeatExchanger.HeatExchangerSimulation, but I didn't get any profiling info either.

Can you please check what is wrong?

comment:11 by Martin Sjölund, 6 years ago

Do you press the refresh button after the simulation finishes?

comment:12 by Francesco Casella, 6 years ago

Do you mean the "Reload" button on the top left corner of the Transformational Debugger Window? I did press it, but I still see no profiling data.

Besides the .json file, a _prof.intdata and a _prof.realdata files are present in the results directory, with 0.5 and 1 MB of data, respectively. They seem to be binary files, so I cannot inspect them to check what's inside.

comment:13 by Francesco Casella, 6 years ago

Component: Run-timeOMEdit
Owner: changed from Adrian Pop to Adeel Asghar

In fact, I get these error messages in the Simulation Output window:

C
annot open load file 'C:/Users/Francesco' <br>
"C:/Users/Francesco", line 0: util.c: No such file or directory <br>
 <br>

Plot command failed: C:/OpenModelica1.14.0-dev-64bit//lib/omc/libexec/gnuplot/binary/gnuplot.exe C:/Users/Francesco Casella/AppData/Local/Temp/OpenModelica/OMEdit/Modelica.Fluid.Examples.HeatExchanger.HeatExchangerSimulation/Modelica.Fluid.Examples.HeatExchanger.HeatExchangerSimulation_prof.plt<br>

warning: failed to load external entity "Casella/AppData/Local/Temp/OpenModelica/OMEdit/Modelica.Fluid.Examples.HeatExchanger.HeatExchangerSimulation/Modelica.Fluid.Examples.HeatExchanger.HeatExchangerSimulation_prof.html" <br>
cannot parse Casella/AppData/Local/Temp/OpenModelica/OMEdit/Modelica.Fluid.Examples.HeatExchanger.HeatExchangerSimulation/Modelica.Fluid.Examples.HeatExchanger.HeatExchangerSimulation_prof.html <br>

Process crashed
Process crashed<br>
Simulation process failed. Exited with code -1073740940.

and no .html file is found in the simulation output directory. Probably something goes wrong during the simulation post-processing phase.

On the other hand, if I run this mos script from the command line:

loadModel(Modelica);getErrorString();
setCommandLineOptions("--profiling=blocks+html");getErrorString();
simulate(Modelica.Fluid.Examples.HeatExchanger.HeatExchangerSimulation);getErrorString();

I get the html file with all information.

So, I guess this is an OMEdit issue, @adeas31, could you please give a look?

comment:14 by Francesco Casella, 6 years ago

I also opened PR#108 to update the online manual of the profiler, @adeas31, can you please check and merge into master?

comment:15 by Adeel Asghar, 6 years ago

Should work fine with ee7aaab/OMCompiler.

comment:16 by Francesco Casella, 6 years ago

OK, I'll check tomorrow with the new nightly build.

comment:17 by Francesco Casella, 6 years ago

Works like a charm. Thanks @adeas31!

comment:18 by Francesco Casella, 6 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.