Opened 14 years ago
Closed 12 years ago
#1456 closed defect (fixed)
compiling bigger models
Reported by: | wbraun | Owned by: | wbraun |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | Backend | Version: | trunk |
Keywords: | Cc: | wbraun |
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/buildinclude/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 Changed 14 years ago by adrpo
comment:2 Changed 14 years ago by adrpo
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 Changed 14 years ago by adrpo
Willi, how many MB do the generated cpp files have?
comment:4 Changed 14 years ago by adrpo
Another idea would be to:
- run perl only on a flag (as the processed files with line info are bigger)
- remove the line information from the .cpp file to make them smaller
comment:5 Changed 14 years ago by sjoelund.se
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 Changed 14 years ago by wbraun
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 Changed 13 years ago by sjoelund.se
simulate(M,cflags="-O0") also works now :)
comment:8 Changed 12 years ago by wbraun
- Cc changed from wbraun, wbraun to wbraun
- Component set to Backend
comment:9 Changed 12 years ago by wbraun
- Resolution set to fixed
- Status changed from new to closed
Simulation code is compiled with -O3, maybe we should do them -O0 to shorten the time.