Skip to content

Commit

Permalink
- added a lot of tests for HPCOM to cpp-runtime, to test various comb…
Browse files Browse the repository at this point in the history
…inations of schedulers and code generators

- updated expected output for HPCOM, because the zeroFuncs are now parallelized as well
- removed old HPCOM-tests from cpp-runtime
  • Loading branch information
Marcus Walther authored and OpenModelica-Hudson committed Jul 2, 2015
1 parent 5be3936 commit e21d154
Show file tree
Hide file tree
Showing 58 changed files with 395 additions and 1,371 deletions.
Expand Up @@ -9,7 +9,7 @@ setCommandLineOptions("+simCodeTarget=Cpp"); getErrorString();
loadFile("CoupledClutches.mo"); getErrorString();
translateModelFMU(CoupledClutches); getErrorString();

//importFMU("CoupledClutches.fmu"); getErrorString();
//importFMU("CoupledClutches.fmu", "<default>", 6); getErrorString();
//loadFile("CoupledClutches_me_FMU.mo"); getErrorString();
//simulate(CoupledClutches_me_FMU, numberOfIntervals=150, variableFilter="J1_w1|J2_w1|J3_w1|J4_w1"); getErrorString();

Expand Down
Expand Up @@ -9,6 +9,10 @@ setCommandLineOptions("+simCodeTarget=Cpp"); getErrorString();
loadFile("CoupledClutches.mo"); getErrorString();
translateModelFMU(CoupledClutches, version = "2.0"); getErrorString();

//importFMU("CoupledClutches.fmu"); getErrorString();
//loadFile("CoupledClutches_me_FMU.mo"); getErrorString();
//simulate(CoupledClutches_me_FMU, numberOfIntervals=150, variableFilter="J1_w1|J2_w1|J3_w1|J4_w1"); getErrorString();

// Result:
// true
// ""
Expand Down
20 changes: 0 additions & 20 deletions openmodelica/cppruntime/hpcom/BouncingBall.mo

This file was deleted.

50 changes: 0 additions & 50 deletions openmodelica/cppruntime/hpcom/BouncingBall_levelfix_pthreads.mos

This file was deleted.

50 changes: 0 additions & 50 deletions openmodelica/cppruntime/hpcom/BouncingBall_mcp_omp.mos

This file was deleted.

82 changes: 63 additions & 19 deletions openmodelica/cppruntime/hpcom/Makefile
@@ -1,31 +1,51 @@
TEST = ../../../rtest -v

TESTFILES = \
BouncingBall_mcp_omp.mos \
Modelica.Electrical.Spice3.Examples.CoupledInductors_level.mos \
Modelica.Electrical.Analog.Examples.CauerLowPassSC_level_omp.mos \
Modelica.Electrical.Analog.Examples.CauerLowPassSC_levelfix_memory.mos \
Modelica.Thermal.HeatTransfer.Examples.Motor.mos

TESTFILES_ALL = $(TESTFILES) \
Modelica.Electrical.Analog.Examples.CauerLowPassSC_levelfix.mos \
Modelica.Electrical.Analog.Examples.CauerLowPassSC_tbb.mos \
BouncingBall_mcp_omp.mos \
BouncingBall_levelfix_pthreads.mos \
Modelica.Electrical.Spice3.Examples.CoupledInductors_level_omp.mos \
Modelica.Electrical.Spice3.Examples.CoupledInductors_list_pthreads_spin.mos \
Modelica.Electrical.Analog.Examples.CauerLowPassSC_levelfix_pthreads_memory.mos \
Modelica.Thermal.HeatTransfer.Examples.Motor_mcp_omp.mos

TESTFILES_ALL = $(TESTFILES_SERIAL) $(TESTFILES_LEVELFIX) $(TESTFILES_LEVEL) $(TESTFILES_METIS) $(TESTFILES_LIST) $(TESTFILES_LISTR) $(TESTFILES_TBB) $(TESTFILES_MCP)

TESTFILES_SERIAL = \
Modelica.Electrical.Analog.Examples.CauerLowPassSC_serial_omp.mos \
Modelica.Electrical.Analog.Examples.CauerLowPassSC_serial_pthreads.mos

TESTFILES_LEVELFIX = \
Modelica.Electrical.Analog.Examples.CauerLowPassSC_levelfix_pthreads.mos \
Modelica.Electrical.Analog.Examples.CauerLowPassSC_levelfix_pthreads_memory.mos \
Modelica.Fluid.Examples.BranchingDynamicPipes_levelfix_pthreads.mos

