Opened 14 years ago

Closed 12 years ago

#1456 closed defect (fixed)

compiling bigger models

Reported by: Willi Braun Owned by: Willi Braun
Priority: high Milestone:
Component: Backend Version: trunk
Keywords: Cc: Willi Braun

Description

For example a model from Siemens: 
{{{$wc -l *.cpp
640284 SiemensPower_Components_Pipes_Tests_tube_ownMedia_testSimpleSlow_OMC.conv.cpp
320142 SiemensPower_Components_Pipes_Tests_tube_ownMedia_testSimpleSlow_OMC.cpp
278 SiemensPower_Components_Pipes_Tests_tube_ownMedia_testSimpleSlow_OMC_functions.cpp
$ls -al
-rw-r--r-- 1 wbraun wbraun 81310251 2011-03-19 15:28 SiemensPower_Components_Pipes_Tests_tube_ownMedia_testSimpleSlow_OMC.conv.cpp
-rw-r--r-- 1 wbraun wbraun 53248860 2011-03-19 15:28 SiemensPower_Components_Pipes_Tests_tube_ownMedia_testSimpleSlow_OMC.cpp
-rw-r--r-- 1 wbraun wbraun 30 2011-03-19 15:28 SiemensPower_Components_Pipes_Tests_tube_ownMedia_testSimpleSlow_OMC.libs
-rw-r--r-- 1 wbraun wbraun 1095 2011-03-19 15:58 SiemensPower_Components_Pipes_Tests_tube_ownMedia_testSimpleSlow_OMC.log
-rw-r--r-- 1 wbraun wbraun 1718 2011-03-19 15:28 SiemensPower_Components_Pipes_Tests_tube_ownMedia_testSimpleSlow_OMC.makefile
}}}

We need only around 8 min to produce the code, but the gcc compiler fails after 40 minutes:

{{{Simulation failed for model: SiemensPower_Components_Pipes_Tests_tube_ownMedia_testSimpleSlow_OMC
Error: Error building simulator. Buildlog: perl /home/wbraun/workspace/OM/OMtrunk/buildshare/omc/scripts/convert_lines.pl SiemensPower_Components_Pipes_Tests_tube_ownMedia_testSimpleSlow_OMC.cpp SiemensPower_Components_Pipes_Tests_tube_ownMedia_testSimpleSlow_OMC.conv.cpp.tmp
g++ -I. -o SiemensPower_Components_Pipes_Tests_tube_ownMedia_testSimpleSlow_OMC SiemensPower_Components_Pipes_Tests_tube_ownMedia_testSimpleSlow_OMC.conv.cpp SiemensPower_Components_Pipes_Tests_tube_ownMedia_testSimpleSlow_OMC_functions.cpp -L\"../Modelica\" -lTTSEf2c -lTTSEGCC -lgfortran -lsim -linteractive -I\"/home/wbraun/workspace/OM/OMtrunk/build
include/omc\" -O3 -falign-functions -march=native -mfpmath=sse -lsendData -lQtNetwork -lQtCore -lQtGui -lrt -lpthread -L\"/home/wbraun/workspace/OM/OMtrunk/buildlib/omc\" -lc_runtime -lf2c SiemensPower_Components_Pipes_Tests_tube_ownMedia_testSimpleSlow_OMC_records.c
g++: Internal error: Killed (program cc1plus)
Please submit a full bug report.}}}

Change History (9)

comment:1 by Adrian Pop, 14 years ago

Simulation code is compiled with -O3, maybe we should do them -O0 to shorten the time.

comment:2 by Adrian Pop, 14 years ago

Maybe we should also find a way to split files into several compilation units if they are
bigger than 10MB and compile each of them separately.

comment:3 by Adrian Pop, 14 years ago

Willi, how many MB do the generated cpp files have?

comment:4 by Adrian Pop, 14 years ago

Another idea would be to:

  1. run perl only on a flag (as the processed files with line info are bigger)
  2. remove the line information from the .cpp file to make them smaller

comment:5 by Martin Sjölund, 14 years ago

GCC doesn't have problems with big compilation units; it has problems with big functions.
I suppose functionODE is huge and causes issues.

Anyway, if a file takes too long to compile, we support MODELICAUSERCFLAGS so the users themselves can choose to compile with faster settings (setCompilerFlags might also work, but I'm not certain).

comment:6 by Willi Braun, 14 years ago

Ok, the problem is probably that my functionJacA is too big, it has around ~200000 rows and actually the model is not that big, it has only 57 states and 430 ODE equations, this results ~24000 Jacobian Variables. I have to separate the calculation for each row in a own function and all this stuff in a separated file. Then it should work better.

comment:7 by Martin Sjölund, 14 years ago

simulate(M,cflags="-O0") also works now :)

comment:8 by Willi Braun, 12 years ago

Cc: wbraun, wbraun → wbraun
Component: Backend

comment:9 by Willi Braun, 12 years ago

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