Opened 8 years ago

Closed 6 years ago

#3625 closed task (fixed)

Extremly long compilation time

Reported by: Christian Kral <dr.christian.kral@…> Owned by: adrpo
Priority: high Milestone: 1.13.0
Component: Frontend Version:
Keywords: Cc: adrpo, perost

Description

When I use a Modelica library that reads input parameters from an external data file and writes other data to an external data file, sometimes unusual long compilation times occur. The external data a read by means of a C function. Data writing is with Modelica.Utilities.

Please compare the compilation times by the attached two examples (load KeyWordIO first)

  • TestKeyWordIO.RLOn (approx. 1 second)
  • TestKeyWordIO.RLOn_io (approx. 20 seconds)

Note that the model complexity of both models is equal; the only difference are the reading and writing of data files in the second example.

In other examples the compilation time goes up to several minutes !

Attachments (4)

KeyWordIO.mo (15.7 KB) - added by Christian Kral <dr.christian.kral@…> 8 years ago.
Handling input and output of data files
TestKeyWordIO.mo (4.2 KB) - added by Christian Kral <dr.christian.kral@…> 8 years ago.
Test examples to be compared
input.dat (21 bytes) - added by Christian Kral <dr.christian.kral@…> 8 years ago.
Input data file
script.mos (252 bytes) - added by adeas31 8 years ago.

Download all attachments as: .zip

Change History (15)

Changed 8 years ago by Christian Kral <dr.christian.kral@…>

Handling input and output of data files

Changed 8 years ago by Christian Kral <dr.christian.kral@…>

Test examples to be compared

Changed 8 years ago by Christian Kral <dr.christian.kral@…>

Input data file

comment:1 Changed 8 years ago by dersh

I tried to run your code, on a few different versions of OM. On two different versions on Linux VM, RLOn_io fails to compile with undeclared identifiers as errors. While, on a Mac with a few day old dev version of OM, it actually crashes OM when I try to run it.
Neither really explains your problem, but something is definitely odd about what is going on.

comment:2 Changed 8 years ago by adeas31

  • Cc adrpo added

comment:3 Changed 8 years ago by dersh

I just upgraded to a newer version of OM using the nightly Linux VM, and now it does run, and does show the much longer compilation. It looks like there was a change that the undeclared identifiers is now a warning, so it works.
On the other hand, what is probably an unrelated problem, is that when I try to run this on a Mac OMEdit, it just crashes and offers to send the developers an email. Just instantiating RLOn_io crashes OMEdit, while RLOn, works fine.
If this does seem to be completely unrelated, I can create a new ticket.

comment:4 Changed 8 years ago by dersh

I did create a new ticket for this:
https://trac.openmodelica.org/OpenModelica/ticket/3627 Although, I do wonder if it could be a memory issue, in which it is attempting to grab a lot of memory...enough to slow down compilation on Linux, and crash OMEdit on a Mac? Just a thought.

comment:5 Changed 8 years ago by Christian Kral <dr.christian.kral@…>

Actually, it also happened under Linux, that sometimes the process crashed without finishing compilation. Then, later, it compiled without crashing, even though I did not change the code. So the crash seems not to be a Mac specific thing.

comment:6 Changed 8 years ago by adeas31

  • Cc perost added
  • Component changed from OMEdit to Frontend
  • Owner changed from adeas31 to adrpo
  • Status changed from new to assigned

The issue is not related to OMEdit.

Changed 8 years ago by adeas31

comment:7 Changed 6 years ago by sjoelund.se

Both of the examples run in 0.4s for me under Linux. I will add KeyWordIO to the nightly testing so we can see what the performance difference is between different OMC versions.

comment:8 Changed 6 years ago by dr.christian.kral@…

I also tested the two examples again under Linux. The compile time (which was the issue of this ticket) of both the models does not show any significant difference.

Thanks for monitoring KeyWordIO.

comment:9 Changed 6 years ago by sjoelund.se

I tested it again and the performance seems bad only if -d=gen, but this is not the default setting and not recommended to use (are you using it?).

comment:10 Changed 6 years ago by dr.christian.kral@…

I am not using the option -d=gen. I re-checked the two examples again and found they both compile in short time. I assume the issue is solved, as everything works fine now. From my point of view the ticket can be closed.

comment:11 Changed 6 years ago by casella

  • Milestone changed from Future to 1.13.0
  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.