Skip to content

Commit 54dc295

Browse files
adrpoclaude
andauthored
Test the data reconciliation libraries (#388)
* Test the data reconciliation libraries A dataReconciliation job tests ModelicaDataReconciliationSimpleTests and TSP_DataReconciliationSimpleTests from OpenModelica/DataReconciliationLibraries (configs/dataReconciliation.json) on master with --preOptModules+=dataReconciliation and -reconcile, and fills overview-dataReconciliation.html. See OpenModelica/OpenModelica#14817. For a library with "dataReconciliation": true: - translateModel gets the model's simulation flags too: the data reconciliation back end reads the -sx measurements while translating, and fails without them - the report the run writes, <model>.html, and the pages and files it links are copied to files/<model>.dr/, published, and linked as (dr) - the library page has a Data reconciliation column and count Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Label the simulation of a DR run "Simulation (DR model)" A data reconciliation run simulates the model the reconciliation extracted, not the library model. The library pages of a dataReconciliation library and an overview of only such libraries say so; the other pages do not change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 1fccde7 commit 54dc295

9 files changed

Lines changed: 155 additions & 11 deletions

File tree

‎.CI/Jenkinsfile‎

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ pipeline {
2424

2525
booleanParam(name: 'conversion_script', defaultValue: false, description: 'master branch with conversion script from MSL 3 to 4 (ryzen-5950x-1). This is an experimental job that does not run on a fixed schedule.')
2626
booleanParam(name: 'solvers', defaultValue: false, description: 'master branch, simulated with -s cvode, -s gbode and -s ida (ryzen-9950x). This is an experimental job that does not run on a fixed schedule.')
27+
booleanParam(name: 'dataReconciliation', defaultValue: false, description: 'master branch, the data reconciliation libraries of configs/dataReconciliation.json run with -reconcile (ryzen-5950x-1). Their reports are linked as (dr) and the job fills overview-dataReconciliation.html.')
2728
booleanParam(name: 'generateSymbolicJacobian', defaultValue: false, description: 'master branch, with --generateSymbolicJacobian (ryzen-5950x-1). This is an experimental job that does not run on a fixed schedule.')
2829
booleanParam(name: 'wasm_jit', defaultValue: false, description: 'master branch, with --simCodeTarget=wasm-jit (ryzen-9950x). Every model is translated and simulated the way simulate() does, filling wasm-jit. This is an experimental job that does not run on a fixed schedule.')
2930
booleanParam(name: 'wasm_web', defaultValue: false, description: 'master branch, with --simCodeTarget=wasm-jit (ryzen-9950x), simulated the way the web omc does: the driver and the linear and nonlinear solvers in wasm, the in-wasm libm, and external "C" only from prebuilt wasm libraries. Fills wasm-web. This is an experimental job that does not run on a fixed schedule.')
@@ -393,6 +394,22 @@ pipeline {
393394
runRegressiontest('master', 'generateSymbolicJacobian', 'setCommandLineOptions("--generateSymbolicJacobian")', '', false, '', '', false, false)
394395
}
395396
}
397+
stage('dataReconciliation') {
398+
agent {
399+
node {
400+
label 'ryzen-5950x-1'
401+
customWorkspace 'ws/OpenModelicaLibraryTestingWork'
402+
}
403+
}
404+
options { skipDefaultCheckout() }
405+
when {
406+
beforeAgent true
407+
expression { params.dataReconciliation }
408+
}
409+
steps {
410+
runRegressiontest('master', 'dataReconciliation', '', '', false, '', '', false, false, 0, 'configs/dataReconciliation.json')
411+
}
412+
}
396413
stage('heavy_tests') {
397414
agent {
398415
node {
@@ -488,7 +505,7 @@ pipeline {
488505
}
489506
when {
490507
beforeAgent true
491-
expression { params.v1_25 || params.v1_26 || params.v1_27 || params.master || params.conversion_script || params.report_ryzen_5950x_1 || params.report_ryzen_5950x_2 || params.newInst_newBackend || params.generateSymbolicJacobian || params.heavy_tests || params.heavy_tests_wasm || params.fmi_v1_25 || params.fmi_v1_26 || params.fmi_v1_27 || params.fmi_master || params.newInst_daeMode || params.newBackend_daeMode || params.oldInst || params.cpp || params.solvers || params.wasm_jit || params.wasm_fmu || params.wasm_web || params.c_plus_rust}
508+
expression { params.v1_25 || params.v1_26 || params.v1_27 || params.master || params.conversion_script || params.report_ryzen_5950x_1 || params.report_ryzen_5950x_2 || params.newInst_newBackend || params.generateSymbolicJacobian || params.dataReconciliation || params.heavy_tests || params.heavy_tests_wasm || params.fmi_v1_25 || params.fmi_v1_26 || params.fmi_v1_27 || params.fmi_master || params.newInst_daeMode || params.newBackend_daeMode || params.oldInst || params.cpp || params.solvers || params.wasm_jit || params.wasm_fmu || params.wasm_web || params.c_plus_rust}
492509
}
493510
environment {
494511
GITBRANCHES = 'maintenance/v1.20 maintenance/v1.21 maintenance/v1.22 maintenance/v1.23 maintenance/v1.24 maintenance/v1.25 maintenance/v1.26 maintenance/v1.27 master newInst-newBackend'
@@ -519,8 +536,8 @@ pipeline {
519536
'''
520537
sh './clean-empty-omcversion-dates.py'
521538

522-
sh "./all-reports.py --email --omcgitdir=OpenModelica ${env.GITBRANCHES} ${env.GITBRANCHES_FMI} ${env.GITBRANCHES_NEWINST} ${env.GITBRANCHES_DAE} ${env.GITBRANCHES_NEWBACKEND_DAE} ${env.GITBRANCHES_CPP} ${env.GITBRANCHES_WASM_JIT} ${env.GITBRANCHES_C_PLUS_RUST} conversion heavy_tests heavy_tests_wasm generateSymbolicJacobian gbode cvode ida"
523-
sh "./all-plots.py ${env.GITBRANCHES} ${env.GITBRANCHES_FMI} ${env.GITBRANCHES_NEWINST} ${env.GITBRANCHES_DAE} ${env.GITBRANCHES_NEWBACKEND_DAE} ${env.GITBRANCHES_CPP} ${env.GITBRANCHES_WASM_JIT} ${env.GITBRANCHES_C_PLUS_RUST} conversion heavy_tests heavy_tests_wasm generateSymbolicJacobian gbode cvode ida"
539+
sh "./all-reports.py --email --omcgitdir=OpenModelica ${env.GITBRANCHES} ${env.GITBRANCHES_FMI} ${env.GITBRANCHES_NEWINST} ${env.GITBRANCHES_DAE} ${env.GITBRANCHES_NEWBACKEND_DAE} ${env.GITBRANCHES_CPP} ${env.GITBRANCHES_WASM_JIT} ${env.GITBRANCHES_C_PLUS_RUST} conversion heavy_tests heavy_tests_wasm generateSymbolicJacobian dataReconciliation gbode cvode ida"
540+
sh "./all-plots.py ${env.GITBRANCHES} ${env.GITBRANCHES_FMI} ${env.GITBRANCHES_NEWINST} ${env.GITBRANCHES_DAE} ${env.GITBRANCHES_NEWBACKEND_DAE} ${env.GITBRANCHES_CPP} ${env.GITBRANCHES_WASM_JIT} ${env.GITBRANCHES_C_PLUS_RUST} conversion heavy_tests heavy_tests_wasm generateSymbolicJacobian dataReconciliation gbode cvode ida"
524541

525542
// Recorded and announced only once they are up: a report the database
526543
// knows about is never generated again, so one that a later failure in
@@ -540,6 +557,9 @@ pipeline {
540557
sh "./report.py --branches='generateSymbolicJacobian' configs/conf.json"
541558
sh "mv overview.html overview-generateSymbolicJacobian.html"
542559

560+
sh "./report.py --branches='dataReconciliation' configs/dataReconciliation.json"
561+
sh "mv overview.html overview-dataReconciliation.html"
562+
543563
sh "./report.py --branches='heavy_tests heavy_tests_wasm' configs/heavy_tests.json"
544564
sh "mv overview.html overview-heavy_tests.html"
545565

‎.CI/installLibraries.mos‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ for l in {
8787
{"Modelica_StateGraph2", ""},
8888
{"Modelica_Synchronous", "master"},
8989
{"ModelicaByExample", "master"},
90+
{"ModelicaDataReconciliationSimpleTests", "master"},
9091
{"ModelicaTestOverdetermined", "master"},
9192
{"NeuralNetwork", "main"},
9293
{"OpenHPL", ""},
@@ -121,6 +122,7 @@ for l in {
121122
{"StewartPlatform",""},
122123
{"SystemDynamics", "master"},
123124
{"TAeZoSysPro_testsuite", "master"},
125+
{"TSP_DataReconciliationSimpleTests", "master"},
124126
{"TAeZoSysPro", "master"},
125127
{"ThermalSeparation", "master"},
126128
{"ThermofluidStream", ""},

‎README.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,14 @@ different OpenModelica versions, according to the conditions of the
149149
"extraSimFlags": "-s=ida -nls=kinsol"
150150
```
151151

152+
A library of data reconciliation models sets `"dataReconciliation": true`
153+
(see [configs/dataReconciliation.json](./configs/dataReconciliation.json)):
154+
the model's simulation flags, its `-sx` measurements included, are then
155+
given to `translateModel` too, and the report the run writes (`<model>.html`
156+
and the pages it links) is published in `files/<model>.dr/`, linked as
157+
`(dr)` next to `(sim)`, with a *Data reconciliation* column in the library
158+
page.
159+
152160
Check [configs/conf.json](./configs/conf.json) for more.
153161
- If you used [.CI/installLibraries.mos](./.CI/installLibraries.mos) to test all
154162
libraries you'll need to install reference results and set environment

‎configs/dataReconciliation.json‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[
2+
{
3+
"library": "ModelicaDataReconciliationSimpleTests",
4+
"libraryVersion": "master",
5+
"libraryVersionNameForTests": "",
6+
"dataReconciliation": true,
7+
"extraCustomCommands": ["setCommandLineOptions(\"--preOptModules+=dataReconciliation\")"],
8+
"extraSimFlags": "-reconcile"
9+
},
10+
{
11+
"library": "TSP_DataReconciliationSimpleTests",
12+
"libraryVersion": "master",
13+
"libraryVersionNameForTests": "",
14+
"dataReconciliation": true,
15+
"extraCustomCommands": ["setCommandLineOptions(\"--preOptModules+=dataReconciliation\")"],
16+
"extraSimFlags": "-reconcile"
17+
}
18+
]

‎library.html.tpl‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
<th>SimCode</th>
1515
<th>Templates</th>
1616
<th>Compilation</th>
17-
<th>Simulation</th>
18-
<th>Verification</th>
17+
<th>#simulationLabel#</th>
18+
#drSummaryHeader#<th>Verification</th>
1919
</tr>
2020
<tr>
2121
<td>#Total#</td>
@@ -25,7 +25,7 @@
2525
<td bgcolor="#TemplatesColor#">#Templates#</td>
2626
<td bgcolor="#CompilationColor#">#Compilation#</td>
2727
<td bgcolor="#SimulationColor#">#Simulation#</td>
28-
<td bgcolor="#VerificationColor#">#Verification#</td>
28+
#drSummary#<td bgcolor="#VerificationColor#">#Verification#</td>
2929
</tr>
3030
</table>
3131

@@ -52,7 +52,7 @@ Flags: <pre>#customCommands#</pre>
5252
Config: <pre>#config#</pre>
5353
<p>Links are provided if getErrorString() or the simulation generates output. The links are coded with <font style="#FF0000">red</font> if there were errors, <font style="#FFCC66">yellow</font> if there were warnings, and normal links if there are only notifications.</p>
5454
<table>
55-
<tr><th>Model</th><th>Verified</th><th>Simulate</th><th>Total buildModel</th><th>Parsing</th><th>Frontend</th><th>Backend</th><th>SimCode</th><th>Templates</th><th>Compile</th><th>Total Execution</th></tr>
55+
<tr><th>Model</th><th>Verified</th><th>#simulateLabel#</th>#drHeader#<th>Total buildModel</th><th>Parsing</th><th>Frontend</th><th>Backend</th><th>SimCode</th><th>Templates</th><th>Compile</th><th>Total Execution</th></tr>
5656
#testsHTML#
5757
</table>
5858
<script>

‎overview.html.tpl‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
</table>
2121
<h2>Tested branches</h2>
2222
<table>
23-
<tr><th>Branch</th><th>Version</th><th>Build time</th><th>Execution time</th><th>Simulation time</th><th># Simulate</th><th># Verify</th><th># Total</th></tr>
23+
<tr><th>Branch</th><th>Version</th><th>Build time</th><th>Execution time</th><th>Simulation time</th><th>#simulateLabel#</th><th># Verify</th><th># Total</th></tr>
2424
#branches#
2525
</table>
2626
#entries#

‎report.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
dates = {}
2121
dates_str = {}
2222
fields = ["exectime", "parsing", "frontend", "backend", "simcode", "templates", "compile", "simulate", "verify"]
23-
entryhead = "<tr><th>Branch</th><th>Total</th><th>Parsing</th><th>Frontend</th><th>Backend</th><th>SimCode</th><th>Templates</th><th>Compilation</th><th>Simulation</th><th>Verification</th></tr>\n"
2423

2524
libs = {}
2625

@@ -32,6 +31,10 @@
3231
for c in configs_lst:
3332
configs = configs + c
3433
libnames = set(shared.libname(library,conf) for (library,conf) in configs)
34+
# What a data reconciliation run simulates is the model the reconciliation
35+
# extracted, not the library's model.
36+
simulationLabel = "Simulation (DR model)" if configs and all(conf.get("dataReconciliation") for (library,conf) in configs) else "Simulation"
37+
entryhead = "<tr><th>Branch</th><th>Total</th><th>Parsing</th><th>Frontend</th><th>Backend</th><th>SimCode</th><th>Templates</th><th>Compilation</th><th>%s</th><th>Verification</th></tr>\n" % simulationLabel
3538

3639
db = resultsdb.connect(args.db)
3740
cursor = db.cursor()
@@ -159,6 +162,7 @@ def checkEqual(iterator):
159162
template = open("overview.html.tpl").read()
160163
replacements = (
161164
(u"#title#", "OpenModelica Library Testing Overview"),
165+
(u"#simulateLabel#", "# " + simulationLabel if simulationLabel != "Simulation" else "# Simulate"),
162166
(u"#branches#", "\n".join(branches_lines)),
163167
(u"#numlibs#", str(len(libs))),
164168
(u"#nummodels#", str(nummodels)),

‎test.py‎

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1321,6 +1321,31 @@ def checkNumSucceeded(numSucceeded, n):
13211321
else:
13221322
return "#FFCC66"
13231323

1324+
def drLink(filename_prefix, data):
1325+
"""The (dr) link to the report a data reconciliation run wrote, if it wrote one."""
1326+
if not (data.get("dr") or {}).get("report"):
1327+
return ""
1328+
return ' (<a href="%s.dr/%s.html">dr</a>)' % (filename_prefix, os.path.basename(filename_prefix))
1329+
1330+
def drCell(conf, data):
1331+
"""The Data reconciliation cell of a model, for the libraries tested with it."""
1332+
if not conf.get("dataReconciliation"):
1333+
return ""
1334+
dr = data.get("dr") or {}
1335+
if dr.get("reconciled"):
1336+
return '<td bgcolor="#00FF00">reconciled</td>'
1337+
if dr.get("report"):
1338+
return '<td bgcolor="#FFCC66">failed</td>'
1339+
return '<td bgcolor="#FFCC66">&nbsp;</td>'
1340+
1341+
def drSummary(conf, stats):
1342+
"""The header cell and the count of reconciled models for the library summary."""
1343+
if not conf.get("dataReconciliation"):
1344+
return ("", "", "")
1345+
n = sum(1 for s in stats if (s[3].get("dr") or {}).get("reconciled"))
1346+
return ("<th>Data reconciliation</th>", '<td bgcolor="%s">%d</td>' % ("#00FF00" if n == len(stats) else "#FFCC66", n),
1347+
"<th>Data reconciliation</th>")
1348+
13241349
def checkPhase(phase, n):
13251350
if phase >= n:
13261351
return "#00FF00"
@@ -1533,22 +1558,27 @@ def publishLibrary(libname):
15331558
errPrefix = "files/%s_%s" % (s[2],s[1])
15341559
if is_non_zero_file(errPrefix+".err"):
15351560
filesList.write("/%s.err\n" % errPrefix)
1561+
if (s[3].get("dr") or {}).get("report"):
1562+
# The report of a data reconciliation run and the pages it links.
1563+
filesList.write("/%s.dr/***\n" % filename_prefix)
15361564
if (s[3].get("diff") or {}).get("vars"):
15371565
filesList.write("/%s.diff.mat\n" % filename_prefix)
15381566
filesList.write("/%s.diff.ref.mat\n" % filename_prefix)
15391567
filesList.close()
1540-
testsHTML = "\n".join(['<tr><td>%s%s</td><td bgcolor="%s">%s</td><td bgcolor="%s">%s</td><td bgcolor="%s">%s</td><td>%s</td><td bgcolor="%s">%s</td><td bgcolor="%s">%s</td><td bgcolor="%s">%s</td><td bgcolor="%s">%s</td><td bgcolor="%s">%s</td><td>%s</td></tr>\n' %
1568+
testsHTML = "\n".join(['<tr><td>%s%s%s</td><td bgcolor="%s">%s</td><td bgcolor="%s">%s</td>%s<td bgcolor="%s">%s</td><td>%s</td><td bgcolor="%s">%s</td><td bgcolor="%s">%s</td><td bgcolor="%s">%s</td><td bgcolor="%s">%s</td><td bgcolor="%s">%s</td><td>%s</td></tr>\n' %
15411569
(lambda filename_prefix, errPrefix, diff:
15421570
(
15431571
('<a href="%s">%s</a>' % (errPrefix + ".err", html.escape(s[1]))) if is_non_zero_file(errPrefix + ".err") else html.escape(s[1]),
15441572
(' (<a href="%s">sim</a>)' % (filename_prefix + ".sim")) if is_non_zero_file(filename_prefix + suffix + ".sim") else "",
1573+
drLink(filename_prefix, s[3]),
15451574
checkPhase(s[3]["phase"], 7) if s[3]["phase"]>=6 else "#FFFFFF",
15461575
# Nothing was compared, whatever phase the model reports.
15471576
"&nbsp;" if diff is None else
15481577
(("%s (%d verified)" % (timeSeconds(diff.get("time")), diff.get("numCompared"))) if s[3]["phase"]>=7 else
15491578
('%s (<a href="%s.diff.mat" data-omplot="%s.diff">%d/%d failed</a>)' % (timeSeconds(diff.get("time")), filename_prefix, filename_prefix, len(diff.get("vars")), diff.get("numCompared")))),
15501579
checkPhase(s[3]["phase"], 6),
15511580
timeSeconds(s[3].get("sim") or 0),
1581+
drCell(conf, s[3]),
15521582
checkPhase(s[3]["phase"], 5),
15531583
timeSeconds(sum(s[3].get(x) or 0.0 for x in ["frontend","backend","simcode","templates","build"])),
15541584
timeSeconds(s[3].get("parsing") or 0),
@@ -1569,7 +1599,13 @@ def publishLibrary(libname):
15691599

15701600
gitReferenceFilesVersion = referenceFilesVersion(conf.get("referenceFiles"))
15711601

1602+
(drSummaryHeader, drSummaryCell, drHeader) = drSummary(conf, stats)
15721603
replacements = (
1604+
(u"#drSummaryHeader#", drSummaryHeader),
1605+
(u"#drSummary#", drSummaryCell),
1606+
(u"#drHeader#", drHeader),
1607+
(u"#simulationLabel#", "Simulation (DR model)" if conf.get("dataReconciliation") else "Simulation"),
1608+
(u"#simulateLabel#", "Simulation (DR model)" if conf.get("dataReconciliation") else "Simulate"),
15731609
(u"#sysInfo#", html.escape(sysInfo)),
15741610
(u"#omcVersion#", html.escape(omc_version)),
15751611
(u"#fmiToolVersion#", ("<p>"+html.escape("FMI tool: %s" % fmisimulatorversion)+"</p>") if fmisimulatorversion else ""),

‎testmodel.py‎

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,62 @@ def noteChildrenRss():
163163

164164
threading.Thread(target=sampleTree, daemon=True).start()
165165

166+
# What a data reconciliation run writes beside the executable, besides the
167+
# files its report links: the reconciled values and the extracted model.
168+
dataReconciliationExtraFiles = ("_Outputs.csv", "_BoundaryConditions_Outputs.csv", "_Reconciled_Sx.csv",
169+
"_NonReconcilcedVars.txt", "_BoundaryConditions.html")
170+
hrefRe = re.compile(r'<a\s+href\s*=\s*"?([^"\s>]+)"?', re.I)
171+
172+
def collectDataReconciliation():
173+
"""Copy the report of a data reconciliation run to files/<model>.dr/.
174+
175+
The runtime writes <model>.html and the pages and logs it links, all next to
176+
the executable and linked relative to it, so they are copied together into a
177+
directory of their own and keep working there. The links are read from the
178+
report rather than listed here, so that whatever the runtime adds comes along.
179+
"""
180+
prefix = conf["fileName"]
181+
report = "%s.html" % prefix
182+
if not os.path.exists(report):
183+
execstat["dr"] = {"report": False, "reconciled": False}
184+
return
185+
files = {report, "Reconciled_%s.mo" % prefix.replace(".", "_")}
186+
files.update(prefix + suffix for suffix in dataReconciliationExtraFiles)
187+
pending = [report]
188+
while pending:
189+
page = pending.pop()
190+
with open(page, errors="replace") as fp:
191+
links = [l for l in hrefRe.findall(fp.read()) if "/" not in l and not l.startswith("#")]
192+
for l in links:
193+
if l not in files:
194+
files.add(l)
195+
if l.endswith(".html") and os.path.exists(l):
196+
pending.append(l)
197+
dest = os.path.normpath("../files/%s.dr" % prefix)
198+
shutil.rmtree(dest, ignore_errors=True)
199+
os.mkdir(dest)
200+
copied = []
201+
for f in sorted(files):
202+
if os.path.isfile(f):
203+
shutil.copy(f, dest)
204+
copied.append(f)
205+
# The report's "Errors" link is the output of the executable, which simulate()
206+
# writes to <model>.log and this script to the .sim file.
207+
log = "%s.log" % prefix
208+
if log in files and log not in copied and os.path.isfile(simFile):
209+
shutil.copy(simFile, os.path.join(dest, log))
210+
copied.append(log)
211+
execstat["dr"] = {"report": True, "reconciled": os.path.exists(prefix + "_Outputs.csv"), "files": copied}
212+
166213
def writeResult():
167214
noteChildrenRss()
168215
execstat["maxrss"] = max(treePeak, processPeak)
216+
if conf.get("dataReconciliation"):
217+
try:
218+
collectDataReconciliation()
219+
except Exception as e:
220+
with open(errFile, 'a+') as fp:
221+
fp.write("Collecting the data reconciliation report failed: %s\n" % e)
169222
if runningPhase is not None:
170223
(stat, key, started) = runningPhase
171224
target = execstat if stat is None else stat
@@ -748,7 +801,10 @@ def simulateCmd(resimulate):
748801
timeout = conf["ulimitOmc"] + conf["ulimitExe"]
749802
timedPhase = "sim"
750803
else:
751-
cmd='translateModel(%s,tolerance=%g,outputFormat="%s",numberOfIntervals=%d,variableFilter="%s",fileNamePrefix="%s")' % (conf["modelName"],tolerance,outputFormat,numberOfIntervals,variableFilter,conf["fileName"])
804+
# The data reconciliation back end reads the measurements (-sx) from the
805+
# simulation flags while translating, not only when the executable runs.
806+
translateSimflags = (',simflags="%s"' % " ".join(f for f in (annotationSimFlags.strip(), conf["simFlags"].strip()) if f)) if conf.get("dataReconciliation") else ""
807+
cmd='translateModel(%s,tolerance=%g,outputFormat="%s",numberOfIntervals=%d,variableFilter="%s",fileNamePrefix="%s"%s)' % (conf["modelName"],tolerance,outputFormat,numberOfIntervals,variableFilter,conf["fileName"],translateSimflags)
752808
timedPhase = "frontend"
753809
with open(errFile, 'a+') as fp:
754810
fp.write("Running command: %s\n"%(cmd))

0 commit comments

Comments
 (0)