Skip to content

Commit

Permalink
Replace deprecated post-optimization flags
Browse files Browse the repository at this point in the history
  • Loading branch information
lochel committed Dec 14, 2015
1 parent d45a2b2 commit a647eac
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 14 deletions.
14 changes: 13 additions & 1 deletion openmodelica/debugDumps/lateInline.mos
Expand Up @@ -21,7 +21,7 @@ model testOptdaedump
Real y = exp(time^3) + x;
end testOptdaedump;
"); getErrorString();
setCommandLineOptions("+cseCall");
setCommandLineOptions("--postOptModules+=wrapFunctionCalls");
setDebugFlags("optdaedump"); getErrorString();
buildModel(testOptdaedump); getErrorString();

Expand Down Expand Up @@ -301,6 +301,18 @@ buildModel(testOptdaedump); getErrorString();
// ========================================
//
//
// Incidence Matrix (row: equation)
// ========================================
// number of rows: 2
// 1: 2
// 2: 2 1
//
// Transposed Incidence Matrix (row: variable)
// ========================================
// number of rows: 2
// 1: 2
// 2: 2 1
//
// no matching
//
//
Expand Down
2 changes: 1 addition & 1 deletion simulation/libraries/3rdParty/ThermoPower/Bug2537.mos
Expand Up @@ -7,7 +7,7 @@
//

loadFile("Bug2537.mo"); getErrorString();
setCommandLineOptions("+cseCall"); getErrorString();
setCommandLineOptions("--postOptModules+=wrapFunctionCalls"); getErrorString();
simulate(ThermoPower.Examples.CISE.CISESim120501); getErrorString();

// Result:
Expand Down
Expand Up @@ -9,9 +9,8 @@
loadModel(SiemensPower, {"2.1 beta"});getErrorString();

// test jacobians
setCommandLineOptions("+generateSymbolicJacobian");
simulate(SiemensPower.Components.SolidComponents.Tests.wall_test, stopTime=25, method="dassl", simflags="-dasslJacobian=symbolical");
getErrorString();
setCommandLineOptions("--postOptModules+=generateSymbolicJacobian"); getErrorString();
simulate(SiemensPower.Components.SolidComponents.Tests.wall_test, stopTime=25, method="dassl", simflags="-dasslJacobian=symbolical"); getErrorString();

