﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
6367	Avoid C compilation bottleneck in OMC	Francesco Casella	Martin Sjölund	"Comparing [https://libraries.openmodelica.org/branches/master/ScalableTestSuite/ScalableTestSuite.html ScalableTestSuite] and [https://libraries.openmodelica.org/branches/master/ScalableTestSuite_noopt/ScalableTestSuite_noopt.html ScalableTestSuite_noopt] it seems that the simulation may be 20-30% slower using {{{-O0}}} instead of {{{-Os}}}, but the C compilation time may be 3-4 times faster.

This issue was already discussed in #4033 and #4879. Bottom line: there is no need to completely disable optimization, thus introducing an unnecessary trade-off. What is needed is
- use the {{{OMC_DISABLE_OPT}}} macro to tell the compiler which functions should not be optimized. Basically, the ones involved in initialization (which are only executed a few times) should be marked with this macro
- split the jac.c and nls.c files, so that they can be compiled in parallel

Apparently, some code was added after #4879 was closed without the appropriate {{{OMC_DISABLE_OPT}}} macro that made it slow again.

The examples attached to #6271 and the larger test cases in the ScalableTestSuite can be used as benchmarks.

@sjoelund.se just opened [https://github.com/OpenModelica/OpenModelica/pull/7133 PR 7133] and [https://github.com/OpenModelica/OpenModelica/pull/7134 PR 7134] to improve things.

I expect to see the two above-mentioned test reports to show similar C-code compilation time after the PRs are merged."	defect	assigned	critical	NeedsInput	Code Generation	1.16.0			Karim Adbdelhak Andreas Heuermann Adrian Pop jean-philippe.tavella@… Adeel Asghar
