Distributed co-simulation
libcosim
can run distributed co-simulation which allows you to:
- Run multiple instances of a model even though the FMU only allows it to be instantiated once.
- Run FMUs that are not compatible with your OS or bitness.
- Parallelize the workload onto multiple computation nodes.
Distributed simulation is currently enabled through integration with the software proxyfmu. Both FMI 1.0 and FMI 2.0 for Co-simulation is supported.
See below for ways to load an FMU using proxyfmu.
OspSystemStructure.xml
<Simulators>
<Simulator name="FMU1"
source="proxyfmu://localhost?file=path/to/fmu1.fmu"/>
<Simulator name="FMU2"
source="proxyfmu://127.0.0.1:9090?file=path/to/fmu2.fmu"/>
</Simulators>
SystemStructure.ssp
<ssd:Elements>
<ssd:Component name="FMU1"
source="proxyfmuy://localhost?file=path/to/fmu1.fmu"/>
<ssd:Component name="FMU2"
source="proxyfmu://127.0.0.1:9090?file=path/to/fmu1.fmu"/>
</ssd:Elements>
When choosing localhost
as the hostname and omitting the port, libcosim
handles spawning new processes for the models to run. Just make sure that the proxyfmu
executable is available. It could either be located in the current directory or in the directory of the executable that uses it (e.g. cosim
or cosim demo app
). However, it is also possible to run models on a different PC. To accomplish this, start proxyfmu_booter
on the target PC with --port <arg>
as an argument. Then supply the IP and port number to the configuration. proxyfmu
should be located in the same folder as proxyfmu_booter
.
The Demo Cases include configuration for distributed co-simulation with proxyfmu, and this section shows how it’s done with the cosim demo app
.