From f829c604e3df59e3872396a54a1a80702aa1baf5 Mon Sep 17 00:00:00 2001 From: Chris Elrod Date: Sat, 22 Jun 2024 18:30:54 -0400 Subject: [PATCH 1/4] Fix redefinition of `N` in OpenModelica ThermalFluid fitting --- benchmarks/ModelingToolkit/ThermalFluid.jmd | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/benchmarks/ModelingToolkit/ThermalFluid.jmd b/benchmarks/ModelingToolkit/ThermalFluid.jmd index 55842ba69..c1c2d3cc2 100644 --- a/benchmarks/ModelingToolkit/ThermalFluid.jmd +++ b/benchmarks/ModelingToolkit/ThermalFluid.jmd @@ -331,13 +331,13 @@ resultfile = "modelica_res.csv" @show "Start OpenModelica Timings" -for i in 1:length(N) - N = N[i] - N > max_sizes[end] && break - @show N +for i in eachindex(N) + n = N[i] + n > max_sizes[end] && break + @show n totaltime = @elapsed res = begin - @sync ModelicaSystem(mod, modelicafile, "DhnControl.Test.test_preinsulated_470_$N") - sendExpression(mod, "simulate(DhnControl.Test.test_preinsulated_470_$N)") + @sync ModelicaSystem(mod, modelicafile, "DhnControl.Test.test_preinsulated_470_$n") + sendExpression(mod, "simulate(DhnControl.Test.test_preinsulated_470_$n)") end #runtime = res["timeTotal"] @assert res["messages"][1:11] == "LOG_SUCCESS" From 0ff94621bfe986adc0cfb98f5f6b0439a3ed72a6 Mon Sep 17 00:00:00 2001 From: Chris Elrod Date: Sat, 22 Jun 2024 18:38:51 -0400 Subject: [PATCH 2/4] Further `ThermalFluid.jmd` fixes Remove extra total time plot, add enty to total times vector for Dymola. --- benchmarks/ModelingToolkit/ThermalFluid.jmd | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/benchmarks/ModelingToolkit/ThermalFluid.jmd b/benchmarks/ModelingToolkit/ThermalFluid.jmd index c1c2d3cc2..c140407f7 100644 --- a/benchmarks/ModelingToolkit/ThermalFluid.jmd +++ b/benchmarks/ModelingToolkit/ThermalFluid.jmd @@ -307,7 +307,7 @@ max_sizes = [480, last(N), last(N), last(N), last(N)]; # NaN-initialize so Makie will ignore incomplete ss_times = fill(NaN, length(N), 2); times = fill((NaN,NaN,NaN), length(N), length(max_sizes) - 1); -total_times = fill(NaN, length(N), length(max_sizes)); +total_times = fill(NaN, length(N), length(max_sizes)+1); # +1 for Dymola ``` ## Julia Timings @@ -381,7 +381,7 @@ let ax = Axis(f[1, 1]; yscale = log10, xscale = log10, title="Structural Simplif end Legend(f[1,2], _lines, ss_names) end -method_names = ["MTK", "JSIR - Scalar - Julia", "JSIR - Scalar - C", "JSIR - Scalar - LLVM", "JSIR - Loop - Julia", "JSIR - Loop - C", "JSIR - Loop - LLVM"]; +method_names = ["MTK", "JSIR - Julia", "JSIR - C", "JSIR - LLVM"]; for (i, timecat) in enumerate(("ODEProblem + f!", "Run", "Solve")) title = timecat * " Time" ax = Axis(f[i+1, 1]; yscale = log10, xscale = log10, title) @@ -390,11 +390,6 @@ for (i, timecat) in enumerate(("ODEProblem + f!", "Run", "Solve")) end Legend(f[i+1, 2], _lines, method_names) end -let method_names_m = vcat(method_names, "OpenModelica"); - ax = Axis(f[5, 1]; yscale = log10, xscale = log10, title = "Total Time") - _lines = map(Base.Fix1(lines!, N), eachcol(total_times)) - Legend(f[5, 2], _lines, method_names_m) -end f ``` From 4535d7dd5b4e9e397e7fe36fcfde9f91f5d36b96 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sun, 23 Jun 2024 03:47:39 -0400 Subject: [PATCH 3/4] Update Project.toml --- benchmarks/ModelingToolkit/Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/ModelingToolkit/Project.toml b/benchmarks/ModelingToolkit/Project.toml index 4463ddba1..0b71b5ef5 100644 --- a/benchmarks/ModelingToolkit/Project.toml +++ b/benchmarks/ModelingToolkit/Project.toml @@ -27,7 +27,7 @@ LinearSolve = "2.30.0" ModelingToolkit = "9.19.0" ModelingToolkitStandardLibrary = "2" OMJulia = "0.3.1" -OrdinaryDiffEq = "6.81.0" +OrdinaryDiffEq = "6.84.0" Polynomials = "4.0.8" PreferenceTools = "0.1.2" SciMLBenchmarks = "0.1.3" From e244668a040debdd6638ef8dd824ca7497181d7b Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Mon, 24 Jun 2024 17:23:49 +0200 Subject: [PATCH 4/4] Update RCCircuit.jmd --- benchmarks/ModelingToolkit/RCCircuit.jmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/ModelingToolkit/RCCircuit.jmd b/benchmarks/ModelingToolkit/RCCircuit.jmd index 6394bbc51..2808becd5 100644 --- a/benchmarks/ModelingToolkit/RCCircuit.jmd +++ b/benchmarks/ModelingToolkit/RCCircuit.jmd @@ -130,7 +130,7 @@ end function run_and_time_om!(ss_times, times, max_sizes, i, n) run_and_time_julia!(ss_times, times, max_sizes, i, n) - if n <= max_sizes[end] + if n <= max_sizes[8] total_times[i, end] = time_open_modelica(n) end @views println("n = $(n)\nstructural_simplify_times = $(ss_times[i,:])\ncomponent times = $(times[i, :])\ntotal times = $(total_times[i, :])")