-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FMUs that contain Spawn are not self contained #2054
Comments
Will be added for BOPTEST support. |
This is addressed through e410c6f The parameter |
Nice. I like the option to turn this off and on. This looks like it will get the resources into the FMU, but I think there is code in the C extension that needs to be updated also. I believe the argument to the C function(s) is path to MBL, not the exe/so paths. |
That's correct and need to be fixed. OPTIMICA generates
Let me see why there is a number after the |
To reproduce:
Kyle has some prototype code with fixes. |
Here is what I have so far https://github.com/lbl-srg/modelica-buildings/tree/issue2054_self_contained_spawn. It needs a fair bit of work before considering for merge. At minimum it is hard coded to linux, and that needs to be resolved. I think there are other issues too, but I'll need to dive back into this to remind myself because it has been a while. Gregor's team at CU has reported it working on Dymola. |
The development branch is |
May I ask if the Boolean variable is True, will it add some time to the simulation time of the FMU which include Spawn? |
The binaries are included by default and there is no more parameter I didn't see a noticeable overhead for including the binaries, so we prefer to keep them in rather than providing many options that may at the end not work across the various Modelica and FMI simulation environments. |
Many thanks for that! |
Hi all, |
Generating an FMU in Dymola 2021x of "Buildings.ThermalZones.EnergyPlus.Examples.SingleFamilyHouse.Unconditioned" and testing it with pyFMI I obtain the same error (spawn.exe ' does not exist: 'No such file or directory."), below: So, is it possible to generate an FMU containing a spawn thermal zone? |
@vincavitabile97: can you try to put the directory that contains your spawn.exe on the system PATH (or add a new system environment variable |
Hi @mwetter, Kind regards, |
@vincavitabile97 : Are you using the master branch of the Buildings library? Searching on SPAWNPATH is not implemented for the 8.0 or 8.1 release. It is implemented on the master branch and will be part of the next release (9.0.0). If you use the master, can you set Searching the PATH works on Linux and Windows. I tested it by creating
deleting these files from the local installation, putting Executing the version that is packaged with the fmu (in Buildings 8.1) won't work in general as some if not all tool remove the executable flag. This is one reason why for the next release, we search on PATH and SPAWNPATH if it can't be found at the default location. |
This is in referenced to any "parent" FMU that contains a Spawn model, not about the EnergyPlus FMU. If you ask the Modelica compiler to compile a model to FMU, any resources consumed by the model using the Modelica function
Modelica.Utilities.Files.loadResource
will be copied into the resulting FMU's resources directory. For example idf files are loaded using LoadResourcemodelica-buildings/Buildings/ThermalZones/EnergyPlus/Validation/ThermalZone/OneZone.mo
Line 7 in 19a997d
The binary requirements of Spawn including epfmi.so and spawn(exe) are not however loaded as resources. Instead the buildingsLibraryRoot is passed to C extensions and the paths into the MBL are determined from there.
modelica-buildings/Buildings/ThermalZones/EnergyPlus/BaseClasses/FMUZoneClass.mo
Line 20 in 19a997d
It would be better to identify epfmi and spawn using loadResource so that 1. The Modelica compiler will copy the resource if you ask for an FMU 2. The correct path for these resources will be identified at simulation time.
The text was updated successfully, but these errors were encountered: