-
Notifications
You must be signed in to change notification settings - Fork 139
Open
Description
Summary:
I am running a perpetual simulation using FMPy and a Co-Simulation FMU (FMI 2.0, Python 3.12, Windows). My workflow is to process real data in batches: I run the simulation on the currently available data, then pause and save the FMU state. When new data arrives (which could be hours or days later), I want to resume the simulation from exactly where I left off by restoring the saved state.
What I am trying:
- Save the FMU state after running the simulation for some time (not just after initialization).
- Store the FMU state bytes to disk (using pickle or direct file write).
- Later, after a kernel restart or process termination, re-instantiate the FMU from the same .fmu file, and try to restore the saved state using deSerializeFMUstate and setFMUstate.
Problem:
- When I try to restore the FMU state in a new Python session (after re-instantiating the FMU), I get:
OSError: exception: access violation writing 0xXXXXXXXXXXXXXXX
Questions:
- Is it possible to serialize an FMU state after simulation has advanced, and later restore it into a new FMU instance (across sessions or kernel restarts)?
- Does FMPy or the FMI 2.0 standard support this use case for Co-Simulation FMUs?
- If not, is there a recommended approach for running perpetual simulations with batch data, where each run may be separated by hours or days?
- If this is a limitation of the FMU implementation, can FMPy detect and provide a clearer error or warning?
Environment:
- FMPy version: latest
- FMU type: Co-Simulation (FMI 2.0)
- Python version: 3.12
- OS: Windows
Thank you for your help!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels