Opened 12 years ago

Last modified 7 years ago

#1899 new discussion

Discusssion on how to make the generated code smaller

Reported by: Adrian Pop Owned by: somebody
Priority: high Milestone: Future
Component: Backend Version: trunk
Keywords: Cc: Willi Braun, Jens Frenkel, Lennart Ochel, Martin Sjölund, Per Östlund

Description

This ticket sets up a discussion on how we can make the
generated code smaller so that compilation times go down.

As pointed out by VTT:
http://www.simantics.org/~luukkainen/OM_PerformanceReport.pdf
the C files for the simulation are quite large
and that requires quite some time to compile.

For example
FreeBody18.mos
generates ~10MB of C code.
and 15MB of .xml file.

One way to fix this we should move *ALL* the static data
in the Model_init.xml file to make the C file smaller.
But this might not be enough as we already moved quite
some data to the .xml file.

Could we get rid of the defines completely?
Any other ideas? Feel free to comment here.

Change History (12)

comment:1 by Martin Sjölund, 12 years ago

How old omc version did they use? The C-code is very small and compiles fast even on my laptop...

$ time gcc-4.4   -falign-functions -march=native -mfpmath=sse -fPIC   -I"/home/marsj/dev/trunk/build/include/omc" -I.    -c -o FreeBody18.o FreeBody18.c
real	0m7.767s

Why you would consider getting rid of the #define I have no clue... That's the fastest part of compilation:

$ time cpp-4.4  -I"/home/marsj/dev/trunk/build/include/omc" -I. FreeBody18.c > /dev/null
real	0m0.252s

It only seems to run slowly on the default linux packages because then gcc 4.6 or 4.7 is used (it uses the default gcc on the system).

comment:2 by Jens Frenkel, 12 years ago

  • compile by default with -O0, this is fast and in more than 90% the executable is called only once. If users wand faster simulation, they have to spend more time on compilation for gcc with -O3 (switch Optimisation via flag)

comment:3 by Martin Sjölund, 12 years ago

We already do compile -O0 by default (this is gcc default unless a -O command is given)

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

Milestone: 1.9.01.9.1

Postponed until 1.9.1

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

Milestone: 1.9.11.9.2

This ticket was not closed for 1.9.1, which has now been released. It was batch modified for milestone 1.9.2 (but maybe an empty milestone was more appropriate; feel free to change it).

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

Milestone: 1.9.21.9.3

Milestone changed to 1.9.3 since 1.9.2 was released.

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

Milestone: 1.9.31.9.4

Moved to new milestone 1.9.4

comment:8 by Martin Sjölund, 9 years ago

Milestone: 1.9.41.9.5

Milestone pushed to 1.9.5

comment:9 by Martin Sjölund, 9 years ago

Milestone: 1.9.51.10.0

Milestone renamed

comment:10 by Martin Sjölund, 8 years ago

Milestone: 1.10.01.11.0

Ticket retargeted after milestone closed

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

Milestone: 1.11.01.12.0

Milestone moved to 1.12.0 due to 1.11.0 already being released.

comment:12 by Francesco Casella, 7 years ago

Milestone: 1.12.0Future

The milestone of this ticket has been reassigned to "Future".

If you think the issue is still valid and relevant for you, please select milestone 1.13.0 for back-end, code generation and run-time issues, or 2.0.0 for front-end issues.

If you are aware that the problem is no longer present, please select the milestone corresponding to the version of OMC you used to check that, and set the status to "worksforme".

In both cases, a short informative comment would be welcome.

Note: See TracTickets for help on using tickets.