TESTFILES_LEVEL = \
Modelica.Electrical.Spice3.Examples.CoupledInductors_level_omp.mos \
Modelica.Electrical.Analog.Examples.CauerLowPassSC_level_omp.mos

TESTFILES_METIS = \
Modelica.Electrical.Analog.Examples.CauerLowPassSC_metis_pthreads.mos

TESTFILES_LIST = \
Modelica.Electrical.Spice3.Examples.CoupledInductors_list_omp.mos \
Modelica.Electrical.Spice3.Examples.CoupledInductors_listr_omp.mos \
Modelica.Electrical.Spice3.Examples.CoupledInductors_list_pthreads.mos \
Modelica.Electrical.Spice3.Examples.CoupledInductors_list_pthreads_spin.mos \
Modelica.Electrical.Spice3.Examples.CoupledInductors_mcp_omp.mos \
Modelica.Electrical.Spice3.Examples.CoupledInductors_list_pthreads_spin.mos

TESTFILES_LISTR = \
Modelica.Electrical.Spice3.Examples.CoupledInductors_listr_omp.mos

TESTFILES_TBB = \
Modelica.Electrical.Spice3.Examples.CoupledInductors_tbb.mos \
Modelica.Fluid.Examples.BranchingDynamicPipes_levelfix.mos \
Modelica.Fluid.Examples.DrumBoiler.DrumBoiler_mcp_pthreads.mos \
Modelica.Thermal.HeatTransfer.Examples.Motor.mos
Modelica.Electrical.Analog.Examples.CauerLowPassSC_tbb.mos

TESTFILES_MCP = \
Modelica.Fluid.Examples.DrumBoiler.DrumBoiler_mcp_pthreads.mos \
Modelica.Electrical.Spice3.Examples.CoupledInductors_mcp_omp.mos \
Modelica.Thermal.HeatTransfer.Examples.Motor_mcp_omp.mos

# Run make failingtest
FAILINGTESTFILES= \
Modelica.Mechanics.MultiBody.Examples.Elementary.ThreeSprings_level_omp.mos
Modelica.Mechanics.MultiBody.Examples.Elementary.ThreeSprings_level_omp.mos \
Modelica.Mechanics.MultiBody.Examples.Elementary.ThreeSprings_list_omp.mos \
Modelica.Electrical.Analog.Examples.CauerLowPassSC_level_omp_memory.mos

# Dependency files that are not .mo .mos or Makefile
# Add them here or they will be cleaned.
Expand All @@ -40,7 +60,7 @@ ReferenceGraphs

CLEAN = `ls | grep -w -v -f deps.tmp`

.PHONY : test testAll clean getdeps failingtest
.PHONY : test testAll clean getdeps failingtest testSerial testLevelfix testMetis testList testListr testTbb testMcp

test:
@echo
Expand All @@ -49,6 +69,30 @@ test:
@echo OPENMODELICAHOME=" $(OPENMODELICAHOME) "
@$(TEST) $(TESTFILES)

testSerial:
@$(TEST) $(TESTFILES_SERIAL)

testLevelfix:
@$(TEST) $(TESTFILES_LEVELFIX)

testLevel:
@$(TEST) $(TESTFILES_LEVEL)

testMetis:
@$(TEST) $(TESTFILES_METIS)

testList:
@$(TEST) $(TESTFILES_LIST)

testListr:
@$(TEST) $(TESTFILES_LISTR)

testTbb:
@$(TEST) $(TESTFILES_TBB)

testMcp:
@$(TEST) $(TESTFILES_MCP)

testAll:
@echo
@echo Running all tests...
Expand Down
4 changes: 3 additions & 1 deletion openmodelica/cppruntime/hpcom/ModelTestingDefaults.mos
@@ -1,3 +1,5 @@
echo(false);
runScript(getEnvironmentVar("OMLIBRARYCOMMON")+"/ModelTestingDefaults.mos");
simulationRuntime := OpenModelicaModelTesting.SimulationRuntime.Cpp;
outputFormat :="csv";
outputFormat :="mat";
echo(true);
Expand Up @@ -32,16 +32,16 @@ compareVars :=
};

setDebugFlags("hpcom"); getErrorString();
setCommandLineOptions("+n=1 +hpcomScheduler=level +hpcomCode=openmp"); getErrorString();
setCXXCompiler("g++");
setCommandLineOptions("+n=2 +hpcomScheduler=level +hpcomCode=openmp"); getErrorString();

runScript(modelTesting);getErrorString();

