Skip to content

Commit d4389c9

Browse files
authored
Tests Co-Simulation with CVODE for FMUs (#229)
* Added flags `--fmuType` to test.py to switch to Co-Simulation FMUs. * Added three new tests for CVODE (master, v1.25, v1.24) to Jenkinsfile
1 parent cd6607b commit d4389c9

File tree

2 files changed

+58
-1
lines changed

2 files changed

+58
-1
lines changed

.CI/Jenkinsfile

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ pipeline {
1111
booleanParam(name: 'fmi_v1_25', defaultValue: false, description: 'maintenance/v1.25 branch with FMI (ryzen-5950x-2)')
1212
booleanParam(name: 'fmi_master', defaultValue: false, description: 'master branch with FMI running OMSimulator (ryzen-5950x-2)')
1313

14+
booleanParam(name: 'cs_fmu_cvode_v1_24', defaultValue: false, description: 'maintenance/v1.24 branch with CVODE CS FMUs running OMSimulator (ryzen-5950x-2)')
15+
booleanParam(name: 'cs_fmu_cvode_v1_25', defaultValue: false, description: 'maintenance/v1.25 branch with CVODE CS FMUs running OMSimulator (ryzen-5950x-2)')
16+
booleanParam(name: 'cs_fmu_cvode_master', defaultValue: false, description: 'master branch with CVODE CS FMUs running OMSimulator (ryzen-5950x-2)')
17+
1418
booleanParam(name: 'fmpy_fmi_v1_24', defaultValue: false, description: 'maintenance/v1.24 branch with FMI (ryzen-5950x-2)')
1519
booleanParam(name: 'fmpy_fmi_v1_25', defaultValue: false, description: 'maintenance/v1.25 branch with FMI (ryzen-5950x-2)')
1620
booleanParam(name: 'fmpy_fmi_master', defaultValue: false, description: 'master branch with FMI running FMPy (ryzen-5950x-2)')
@@ -173,6 +177,54 @@ pipeline {
173177
}
174178
}
175179

180+
stage('v1.24 CVODE CS-FMUs with OMSimulator') {
181+
agent {
182+
node {
183+
label 'ryzen-5950x-2-1'
184+
customWorkspace 'ws/OpenModelicaLibraryTestingWork'
185+
}
186+
}
187+
options { skipDefaultCheckout() }
188+
when {
189+
beforeAgent true
190+
expression { params.cs_fmu_cvode_v1_24 }
191+
}
192+
steps {
193+
runRegressiontest('maintenance/v1.24', 'v1.24-cs-fmu-cvode', 'setCommandLineOptions("--fmiFlags=s:cvode --fmuRuntimeDepends=modelica")', omsimulatorHash(), 'ripper2', 'LibraryTestingRipper2DB', false, '', false, false)
194+
}
195+
}
196+
stage('v1.25 CVODE CS-FMUs with OMSimulator') {
197+
agent {
198+
node {
199+
label 'ryzen-5950x-2-1'
200+
customWorkspace 'ws/OpenModelicaLibraryTestingWork'
201+
}
202+
}
203+
options { skipDefaultCheckout() }
204+
when {
205+
beforeAgent true
206+
expression { params.cs_fmu_cvode_v1_25 }
207+
}
208+
steps {
209+
runRegressiontest('maintenance/v1.25', 'v1.25-cs-fmu-cvode', 'setCommandLineOptions("--fmiFlags=s:cvode --fmuRuntimeDepends=modelica")', omsimulatorHash(), 'ripper2', 'LibraryTestingRipper2DB', false, '', false, false)
210+
}
211+
}
212+
stage('master CVODE CS-FMUs with OMSimulator') {
213+
agent {
214+
node {
215+
label 'ryzen-5950x-2-1'
216+
customWorkspace 'ws/OpenModelicaLibraryTestingWork'
217+
}
218+
}
219+
options { skipDefaultCheckout() }
220+
when {
221+
beforeAgent true
222+
expression { params.cs_fmu_cvode_master }
223+
}
224+
steps {
225+
runRegressiontest('master', 'master-cs-fmu-cvode', 'setCommandLineOptions("--fmiFlags=s:cvode --fmuRuntimeDepends=modelica")', 'origin/master', 'ripper2', 'LibraryTestingRipper2DB', false, '', false, false)
226+
}
227+
}
176228

177229
stage('v1.24 FMI with FMPy') {
178230
agent {
@@ -648,6 +700,9 @@ def runRegressiontest(branch, name, extraFlags, omsHash, dbPrefix, sshConfig, om
648700
${env.HOME}/saved_omc/OMSimulator/install/bin/OMSimulator --version
649701
"""
650702
FMI_TESTING_FLAG="--fmi=true --fmisimulator=${env.HOME}/saved_omc/OMSimulator/install/bin/OMSimulator --default=ulimitExe=50"
703+
if (name.containts('cvode')) {
704+
FMI_TESTING_FLAG += "--fmuType='cs'"
705+
}
651706
}
652707

653708
if (name.contains('fmpy')) {

test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
parser.add_argument('configs', nargs='*')
2828
parser.add_argument('--branch', default='master')
2929
parser.add_argument('--fmi', default=False)
30+
parser.add_argument('--fmuType', default='me', help="FMU type: 'me' for Model Exchange, 'cs' for Co-Simulation.")
3031
parser.add_argument('--basemodelica-mtk-import', action="store_true", default=False, help='Activate Base Modelica export and test import with BaseModelica.jl / ModelingToolkit.jl.')
3132
parser.add_argument('--julia-sys-image', action=argparse.BooleanOptionalAction, default=True, help='Activate pre-compiling Julia system image.')
3233
parser.add_argument('--output', default='')
@@ -71,6 +72,7 @@
7172
basemodelica_mtk_import = args.basemodelica_mtk_import
7273
julia_sys_image = args.julia_sys_image
7374
allTestsFmi = args.fmi
75+
fmuType = args.fmuType
7476
ulimitMemory = args.ulimitvmem
7577
docker = args.docker
7678
addmsl = args.addmsl
@@ -620,7 +622,7 @@ def hashReferenceFiles(s):
620622
conf["haveFMI"] = fmiOK_C
621623
conf["haveFMICpp"] = fmiOK_Cpp
622624
conf["fmisimulator"] = fmisimulator
623-
conf["fmuType"] = conf.get("fmuType", "me")
625+
conf["fmuType"] = fmuType
624626
if (not canChangeOptLevel) and "optlevel" in conf:
625627
print("Deleting optlevel")
626628
del conf["optlevel"]

0 commit comments

Comments
 (0)