Skip to content

Commit

Permalink
Add flags to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaeuber authored and OpenModelica-Hudson committed Oct 11, 2017
1 parent 5411248 commit 8e44932
Show file tree
Hide file tree
Showing 13 changed files with 86 additions and 28 deletions.
Expand Up @@ -7,7 +7,7 @@
//

runScript("../common/ModelTestingDefaults.mos"); getErrorString();
setCommandLineOptions({"+d=backenddaeinfo,stateselection"}); getErrorString();
setCommandLineOptions("-d=backenddaeinfo,stateselection --maxSizeLinearTearing=4000"); getErrorString();

modelTestingType := OpenModelicaModelTesting.Kind.VerifiedSimulation;
modelName := $TypeName(Modelica.Mechanics.MultiBody.Examples.Loops.EngineV6);
Expand All @@ -25,7 +25,7 @@ runScript(modelTesting);getErrorString();
// "true
// "
// ""
// {true}
// true
// ""
// OpenModelicaModelTesting.Kind.VerifiedSimulation
// Modelica.Mechanics.MultiBody.Examples.Loops.EngineV6
Expand Down
Expand Up @@ -7,7 +7,7 @@
//

runScript("../common/ModelTestingDefaults.mos"); getErrorString();
setCommandLineOptions({"+d=backenddaeinfo,stateselection"}); getErrorString();
setCommandLineOptions("-d=backenddaeinfo,stateselection --maxSizeLinearTearing=4000"); getErrorString();