// Result:
// "\"true
// \"
// OpenModelicaModelTesting.SimulationRuntime.Cpp
// \"csv\"
// \"mat\"
// true
// "
// ""
// OpenModelicaModelTesting.Kind.VerifiedSimulation
Expand All @@ -52,16 +52,14 @@ runScript(modelTesting);getErrorString();
// ""
// true
// ""
// true
// readCalcTimesFromFile: No valid profiling-file found.
// Warning: The costs have been estimated. Maybe Modelica.Electrical.Analog.Examples.CauerLowPassSC_eqs_prof-file is missing.
// TaskgraphMeta valid
// Using level Scheduler for the DAE system
// Using level Scheduler for the ODE system
// the ODE-system size is correct(50)
// Using level Scheduler for the ZeroFunc system
// HpcOm is still under construction.
// Simulation options: startTime = 0.0, stopTime = 60.0, numberOfIntervals = 1500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'Modelica.Electrical.Analog.Examples.CauerLowPassSC', options = '', outputFormat = 'csv', variableFilter = '.*', cflags = '', simflags = ''
// Result file: Modelica.Electrical.Analog.Examples.CauerLowPassSC_res.csv
// Simulation options: startTime = 0.0, stopTime = 60.0, numberOfIntervals = 1500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'Modelica.Electrical.Analog.Examples.CauerLowPassSC', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''
// Result file: Modelica.Electrical.Analog.Examples.CauerLowPassSC_res.mat
// Files Equal!
// "true
// "
Expand Down
Expand Up @@ -7,12 +7,10 @@
//

runScript("ModelTestingDefaults.mos");getErrorString();
simulationRuntime := OpenModelicaModelTesting.SimulationRuntime.Cpp;
modelTestingType := OpenModelicaModelTesting.Kind.VerifiedSimulation;
modelName := $TypeName(Modelica.Electrical.Analog.Examples.CauerLowPassSC);
timeout := 600;

referenceFile := "../../../simulation/libraries/msl32/ReferenceFiles/Modelica.Electrical.Analog.Examples.CauerLowPassSC.mat";
compareVars :=
{
"R4.Capacitor1.v",
Expand All @@ -34,35 +32,35 @@ compareVars :=
};

setDebugFlags("hpcom,hpcomMemoryOpt"); getErrorString();
setCommandLineOptions("+n=4 +hpcomScheduler=level +hpcomCode=openmp"); getErrorString();
setCommandLineOptions("+n=1 +hpcomScheduler=level +hpcomCode=openmp"); getErrorString();

runScript(modelTesting);getErrorString();

// Result:
// "true
// true
// "\"true
// \"
// OpenModelicaModelTesting.SimulationRuntime.Cpp
// \"mat\"
// true
// "
// ""
// OpenModelicaModelTesting.SimulationRuntime.Cpp
// OpenModelicaModelTesting.Kind.VerifiedSimulation
// Modelica.Electrical.Analog.Examples.CauerLowPassSC
// 600
// "../../../simulation/libraries/msl32/ReferenceFiles/Modelica.Electrical.Analog.Examples.CauerLowPassSC.mat"
// {"R4.Capacitor1.v","R5.Capacitor1.v","R8.Capacitor1.v","R9.Capacitor1.v","R1.Capacitor1.v","R2.Capacitor1.v","R3.Capacitor1.v","Rp1.Capacitor1.v","R7.Capacitor1.v","R10.Capacitor1.v","R11.Capacitor1.v","C3.v","C7.v","C1.v","C4.v","C8.v"}
// true
// ""
// true
// ""
// readCalcTimesFromFile: No valid profiling-file found.
// Warning: The costs have been estimated. Maybe Modelica.Electrical.Analog.Examples.CauerLowPassSC_eqs_prof-file is missing.
// TaskgraphMeta valid
// Using level Scheduler
// the ODE-system size is correct(50)
// No optimized cache map for the selected scheduler avaiable. Using default cacheMap!
// Using level Scheduler for the DAE system
// Using level Scheduler for the ODE system
// Using level Scheduler for the ZeroFunc system
// Creating optimized cache map for level scheduler
// HpcOm is still under construction.
// Simulation options: startTime = 0.0, stopTime = 60.0, numberOfIntervals = 1500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'Modelica.Electrical.Analog.Examples.CauerLowPassSC', options = '', outputFormat = 'csv', variableFilter = '.*', cflags = '', simflags = ''
// Result file: Modelica.Electrical.Analog.Examples.CauerLowPassSC_res.csv
// Simulation options: startTime = 0.0, stopTime = 60.0, numberOfIntervals = 1500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'Modelica.Electrical.Analog.Examples.CauerLowPassSC', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''
// Result file: Modelica.Electrical.Analog.Examples.CauerLowPassSC_res.mat
// Files Equal!
// "true
// "
Expand Down

0 comments on commit e21d154

Please sign in to comment.