From 699392aac5557166127a38b01eb599cf166a1117 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Sj=C3=B6lund?= Date: Fri, 6 Nov 2026 21:50:34 +0100 Subject: [PATCH] Start each FMI run with no OMSimulator settings OMSimulator stores flags such as --tempDir in ~/.omsimulator/settings.json and reads them as defaults. Before OMSimulator #1636, parallel simulations could write the file at the same time and corrupt it. A corrupt file stays corrupt: OMSimulator does not save over a file it cannot parse, so every simulation of the FMI jobs started with "Failed to load settings: ... parse error" and "Failed to save settings". Remove the file before the FMI simulators run, so that OMSimulator starts with its own defaults and a file it can write. Assisted-by: Claude Opus 5.5 --- test.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test.py b/test.py index bdb8a82..3128e61 100755 --- a/test.py +++ b/test.py @@ -466,6 +466,12 @@ def fmiSimulatorVersion(name, command): fmisimulatorversions = {} fmisimulatorversion = None +if fmisimulator and any(not isFMPy(command) for (_, command) in fmisimulators): + # OMSimulator keeps flags such as --tempDir in this file and never rewrites + # one it cannot parse, which it then warns about in every simulation. + omsSettings = os.path.join(os.path.expanduser("~"), ".omsimulator", "settings.json") + if os.path.exists(omsSettings): + os.remove(omsSettings) if fmisimulator: for (name, command) in fmisimulators: fmisimulatorversions[name] = fmiSimulatorVersion(name, command)