res := OpenModelica.Scripting.compareSimulationResults("SiemensPower.Components.SolidComponents.Tests.wall_test_res.mat",getEnvironmentVar("REFERENCEFILES")+"/SiemensPower/wall_test.mat","SiemensPower.Components.SolidComponents.Tests.wall_test_diff.csv",0.01,0.00001,
{ "heatInput.C1signal.y",
Expand All @@ -38,6 +37,7 @@ res := OpenModelica.Scripting.compareSimulationResults("SiemensPower.Components.
// true
// ""
// true
// ""
// record SimulationResult
// resultFile = "SiemensPower.Components.SolidComponents.Tests.wall_test_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 25.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'SiemensPower.Components.SolidComponents.Tests.wall_test', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = '-dasslJacobian=symbolical'",
Expand Down
2 changes: 1 addition & 1 deletion simulation/modelica/commonSubExp/cse1.mos
Expand Up @@ -28,7 +28,7 @@ end Tearing15;

setDebugFlags("dumpCSE"); getErrorString();
setTearingMethod("cellier"); getErrorString();
setCommandLineOptions("+tearingHeuristic=MC1 +cseCall +cseBinary"); getErrorString();
setCommandLineOptions("+tearingHeuristic=MC1 --postOptModules+=wrapFunctionCalls,cseBinary"); getErrorString();
simulate(Tearing15); getErrorString();

// Result:
Expand Down
2 changes: 1 addition & 1 deletion simulation/modelica/commonSubExp/cse2.mos
Expand Up @@ -36,7 +36,7 @@ end Tearing3;

setDebugFlags("dumpCSE"); getErrorString();
setTearingMethod("cellier"); getErrorString();
setCommandLineOptions("+tearingHeuristic=MC1 +cseCall +cseBinary --preOptModules-=comSubExp"); getErrorString();
setCommandLineOptions("+tearingHeuristic=MC1 --postOptModules+=wrapFunctionCalls,cseBinary --preOptModules-=comSubExp"); getErrorString();
simulate(Tearing3); getErrorString();

// Result:
Expand Down
2 changes: 1 addition & 1 deletion simulation/modelica/commonSubExp/cse3.mos
Expand Up @@ -27,7 +27,7 @@ end Tearing15;

setDebugFlags("dumpCSE"); getErrorString();
setTearingMethod("cellier"); getErrorString();
setCommandLineOptions("+tearingHeuristic=MC1 +cseEachCall +cseBinary"); getErrorString();
setCommandLineOptions("+tearingHeuristic=MC1 --postOptModules+=wrapFunctionCalls,cseBinary"); getErrorString();
simulate(Tearing15); getErrorString();

// Result:
Expand Down
2 changes: 1 addition & 1 deletion simulation/modelica/commonSubExp/cseFunctionCall.mos
Expand Up @@ -179,7 +179,7 @@ end CSE;
"); getErrorString();

setDebugFlags("dumpCSE"); getErrorString();
setCommandLineOptions("+cseCall"); getErrorString();
setCommandLineOptions("--postOptModules+=wrapFunctionCalls"); getErrorString();

simulate(CSE.FunctionCallTest1); getErrorString();
simulate(CSE.FunctionCallTest2); getErrorString();
Expand Down
8 changes: 4 additions & 4 deletions simulation/modelica/others/ComplexFun.mos
Expand Up @@ -10,9 +10,9 @@ val(x,{0.0,0.1,0.2,0.7,1.0});
simulate(problem2); getErrorString();

val(y,{0.0,0.1,0.2,0.7,1.0});
val(z,{0.0,0.1,0.2,0.7,1.0});
val(z,{0.0,0.1,0.2,0.7,1.0});

setCommandLineOptions("+cseEachCall"); getErrorString();
setCommandLineOptions("--postOptModules+=wrapFunctionCalls"); getErrorString();
simulate(problem1); getErrorString();

val(x,{0.0,0.1,0.2,0.7,1.0}); getErrorString();
Expand All @@ -22,14 +22,14 @@ simulate(problem2); getErrorString();
val(y,{0.0,0.1,0.2,0.7,1.0});
val(z,{0.0,0.1,0.2,0.7,1.0});

setCommandLineOptions("+d=disableSimplifyComplexFunction +cseEachCall=false"); getErrorString();
setCommandLineOptions("--postOptModules-=wrapFunctionCalls,simplifyComplexFunction --initOptModules-=simplifyComplexFunction"); getErrorString();
simulate(problem1); getErrorString();

val(x,{0.0,0.1,0.2,0.7,1.0});

simulate(problem2); getErrorString() == "";

setCommandLineOptions("+d=disableSimplifyComplexFunction +cseEachCall"); getErrorString();
setCommandLineOptions("--postOptModules+=wrapFunctionCalls"); getErrorString();
simulate(problem1); getErrorString() == "";

simulate(problem2); getErrorString() == "";
Expand Down
2 changes: 1 addition & 1 deletion simulation/modelica/qss/qss_example9.mos
Expand Up @@ -12,7 +12,7 @@ package qssTests
end qssTests;
"); getErrorString();

setCommandLineOptions("+addTimeAsState"); getErrorString();
setCommandLineOptions("--postOptModules+=addTimeAsState"); getErrorString();
simulate(qssTests.example9, method="qss"); getErrorString();
val(x, {0.0, 1.0}); getErrorString();

Expand Down

0 comments on commit a647eac

Please sign in to comment.