Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/msl-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ on:
required: false
default: 'main'
type: string
bm_options:
description: 'Comma-separated --baseModelicaOptions values for OpenModelica Base Modelica export'
required: false
default: 'scalarize,moveBindings'
type: string

concurrency:
group: pages-${{ inputs.library || 'Modelica' }}-${{ inputs.lib_version || '4.1.0' }}-${{ inputs.bm_version || 'main' }}
Expand All @@ -46,6 +51,7 @@ jobs:
LIB_NAME: ${{ inputs.library || 'Modelica' }}
LIB_VERSION: ${{ inputs.lib_version || '4.1.0' }}
BM_VERSION_INPUT: ${{ inputs.bm_version || 'main' }}
BM_OPTIONS: ${{ inputs.bm_options || 'scalarize,moveBindings' }}

steps:
- name: Checkout source
Expand Down
7 changes: 5 additions & 2 deletions src/pipeline.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ end
# ── Main ───────────────────────────────────────────────────────────────────────

"""
main(; library, version, filter, omc_exe, results_root, ref_root) → results
main(; library, version, filter, omc_exe, results_root, ref_root, bm_options) → results

Run the full pipeline over all experiment models in `library` `version`.
Discovers models via OMC, runs `test_model` for each, then writes the HTML
Expand All @@ -65,6 +65,7 @@ function main(;
omc_exe :: String = get(ENV, "OMC_EXE", "omc"),
results_root :: String = "",
ref_root :: String = get(ENV, "MAPLIB_REF", ""),
bm_options :: String = get(ENV, "BM_OPTIONS", "scalarize,moveBindings"),
)
t0 = time()

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

omc_options = "--baseModelica --frontendInline --baseModelicaOptions=$(bm_options) -d=evaluateAllParameters"
omc_version = "unknown"
results = ModelResult[]
try
omc_version = sendExpression(omc, "getVersion()")
@info "OMC version: $omc_version"

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

ok = sendExpression(omc, """loadModel($library, {"$version"})""")
Expand Down Expand Up @@ -145,6 +147,7 @@ function main(;
version,
something(filter, ""),
omc_exe,
omc_options,
results_root,
ref_root,
omc_version,
Expand Down
1 change: 1 addition & 0 deletions src/report.jl
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ function generate_report(results::Vector{ModelResult}, results_root::String,
<h1>$(info.library) $(info.lib_version) — Base Modelica / MTK Pipeline Test Results</h1>
<p>Generated: $(now())<br>
OpenModelica: $(info.omc_version)<br>
OMC options: <code>$(info.omc_options)</code><br>
BaseModelica.jl: $(info.bm_version)$(filter_row)$(ref_row)</p>
<p>CPU: $(info.cpu_model) ($(info.cpu_threads) threads)<br>
RAM: $(ram_str) GiB<br>
Expand Down
4 changes: 4 additions & 0 deletions src/summary.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ function write_summary(
print(io, " \"lib_version\": \"$(_esc_json(info.lib_version))\",\n")
print(io, " \"filter\": \"$(_esc_json(info.filter))\",\n")
print(io, " \"omc_exe\": \"$(_esc_json(info.omc_exe))\",\n")
print(io, " \"omc_options\": \"$(_esc_json(info.omc_options))\",\n")
print(io, " \"results_root\": \"$(_esc_json(info.results_root))\",\n")
print(io, " \"ref_root\": \"$(_esc_json(info.ref_root))\",\n")
print(io, " \"omc_version\": \"$(_esc_json(info.omc_version))\",\n")
Expand Down Expand Up @@ -62,6 +63,7 @@ Parsed contents of a single `summary.json` file.
- `lib_version` — library version (e.g. `"4.1.0"`)
- `filter` — model name filter regex, or `""` when none was given
- `omc_exe` — path / command used to launch OMC
- `omc_options` — full options string passed to `setCommandLineOptions`
- `results_root` — absolute path where results were written
- `ref_root` — absolute path to reference results, or `""` when unused
- `omc_version` — OMC version string
Expand All @@ -78,6 +80,7 @@ struct RunSummary
lib_version :: String
filter :: String
omc_exe :: String
omc_options :: String
results_root :: String
ref_root :: String
omc_version :: String
Expand Down Expand Up @@ -134,6 +137,7 @@ function load_summary(results_root::String)::Union{RunSummary,Nothing}
_str("lib_version"),
_str("filter"),
_str("omc_exe"),
_str("omc_options"),
_str("results_root"),
_str("ref_root"),
_str("omc_version"),
Expand Down
2 changes: 2 additions & 0 deletions src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Metadata about a single test run, collected by `main()` and written into both
- `lib_version` — library version (e.g. `"4.1.0"`)
- `filter` — model name filter regex, or `""` when none was given
- `omc_exe` — path / command used to launch OMC
- `omc_options` — full options string passed to `setCommandLineOptions`
- `results_root` — absolute path where results are written
- `ref_root` — absolute path to reference results, or `""` when unused
- `omc_version` — version string returned by `getVersion()`, e.g. `"v1.23.0"`
Expand All @@ -60,6 +61,7 @@ struct RunInfo
lib_version :: String
filter :: String # "" when no filter was given
omc_exe :: String
omc_options :: String
results_root :: String
ref_root :: String # "" when no reference root was given
omc_version :: String
Expand Down