Skip to content

Commit

Permalink
Increase the size of equation alias cache
Browse files Browse the repository at this point in the history
Parameters were not considered in the size, causing severe scalability
issues for models with few equations and many parameters.

Belonging to [master]:
  - OpenModelica/OMCompiler#2365
  • Loading branch information
sjoelund authored and OpenModelica-Hudson committed Apr 16, 2018
1 parent 20e6c2d commit e86a458
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Compiler/SimCode/SimCodeUtil.mo
Expand Up @@ -565,10 +565,10 @@ algorithm

execStat("simCode: some other stuff during SimCode phase");

reasonableSize := Util.nextPrime(10+2*listLength(allEquations));
eqCache := HashTableSimCodeEqCache.emptyHashTableSized(reasonableSize);

if Config.simCodeTarget() <> "Cpp" then
reasonableSize := Util.nextPrime(10+integer(1.4*(BackendDAEUtil.equationArraySizeBDAE(inBackendDAE)+BackendDAEUtil.equationArraySizeBDAE(inInitDAE)+listLength(parameterEquations))));
eqCache := HashTableSimCodeEqCache.emptyHashTableSized(reasonableSize);

// Alias equations to other equations.
// The C++ codegen does things differently and will not handle this
(allEquations, eqCache) := aliasSimEqs(allEquations, eqCache);
Expand Down

0 comments on commit e86a458

Please sign in to comment.