Skip to content

Commit 3905221

Browse files
AnHeuermannclaude
andauthored
Make baseModelicaOptions an argument (#12)
* Added moveBindings to default OpenModelica export options Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 7287884 commit 3905221

File tree

5 files changed

+18
-2
lines changed

5 files changed

+18
-2
lines changed

.github/workflows/msl-test.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ on:
2626
required: false
2727
default: 'main'
2828
type: string
29+
bm_options:
30+
description: 'Comma-separated --baseModelicaOptions values for OpenModelica Base Modelica export'
31+
required: false
32+
default: 'scalarize,moveBindings'
33+
type: string
2934

3035
concurrency:
3136
group: pages-${{ inputs.library || 'Modelica' }}-${{ inputs.lib_version || '4.1.0' }}-${{ inputs.bm_version || 'main' }}
@@ -46,6 +51,7 @@ jobs:
4651
LIB_NAME: ${{ inputs.library || 'Modelica' }}
4752
LIB_VERSION: ${{ inputs.lib_version || '4.1.0' }}
4853
BM_VERSION_INPUT: ${{ inputs.bm_version || 'main' }}
54+
BM_OPTIONS: ${{ inputs.bm_options || 'scalarize,moveBindings' }}
4955

5056
steps:
5157
- name: Checkout source

src/pipeline.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ end
5252
# ── Main ───────────────────────────────────────────────────────────────────────
5353

5454
"""
55-
main(; library, version, filter, omc_exe, results_root, ref_root) → results
55+
main(; library, version, filter, omc_exe, results_root, ref_root, bm_options) → results
5656
5757
Run the full pipeline over all experiment models in `library` `version`.
5858
Discovers models via OMC, runs `test_model` for each, then writes the HTML
@@ -65,6 +65,7 @@ function main(;
6565
omc_exe :: String = get(ENV, "OMC_EXE", "omc"),
6666
results_root :: String = "",
6767
ref_root :: String = get(ENV, "MAPLIB_REF", ""),
68+
bm_options :: String = get(ENV, "BM_OPTIONS", "scalarize,moveBindings"),
6869
)
6970
t0 = time()
7071

@@ -78,13 +79,14 @@ function main(;
7879
@info "Starting OMC session ($(omc_exe))..."
7980
omc = OMJulia.OMCSession(omc_exe)
8081

82+
omc_options = "--baseModelica --frontendInline --baseModelicaOptions=$(bm_options) -d=evaluateAllParameters"
8183
omc_version = "unknown"
8284
results = ModelResult[]
8385
try
8486
omc_version = sendExpression(omc, "getVersion()")
8587
@info "OMC version: $omc_version"
8688

87-
ok = sendExpression(omc, """setCommandLineOptions("--baseModelica --frontendInline --baseModelicaOptions=scalarize -d=evaluateAllParameters")""")
89+
ok = sendExpression(omc, """setCommandLineOptions("$(omc_options)")""")
8890
ok || @warn "Failed to set Base Modelica options: $(sendExpression(omc, "getErrorString()"))"
8991

9092
ok = sendExpression(omc, """loadModel($library, {"$version"})""")
@@ -145,6 +147,7 @@ function main(;
145147
version,
146148
something(filter, ""),
147149
omc_exe,
150+
omc_options,
148151
results_root,
149152
ref_root,
150153
omc_version,

src/report.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ function generate_report(results::Vector{ModelResult}, results_root::String,
105105
<h1>$(info.library) $(info.lib_version) — Base Modelica / MTK Pipeline Test Results</h1>
106106
<p>Generated: $(now())<br>
107107
OpenModelica: $(info.omc_version)<br>
108+
OMC options: <code>$(info.omc_options)</code><br>
108109
BaseModelica.jl: $(info.bm_version)$(filter_row)$(ref_row)</p>
109110
<p>CPU: $(info.cpu_model) ($(info.cpu_threads) threads)<br>
110111
RAM: $(ram_str) GiB<br>

src/summary.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ function write_summary(
2323
print(io, " \"lib_version\": \"$(_esc_json(info.lib_version))\",\n")
2424
print(io, " \"filter\": \"$(_esc_json(info.filter))\",\n")
2525
print(io, " \"omc_exe\": \"$(_esc_json(info.omc_exe))\",\n")
26+
print(io, " \"omc_options\": \"$(_esc_json(info.omc_options))\",\n")
2627
print(io, " \"results_root\": \"$(_esc_json(info.results_root))\",\n")
2728
print(io, " \"ref_root\": \"$(_esc_json(info.ref_root))\",\n")
2829
print(io, " \"omc_version\": \"$(_esc_json(info.omc_version))\",\n")
@@ -62,6 +63,7 @@ Parsed contents of a single `summary.json` file.
6263
- `lib_version` — library version (e.g. `"4.1.0"`)
6364
- `filter` — model name filter regex, or `""` when none was given
6465
- `omc_exe` — path / command used to launch OMC
66+
- `omc_options` — full options string passed to `setCommandLineOptions`
6567
- `results_root` — absolute path where results were written
6668
- `ref_root` — absolute path to reference results, or `""` when unused
6769
- `omc_version` — OMC version string
@@ -78,6 +80,7 @@ struct RunSummary
7880
lib_version :: String
7981
filter :: String
8082
omc_exe :: String
83+
omc_options :: String
8184
results_root :: String
8285
ref_root :: String
8386
omc_version :: String
@@ -134,6 +137,7 @@ function load_summary(results_root::String)::Union{RunSummary,Nothing}
134137
_str("lib_version"),
135138
_str("filter"),
136139
_str("omc_exe"),
140+
_str("omc_options"),
137141
_str("results_root"),
138142
_str("ref_root"),
139143
_str("omc_version"),

src/types.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Metadata about a single test run, collected by `main()` and written into both
4646
- `lib_version` — library version (e.g. `"4.1.0"`)
4747
- `filter` — model name filter regex, or `""` when none was given
4848
- `omc_exe` — path / command used to launch OMC
49+
- `omc_options` — full options string passed to `setCommandLineOptions`
4950
- `results_root` — absolute path where results are written
5051
- `ref_root` — absolute path to reference results, or `""` when unused
5152
- `omc_version` — version string returned by `getVersion()`, e.g. `"v1.23.0"`
@@ -60,6 +61,7 @@ struct RunInfo
6061
lib_version :: String
6162
filter :: String # "" when no filter was given
6263
omc_exe :: String
64+
omc_options :: String
6365
results_root :: String
6466
ref_root :: String # "" when no reference root was given
6567
omc_version :: String

0 commit comments

Comments
 (0)