modelTestingType := OpenModelicaModelTesting.Kind.VerifiedSimulation;
modelName := $TypeName(Modelica.Mechanics.MultiBody.Examples.Loops.EngineV6_analytic);
Expand All @@ -25,7 +25,7 @@ runScript(modelTesting);getErrorString();
// "true
// "
// ""
// {true}
// true
// ""
// OpenModelicaModelTesting.Kind.VerifiedSimulation
// Modelica.Mechanics.MultiBody.Examples.Loops.EngineV6_analytic
Expand Down
3 changes: 3 additions & 0 deletions simulation/modelica/arrays/NPendulum.mos
Expand Up @@ -6,6 +6,7 @@
//setCommandLineOptions("+preOptModules=simplifyIfEquations,removeEqualFunctionCalls,partitionIndependentBlocks,expandDerOperator,findStateOrder,replaceEdgeChange,inlineArrayEqn,removeSimpleEquations,resolveLoops,evalFunc");
loadModel(Modelica,{"3.2.1"}); getErrorString();
loadFile("NPendulum.mo"); getErrorString();
setCommandLineOptions("--maxSizeLineartearing=4000"); getErrorString();
simulate(NPendulum, stopTime=1, numberOfIntervals=500); getErrorString();
res := OpenModelica.Scripting.compareSimulationResults("NPendulum_res.mat",
"ReferenceFiles/NPendulum_10.mat",
Expand All @@ -17,6 +18,8 @@ res := OpenModelica.Scripting.compareSimulationResults("NPendulum_res.mat",
// ""
// true
// ""
// true
// ""
// record SimulationResult
// resultFile = "NPendulum_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'NPendulum', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
Expand Down
4 changes: 2 additions & 2 deletions simulation/modelica/linear_system/EngineV6_partlintorn.mos
Expand Up @@ -4,7 +4,7 @@
//

loadModel(Modelica,{"3.2.1"});
setCommandLineOptions("+partlintorn=2"); getErrorString();
setCommandLineOptions("--partlintorn=2 --maxSizeLineartearing=4000"); getErrorString();
simulate(Modelica.Mechanics.MultiBody.Examples.Loops.EngineV6); getErrorString();

res := OpenModelica.Scripting.compareSimulationResults("Modelica.Mechanics.MultiBody.Examples.Loops.EngineV6_res.mat",
Expand All @@ -21,7 +21,7 @@ res := OpenModelica.Scripting.compareSimulationResults("Modelica.Mechanics.Multi
// ""
// record SimulationResult
// resultFile = "Modelica.Mechanics.MultiBody.Examples.Loops.EngineV6_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 1.01, numberOfIntervals = 500, tolerance = 1e-006, method = 'dassl', fileNamePrefix = 'Modelica.Mechanics.MultiBody.Examples.Loops.EngineV6', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// simulationOptions = "startTime = 0.0, stopTime = 1.01, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'Modelica.Mechanics.MultiBody.Examples.Loops.EngineV6', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// messages = "stdout | info | The initialization finished successfully without homotopy method.
// stdout | info | The simulation finished successfully.
// "
Expand Down
24 changes: 17 additions & 7 deletions simulation/modelica/linear_system/NPendulum.mos
Expand Up @@ -6,6 +6,7 @@
loadFile("NPendulum.mo");
getErrorString();

setCommandLineOptions("--maxSizeLinearTearing=4000"); getErrorString();
buildModel(NPendulum.pendulum); getErrorString();
system("./NPendulum.pendulum -ls totalpivot");
res := OpenModelica.Scripting.compareSimulationResults("NPendulum.pendulum_res.mat",
Expand Down Expand Up @@ -40,22 +41,21 @@ res := OpenModelica.Scripting.compareSimulationResults("NPendulum.pendulum_res.m
{"phi[10]"});


setCommandLineOptions("--maxSizeLinearTearing=0");
getErrorString();
setCommandLineOptions("--maxSizeLinearTearing=0"); getErrorString();
buildModel(NPendulum.pendulum); getErrorString();

system("./NPendulum.pendulum -ls totalpivot");
system("./NPendulum.pendulum -ls totalpivot -lssMinSize=4001");
res := OpenModelica.Scripting.compareSimulationResults("NPendulum.pendulum_res.mat",
getEnvironmentVar("REFERENCEFILES")+"/linear_system/NPendulum_10.mat",
"NPendulum_diff.csv",0.01,0.01,
{"phi[10]"});

system("./NPendulum.pendulum -ls lapack");
system("./NPendulum.pendulum -ls lapack -lssMinSize=4001");
res := OpenModelica.Scripting.compareSimulationResults("NPendulum.pendulum_res.mat",
getEnvironmentVar("REFERENCEFILES")+"/linear_system/NPendulum_10.mat",
"NPendulum_diff.csv",0.01,0.01,
{"phi[10]"});
system("./NPendulum.pendulum -ls umfpack");
system("./NPendulum.pendulum -ls umfpack -lssMinSize=4001");
res := OpenModelica.Scripting.compareSimulationResults("NPendulum.pendulum_res.mat",
getEnvironmentVar("REFERENCEFILES")+"/linear_system/NPendulum_10.mat",
"NPendulum_diff.csv",0.01,0.01,
Expand All @@ -70,7 +70,7 @@ res := OpenModelica.Scripting.compareSimulationResults("NPendulum.pendulum_res.m
{"phi[10]"});
*/

system("./NPendulum.pendulum -ls klu");
system("./NPendulum.pendulum -ls klu -lssMinSize=4001");
res := OpenModelica.Scripting.compareSimulationResults("NPendulum.pendulum_res.mat",
getEnvironmentVar("REFERENCEFILES")+"/linear_system/NPendulum_10.mat",
"NPendulum_diff.csv",0.01,0.01,
Expand All @@ -79,6 +79,8 @@ res := OpenModelica.Scripting.compareSimulationResults("NPendulum.pendulum_res.m
// Result:
// true
// ""
// true
// ""
// {"NPendulum.pendulum","NPendulum.pendulum_init.xml"}
// "Notification: Automatically loaded package Modelica 3.2.1 due to uses annotation.
// Notification: Automatically loaded package Complex 3.2.1 due to uses annotation.
Expand All @@ -104,19 +106,27 @@ res := OpenModelica.Scripting.compareSimulationResults("NPendulum.pendulum_res.m
// "Warning: 'compareSimulationResults' is deprecated. It is recommended to use 'diffSimulationResults' instead.
// "
// {"NPendulum.pendulum","NPendulum.pendulum_init.xml"}
// ""
// "Notification: Tearing is skipped for strong component 1 because system size of 278 exceeds maximum system size for tearing of linear systems (0).
// To adjust the maximum system size for tearing use --maxSizeLinearTearing=<size> and --maxSizeNonlinearTearing=<size>.
// Notification: Tearing is skipped for strong component 2 because system size of 275 exceeds maximum system size for tearing of linear systems (0).
// To adjust the maximum system size for tearing use --maxSizeLinearTearing=<size> and --maxSizeNonlinearTearing=<size>.
// "
// stdout | info | Maximum system size for using linear sparse solver changed to 4001
// stdout | info | The initialization finished successfully without homotopy method.
// stdout | info | The simulation finished successfully.
// 0
// {"Files Equal!"}
// stdout | info | Maximum system size for using linear sparse solver changed to 4001
// stdout | info | The initialization finished successfully without homotopy method.
// stdout | info | The simulation finished successfully.
// 0
// {"Files Equal!"}
// stdout | info | Maximum system size for using linear sparse solver changed to 4001
// stdout | info | The initialization finished successfully without homotopy method.
// stdout | info | The simulation finished successfully.
// 0
// {"Files Equal!"}
// stdout | info | Maximum system size for using linear sparse solver changed to 4001
// stdout | info | The initialization finished successfully without homotopy method.
// stdout | info | The simulation finished successfully.
// 0
Expand Down
10 changes: 8 additions & 2 deletions simulation/modelica/linear_system/NPendulum40.mos
Expand Up @@ -8,12 +8,12 @@ getErrorString();

setCommandLineOptions("--maxSizeLinearTearing=0");
buildModel(NPendulum.pendulum40); getErrorString();
system("./NPendulum.pendulum40 -ls umfpack");
system("./NPendulum.pendulum40 -ls umfpack -lssMinSize=4001");
res := OpenModelica.Scripting.compareSimulationResults("NPendulum.pendulum40_res.mat",
getEnvironmentVar("REFERENCEFILES")+"/linear_system/NPendulum_40.mat",
"NPendulum_diff.csv",0.01,0.0001,
{"pendel.phi[40]"});
system("./NPendulum.pendulum40 -ls klu");
system("./NPendulum.pendulum40 -ls klu -lssMinSize=4001");
res := OpenModelica.Scripting.compareSimulationResults("NPendulum.pendulum40_res.mat",
getEnvironmentVar("REFERENCEFILES")+"/linear_system/NPendulum_40.mat",
"NPendulum_diff.csv",0.01,0.0001,
Expand All @@ -27,11 +27,17 @@ res := OpenModelica.Scripting.compareSimulationResults("NPendulum.pendulum40_res
// "Notification: Automatically loaded package Modelica 3.2.1 due to uses annotation.
// Notification: Automatically loaded package Complex 3.2.1 due to uses annotation.
// Notification: Automatically loaded package ModelicaServices 3.2.1 due to uses annotation.
// Notification: Tearing is skipped for strong component 1 because system size of 1178 exceeds maximum system size for tearing of linear systems (0).
// To adjust the maximum system size for tearing use --maxSizeLinearTearing=<size> and --maxSizeNonlinearTearing=<size>.
// Notification: Tearing is skipped for strong component 2 because system size of 1175 exceeds maximum system size for tearing of linear systems (0).
// To adjust the maximum system size for tearing use --maxSizeLinearTearing=<size> and --maxSizeNonlinearTearing=<size>.
// "
// stdout | info | Maximum system size for using linear sparse solver changed to 4001
// stdout | info | The initialization finished successfully without homotopy method.
// stdout | info | The simulation finished successfully.
// 0
// {"Files Equal!"}
// stdout | info | Maximum system size for using linear sparse solver changed to 4001
// stdout | info | The initialization finished successfully without homotopy method.
// stdout | info | The simulation finished successfully.
// 0
Expand Down
30 changes: 25 additions & 5 deletions simulation/modelica/linear_system/problem2.mos
Expand Up @@ -222,7 +222,11 @@ val(i2, 1.0);
// stdout | info | The simulation finished successfully.
// "
// end SimulationResult;
// ""
// "Notification: Tearing is skipped for strong component 1 because system size of 5 exceeds maximum system size for tearing of linear systems (0).
// To adjust the maximum system size for tearing use --maxSizeLinearTearing=<size> and --maxSizeNonlinearTearing=<size>.
// Notification: Tearing is skipped for strong component 2 because system size of 5 exceeds maximum system size for tearing of linear systems (0).
// To adjust the maximum system size for tearing use --maxSizeLinearTearing=<size> and --maxSizeNonlinearTearing=<size>.
// "
// 0.0
// 2.804903282692988
// 0.0
Expand All @@ -234,7 +238,11 @@ val(i2, 1.0);
// stdout | info | The simulation finished successfully.
// "
// end SimulationResult;
// ""
// "Notification: Tearing is skipped for strong component 1 because system size of 5 exceeds maximum system size for tearing of linear systems (0).
// To adjust the maximum system size for tearing use --maxSizeLinearTearing=<size> and --maxSizeNonlinearTearing=<size>.
// Notification: Tearing is skipped for strong component 2 because system size of 5 exceeds maximum system size for tearing of linear systems (0).
// To adjust the maximum system size for tearing use --maxSizeLinearTearing=<size> and --maxSizeNonlinearTearing=<size>.
// "
// 0.0
// 2.804903282692988
// 0.0
Expand All @@ -246,7 +254,11 @@ val(i2, 1.0);
// stdout | info | The simulation finished successfully.
// "
// end SimulationResult;
// ""
// "Notification: Tearing is skipped for strong component 1 because system size of 5 exceeds maximum system size for tearing of linear systems (0).
// To adjust the maximum system size for tearing use --maxSizeLinearTearing=<size> and --maxSizeNonlinearTearing=<size>.
// Notification: Tearing is skipped for strong component 2 because system size of 5 exceeds maximum system size for tearing of linear systems (0).
// To adjust the maximum system size for tearing use --maxSizeLinearTearing=<size> and --maxSizeNonlinearTearing=<size>.
// "
// 0.0
// 2.804903282692989
// 0.0
Expand All @@ -258,7 +270,11 @@ val(i2, 1.0);
// stdout | info | The simulation finished successfully.
// "
// end SimulationResult;
// ""
// "Notification: Tearing is skipped for strong component 1 because system size of 5 exceeds maximum system size for tearing of linear systems (0).
// To adjust the maximum system size for tearing use --maxSizeLinearTearing=<size> and --maxSizeNonlinearTearing=<size>.
// Notification: Tearing is skipped for strong component 2 because system size of 5 exceeds maximum system size for tearing of linear systems (0).
// To adjust the maximum system size for tearing use --maxSizeLinearTearing=<size> and --maxSizeNonlinearTearing=<size>.
// "
// 9.518569369879021e-28
// 2.804903282692988
// 2.655481430415245e-28
Expand All @@ -270,7 +286,11 @@ val(i2, 1.0);
// stdout | info | The simulation finished successfully.
// "
// end SimulationResult;
// ""
// "Notification: Tearing is skipped for strong component 1 because system size of 5 exceeds maximum system size for tearing of linear systems (0).
// To adjust the maximum system size for tearing use --maxSizeLinearTearing=<size> and --maxSizeNonlinearTearing=<size>.
// Notification: Tearing is skipped for strong component 2 because system size of 5 exceeds maximum system size for tearing of linear systems (0).
// To adjust the maximum system size for tearing use --maxSizeLinearTearing=<size> and --maxSizeNonlinearTearing=<size>.
// "
// 0.0
// 2.804903282692988
// 0.0
Expand Down
24 changes: 20 additions & 4 deletions simulation/modelica/linear_system/problem3.mos
Expand Up @@ -52,7 +52,11 @@ val(x[2], 1.0);
// stdout | info | The simulation finished successfully.
// "
// end SimulationResult;
// ""
// "Notification: Tearing is skipped for strong component 1 because system size of 2 exceeds maximum system size for tearing of linear systems (0).
// To adjust the maximum system size for tearing use --maxSizeLinearTearing=<size> and --maxSizeNonlinearTearing=<size>.
// Notification: Tearing is skipped for strong component 2 because system size of 2 exceeds maximum system size for tearing of linear systems (0).
// To adjust the maximum system size for tearing use --maxSizeLinearTearing=<size> and --maxSizeNonlinearTearing=<size>.
// "
// 10.0
// 9.980736544657136
// 1.0
Expand All @@ -64,7 +68,11 @@ val(x[2], 1.0);
// stdout | info | The simulation finished successfully.
// "
// end SimulationResult;
// ""
// "Notification: Tearing is skipped for strong component 1 because system size of 2 exceeds maximum system size for tearing of linear systems (0).
// To adjust the maximum system size for tearing use --maxSizeLinearTearing=<size> and --maxSizeNonlinearTearing=<size>.
// Notification: Tearing is skipped for strong component 2 because system size of 2 exceeds maximum system size for tearing of linear systems (0).
// To adjust the maximum system size for tearing use --maxSizeLinearTearing=<size> and --maxSizeNonlinearTearing=<size>.
// "
// 10.0
// 9.980736544657136
// 0.9999999999999999
Expand All @@ -76,7 +84,11 @@ val(x[2], 1.0);
// stdout | info | The simulation finished successfully.
// "
// end SimulationResult;
// ""
// "Notification: Tearing is skipped for strong component 1 because system size of 2 exceeds maximum system size for tearing of linear systems (0).
// To adjust the maximum system size for tearing use --maxSizeLinearTearing=<size> and --maxSizeNonlinearTearing=<size>.
// Notification: Tearing is skipped for strong component 2 because system size of 2 exceeds maximum system size for tearing of linear systems (0).
// To adjust the maximum system size for tearing use --maxSizeLinearTearing=<size> and --maxSizeNonlinearTearing=<size>.
// "
// 10.0
// 9.980736544657136
// 1.0
Expand All @@ -88,7 +100,11 @@ val(x[2], 1.0);
// stdout | info | The simulation finished successfully.
// "
// end SimulationResult;
// ""
// "Notification: Tearing is skipped for strong component 1 because system size of 2 exceeds maximum system size for tearing of linear systems (0).
// To adjust the maximum system size for tearing use --maxSizeLinearTearing=<size> and --maxSizeNonlinearTearing=<size>.
// Notification: Tearing is skipped for strong component 2 because system size of 2 exceeds maximum system size for tearing of linear systems (0).
// To adjust the maximum system size for tearing use --maxSizeLinearTearing=<size> and --maxSizeNonlinearTearing=<size>.
// "
// 9.999999999999998
// 9.980736544657136
// 1.0
Expand Down
2 changes: 1 addition & 1 deletion simulation/modelica/others/EngineV6_evalParams.mos
Expand Up @@ -4,7 +4,7 @@
//
loadModel(Modelica,{"3.2.1"});
loadFile("EngineV6_output.mo");getErrorString();
setCommandLineOptions("-d=evaluateAllParameters"); getErrorString();
setCommandLineOptions("-d=evaluateAllParameters --maxSizeLineartearing=4000"); getErrorString();
simulate(EngineV6_output); getErrorString();

val(crankshaftSpeed,1.0); getErrorString();
Expand Down
3 changes: 3 additions & 0 deletions simulation/modelica/others/EngineV6_output.mos
Expand Up @@ -5,6 +5,7 @@
loadModel(Modelica,{"3.2.1"});
loadFile("EngineV6_output.mo");getErrorString();
setDebugFlags("evalOutputOnly"); getErrorString();
setCommandLineOptions("--maxSizeLineartearing=4000"); getErrorString();
simulate(EngineV6_output); getErrorString();

val(crankshaftSpeed,1.0); getErrorString();
Expand All @@ -15,6 +16,8 @@ val(crankshaftSpeed,1.0); getErrorString();
// ""
// true
// ""
// true
// ""
// There have been 1188 SCCs and now there are 566 SCCs.
// record SimulationResult
// resultFile = "EngineV6_output_res.mat",
Expand Down
2 changes: 1 addition & 1 deletion simulation/modelica/tearing/Tearing12-cel.mos
Expand Up @@ -9,7 +9,7 @@ loadFile("Tearing12.mo"); getErrorString();

setDebugFlags("backenddaeinfo"); getErrorString();
setTearingMethod("cellier"); getErrorString();
setCommandLineOptions("+tearingHeuristic=MC1"); getErrorString();
setCommandLineOptions("--tearingHeuristic=MC1 --maxSizeLinearTearing=4000"); getErrorString();
simulate(Tearing12); getErrorString();


Expand Down
2 changes: 1 addition & 1 deletion simulation/modelica/tearing/Tearing12-celMC3.mos
Expand Up @@ -9,7 +9,7 @@ loadFile("Tearing12.mo"); getErrorString();

setDebugFlags("backenddaeinfo"); getErrorString();
setTearingMethod("cellier"); getErrorString();
setCommandLineOptions("+tearingHeuristic=MC3"); getErrorString();
setCommandLineOptions("--tearingHeuristic=MC3 --maxSizeLinearTearing=4000"); getErrorString();
simulate(Tearing12); getErrorString();


Expand Down
2 changes: 1 addition & 1 deletion simulation/modelica/tearing/Tearing12-omc.mos
Expand Up @@ -8,7 +8,7 @@ loadFile("Tearing12.mo"); getErrorString();

setDebugFlags("backenddaeinfo"); getErrorString();
setTearingMethod("omcTearing"); getErrorString();
setCommandLineOptions("+preferTVarsWithStartValue=false"); getErrorString();
setCommandLineOptions("--maxSizeLinearTearing=4000"); getErrorString();
simulate(Tearing12); getErrorString();

// Result:
Expand Down

0 comments on commit 8e44932

Please sign in to comment.