You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a system has only parameters and no equations, we now properly
estimate the size of the HashSet used for creating the ModelInfo
structure as variables+parameters. This avoids using linear search
due to the HashSet having size 1. This fixes ticket:4590.
Belonging to [master]:
- OpenModelica/OMCompiler#1961
if debug then execStat("createVars: evaluateStartValues"); end if;
7428
7448
end if;
7429
7449
7430
7450
// ### simulation ###
7431
7451
// Extract from variable list
7432
7452
simVars := List.fold1(list(BackendVariable.daeVars(syst) for syst in systs1), BackendVariable.traverseBackendDAEVars, function extractVarsFromList(aliasVars=aliasVars1, vars=globalKnownVars1, hs=hs), simVars);
7453
+
if debug then execStat("createVars: variable list"); end if;
7433
7454
7434
7455
// Extract from known variable list
7435
7456
simVars := BackendVariable.traverseBackendDAEVars(globalKnownVars1, function extractVarsFromList(aliasVars=aliasVars1, vars=globalKnownVars1, hs=hs), simVars);
7457
+
if debug then execStat("createVars: known variable list"); end if;
7436
7458
7437
7459
// Extract from localKnownVars variable list
7438
7460
simVars := BackendVariable.traverseBackendDAEVars(localKnownVars1, function extractVarsFromList(aliasVars=aliasVars1, vars=globalKnownVars1, hs=hs), simVars);
7461
+
if debug then execStat("createVars: local known variables list"); end if;
7439
7462
7440
7463
// Extract from removed variable list
7441
7464
simVars := BackendVariable.traverseBackendDAEVars(aliasVars1, function extractVarsFromList(aliasVars=aliasVars1, vars=globalKnownVars1, hs=hs), simVars);
7465
+
if debug then execStat("createVars: removed variables list"); end if;
7442
7466
7443
7467
// Extract from external object list
7444
7468
simVars := BackendVariable.traverseBackendDAEVars(extvars1, function extractVarsFromList(aliasVars=aliasVars1, vars=globalKnownVars1, hs=hs), simVars);
7469
+
if debug then execStat("createVars: external object list"); end if;
7445
7470
7446
7471
7447
7472
// ### initialization ###
7448
7473
// Extract from variable list
7449
7474
simVars := List.fold1(list(BackendVariable.daeVars(syst) for syst in systs2), BackendVariable.traverseBackendDAEVars, function extractVarsFromList(aliasVars=aliasVars2, vars=globalKnownVars2, hs=hs), simVars);
7475
+
if debug then execStat("createVars: variable list (init)"); end if;
7450
7476
7451
7477
// Extract from known variable list
7452
7478
simVars := BackendVariable.traverseBackendDAEVars(globalKnownVars2, function extractVarsFromList(aliasVars=aliasVars2, vars=globalKnownVars2, hs=hs), simVars);
7479
+
if debug then execStat("createVars: known variable list (init)"); end if;
7453
7480
7454
7481
// Extract from localKnownVars variable list
7455
7482
simVars := BackendVariable.traverseBackendDAEVars(localKnownVars2, function extractVarsFromList(aliasVars=aliasVars2, vars=globalKnownVars2, hs=hs), simVars);
7483
+
if debug then execStat("createVars: local known variables list (init)"); end if;
7456
7484
7457
7485
// Extract from removed variable list
7458
7486
simVars := BackendVariable.traverseBackendDAEVars(aliasVars2, function extractVarsFromList(aliasVars=aliasVars2, vars=globalKnownVars2, hs=hs), simVars);
7487
+
if debug then execStat("createVars: removed variables list (init)"); end if;
7459
7488
7460
7489
// Extract from external object list
7461
7490
simVars := BackendVariable.traverseBackendDAEVars(extvars2, function extractVarsFromList(aliasVars=aliasVars2, vars=globalKnownVars2, hs=hs), simVars);
7462
-
7491
+
if debug then execStat("createVars: external object list (init)"); end if;
7463
7492
7464
7493
addTempVars(simVars, tempvars);
7494
+
if debug then execStat("createVars: addTempVars"); end if;
7465
7495
//BaseHashSet.printHashSet(hs);
7466
7496
7467
7497
// sort variables on index
7468
7498
sortSimvars(simVars);
7499
+
if debug then execStat("createVars: sortSimVars"); end if;
7469
7500
7470
7501
if stringEqual(Config.simCodeTarget(), "Cpp") then
7471
7502
extendIncompleteArray(simVars);
7503
+
if debug then execStat("createVars: Cpp, extendIncompleteArray"); end if;
7472
7504
end if;
7473
7505
7474
7506
// Index of algebraic and parameters need to fix due to separation of integer variables
7475
7507
fixIndex(simVars);
7476
7508
setVariableIndex(simVars);
7509
+
if debug then execStat("createVars: fix and set index"); end if;
if if ComponentReference.isPreCref(var.varName) or ComponentReference.isStartCref(var.varName) then false else not BaseHashSet.has(var.varName, arrayGet(hs,1)) then
7549
+
if if ComponentReference.isPreCref(var.varName) or ComponentReference.isStartCref(var.varName) then false else not BaseHashSet.has(var.varName, Mutable.access(hs)) then
7517
7550
/* ignore variable, since they are treated by kind in the codegen */
7518
7551
if not BackendVariable.isAlgebraicOldState(var) then
0 commit comments