Commit 994ba6f
wasm-jit: implement the missing runtime flags (#16206)
OMEdit sends `-startTime`/`-stopTime`/`-tolerance`/`-outputFormat` on
every run, none of which the wasm-jit runtime implemented, so every
simulation started from it was refused outright.
`SimMeta::apply_flags` is C's `read_experiment` (plus the step-size
checks `solver_main.c` makes right after it): the run scalars the
model was translated with, overridden by the command line.
`n_intervals` is C's `numSteps`, so a moved step size lands on the
output grid. Whichever entry point owns the driver applies it once
per run to its own copy — the host through `SimModel::run_meta`,
`rt_sim_start` in-wasm, `_start` in the standalone.
Implemented at the same time:
- `-outputPath` and `-r`: result-file resolution. The standalone
honoured neither.
- `-noemit`: C's `sim_noemit`, i.e. `-outputFormat=empty`.
- `-iit`: the time `-iif`'s result file is read at.
- `-mei` / `-mbi`: the event-iteration and bisection caps, the
latter in both `fixedstep` and gbode.
- `-newtonFTol` / `-newtonXTol` / `-newtonMaxStepFactor`: a new
`rt_set_newton_tuning` export, since the homotopy Newton and
KINSOL both read them as C's globals do.
- `-steadyState` / `-steadyStateTol`: reported through `terminated`,
so every driver's stop path serves it.
- `-w`: rides the `-lv` mask as `SHOW_ALL_WARNINGS`, so the one
value pushed into the wasm runtime carries it.
- `-logFormat=text`, `-daeMode` and `-jacobianThreads`: accepted
with C's warnings.
`-outputFormat=csv|plt|ia` stays refused: no writer here yet.
The rejection an unimplemented flag gets no longer explains itself
with "so the run would silently ignore it" — that rationale is about
the design, not about the flag, and it belongs on `C_FLAGS`.
Verified against the C runtime with `diffSimulationResults` over
dassl, euler and gbode with the moved scalars: no differing
variables. The startup log matches C line for line, in C's order.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent dbd56e4 commit 994ba6f
17 files changed
Lines changed: 741 additions & 130 deletions
File tree
- OMCompiler/Compiler/OpenModelica.rs
- openmodelica_codegen_wasm_jit_runtime/src
- openmodelica_codegen_wasm_jit/src
- openmodelica_sim_meta/src
- gbode
- openmodelica_wasm_jit/src
Lines changed: 101 additions & 57 deletions
Large diffs are not rendered by default.
Lines changed: 25 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
192 | 197 | | |
193 | 198 | | |
194 | 199 | | |
| |||
558 | 563 | | |
559 | 564 | | |
560 | 565 | | |
561 | | - | |
| 566 | + | |
562 | 567 | | |
563 | 568 | | |
564 | 569 | | |
| |||
672 | 677 | | |
673 | 678 | | |
674 | 679 | | |
675 | | - | |
| 680 | + | |
676 | 681 | | |
677 | 682 | | |
678 | 683 | | |
| |||
758 | 763 | | |
759 | 764 | | |
760 | 765 | | |
761 | | - | |
762 | | - | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
763 | 769 | | |
764 | 770 | | |
765 | 771 | | |
766 | | - | |
| 772 | + | |
767 | 773 | | |
768 | 774 | | |
769 | | - | |
| 775 | + | |
770 | 776 | | |
771 | 777 | | |
772 | 778 | | |
| |||
1566 | 1572 | | |
1567 | 1573 | | |
1568 | 1574 | | |
1569 | | - | |
1570 | | - | |
| 1575 | + | |
| 1576 | + | |
1571 | 1577 | | |
1572 | 1578 | | |
1573 | 1579 | | |
| |||
2147 | 2153 | | |
2148 | 2154 | | |
2149 | 2155 | | |
2150 | | - | |
2151 | | - | |
2152 | | - | |
2153 | | - | |
2154 | | - | |
| 2156 | + | |
| 2157 | + | |
| 2158 | + | |
2155 | 2159 | | |
2156 | 2160 | | |
2157 | 2161 | | |
| |||
2289 | 2293 | | |
2290 | 2294 | | |
2291 | 2295 | | |
2292 | | - | |
| 2296 | + | |
2293 | 2297 | | |
2294 | 2298 | | |
2295 | 2299 | | |
| |||
2332 | 2336 | | |
2333 | 2337 | | |
2334 | 2338 | | |
2335 | | - | |
| 2339 | + | |
2336 | 2340 | | |
2337 | 2341 | | |
2338 | 2342 | | |
| |||
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
255 | | - | |
| 255 | + | |
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
259 | 264 | | |
260 | 265 | | |
261 | 266 | | |
| |||
269 | 274 | | |
270 | 275 | | |
271 | 276 | | |
272 | | - | |
273 | 277 | | |
274 | 278 | | |
275 | 279 | | |
| |||
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
68 | 95 | | |
69 | 96 | | |
70 | 97 | | |
| |||
95 | 122 | | |
96 | 123 | | |
97 | 124 | | |
| 125 | + | |
| 126 | + | |
98 | 127 | | |
99 | 128 | | |
100 | 129 | | |
| |||
Lines changed: 17 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
144 | 149 | | |
145 | 150 | | |
146 | 151 | | |
| |||
195 | 200 | | |
196 | 201 | | |
197 | 202 | | |
198 | | - | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
199 | 214 | | |
200 | 215 | | |
201 | 216 | | |
| |||
Lines changed: 8 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
319 | 317 | | |
320 | 318 | | |
321 | 319 | | |
| |||
425 | 423 | | |
426 | 424 | | |
427 | 425 | | |
428 | | - | |
| 426 | + | |
429 | 427 | | |
430 | 428 | | |
431 | 429 | | |
| |||
446 | 444 | | |
447 | 445 | | |
448 | 446 | | |
449 | | - | |
450 | | - | |
| 447 | + | |
| 448 | + | |
451 | 449 | | |
452 | 450 | | |
453 | 451 | | |
| |||
583 | 581 | | |
584 | 582 | | |
585 | 583 | | |
586 | | - | |
587 | | - | |
| 584 | + | |
| 585 | + | |
588 | 586 | | |
589 | 587 | | |
590 | 588 | | |
| |||
0 commit comments