Repository navigation
Test FMI 3.0 Co-Simulation with FMPy and CVODE - #400
Merged
Merged
Conversation
The FMI jobs test FMI 2.0 only. To test FMI 3.0 without a second build of each FMU, an OpenModelica change (not yet merged; merge it first) lets omc build one FMU that serves both versions: buildModelFMU(version="2.0+3.0"). Its binary has the fmi2* and the fmi3* functions. The FMU has the FMI 2.0 layout, and modelDescription.fmi3.xml holds the FMI 3.0 description. Add the entry field fmiVersion to configs/fmi-simulators.json. If a simulator of the job has fmiVersion 3.0, build the FMU with version="2.0+3.0". That simulator runs a copy of the FMU with modelDescription.fmi3.xml as modelDescription.xml and the binaries in the FMI 3.0 platform directory (x86_64-linux, not linux64). Add one such simulator, fmpy-fmi3-cs-cvode: Co-Simulation with CVODE, run by FMPy. It fills master-fmi3-cs-cvode, and only fmi_master runs it, because the omc of the maintenance branches does not know version="2.0+3.0". OMSimulator cannot run these FMUs as FMI 3.0 yet (OpenModelica/OMSimulator#1694). Assisted-by: Claude Opus 5.5
This was referenced Nov 6, 2026
Member
Author
|
This PR needs OpenModelica/OpenModelica#17887, which adds |
sjoelund
added a commit
to sjoelund/OpenModelica
that referenced
this pull request
Nov 6, 2026
This is for OpenModelicaLibraryTesting only, not for users. OpenModelica/OpenModelicaLibraryTesting#400 tests FMI 3.0 Co-Simulation without a second build of each FMU. buildModelFMU(version="2.0+3.0") translates the model once and builds one shared library with the fmi2* and the fmi3* functions. The FMI 3.0 causalization of unconnected acausal connectors is skipped, so the FMI 2.0 side is the same as a plain FMI 2.0 export. The FMU has the FMI 2.0 layout: modelDescription.xml is the FMI 2.0 description and the binary is in binaries/linux64. modelDescription.fmi3.xml is the FMI 3.0 description. To run the FMU as FMI 3.0, replace modelDescription.xml with it and rename binaries/linux64 to binaries/x86_64-linux. The FMI 2.0 and the FMI 3.0 interface both compile fmu_model_interface.c.inc, so they define the same symbols, and their ModelInstance structs are different. So CodegenFMU also writes <model>_FMU2.h and <model>_FMU2.c, and the FMU build compiles them with fmu2_model_interface.c into one object whose hidden symbols objcopy makes local. This works only for --simCodeTarget=C and a shared library on Linux. Fixes OpenModelica#17886 Assisted-by: Claude Opus 5.5
sjoelund
added a commit
to sjoelund/OpenModelica
that referenced
this pull request
Nov 6, 2026
This is for OpenModelicaLibraryTesting only, not for users. OpenModelica/OpenModelicaLibraryTesting#400 tests FMI 3.0 Co-Simulation without a second build of each FMU. buildModelFMU(version="2.0+3.0") translates the model once and builds one shared library with the fmi2* and the fmi3* functions. The FMI 3.0 causalization of unconnected acausal connectors is skipped, so the FMI 2.0 side is the same as a plain FMI 2.0 export. The FMU has the FMI 2.0 layout: modelDescription.xml is the FMI 2.0 description and the binary is in binaries/linux64. modelDescription.fmi3.xml is the FMI 3.0 description. To run the FMU as FMI 3.0, replace modelDescription.xml with it and rename binaries/linux64 to binaries/x86_64-linux. With the C simulation runtime, the FMI 2.0 and the FMI 3.0 interface both compile fmu_model_interface.c.inc, so they define the same symbols, and their ModelInstance structs are different. So CodegenFMU also writes <model>_FMU2.h and <model>_FMU2.c, and the FMU build compiles them with fmu2_model_interface.c into one object whose hidden symbols objcopy makes local. This works only for a shared library on Linux. With --simCodeTarget=C+Rust, libSimulationRuntimeRust serves both interfaces. <model>_FMU.c includes the FMI 2.0 wrappers next to the FMI 3.0 ones, and no second object is necessary. A wasm simCodeTarget gets the C export, as FMI 1.0 does. So the test runs in all three testsuite lanes. Fixes OpenModelica#17886 Assisted-by: Claude Opus 5.5
sjoelund
added a commit
to OpenModelica/OpenModelica
that referenced
this pull request
Nov 6, 2026
This is for OpenModelicaLibraryTesting only, not for users. OpenModelica/OpenModelicaLibraryTesting#400 tests FMI 3.0 Co-Simulation without a second build of each FMU. buildModelFMU(version="2.0+3.0") translates the model once and builds one shared library with the fmi2* and the fmi3* functions. The FMI 3.0 causalization of unconnected acausal connectors is skipped, so the FMI 2.0 side is the same as a plain FMI 2.0 export. The FMU has the FMI 2.0 layout: modelDescription.xml is the FMI 2.0 description and the binary is in binaries/linux64. modelDescription.fmi3.xml is the FMI 3.0 description. To run the FMU as FMI 3.0, replace modelDescription.xml with it and rename binaries/linux64 to binaries/x86_64-linux. The FMI 2.0 and the FMI 3.0 interface both compile fmu_model_interface.c.inc, so they define the same symbols, and their ModelInstance structs are different. So CodegenFMU also writes <model>_FMU2.h and <model>_FMU2.c, and the FMU build compiles them with fmu2_model_interface.c into one object whose hidden symbols objcopy makes local. This works only for --simCodeTarget=C and a shared library on Linux. Fixes #17886 Assisted-by: Claude Opus 5.5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The FMI jobs test FMI 2.0 only. To test FMI 3.0 without a second build of each FMU, an OpenModelica change (not yet merged; merge it first) lets omc build one FMU that serves both versions: buildModelFMU(version="2.0+3.0"). Its binary has the fmi2* and the fmi3* functions. The FMU has the FMI 2.0 layout, and modelDescription.fmi3.xml holds the FMI 3.0 description.
Add the entry field fmiVersion to configs/fmi-simulators.json. If a simulator of the job has fmiVersion 3.0, build the FMU with version="2.0+3.0". That simulator runs a copy of the FMU with modelDescription.fmi3.xml as modelDescription.xml and the binaries in the FMI 3.0 platform directory (x86_64-linux, not linux64).
Add one such simulator, fmpy-fmi3-cs-cvode: Co-Simulation with CVODE, run by FMPy. It fills master-fmi3-cs-cvode, and only fmi_master runs it, because the omc of the maintenance branches does not know version="2.0+3.0". OMSimulator cannot run these FMUs as FMI 3.0 yet (OpenModelica/OMSimulator#1694).
Assisted-by: Claude Opus 5.5