Skip to content

Commit

Permalink
Merge pull request #981 from chriselrod/omjfix
Browse files Browse the repository at this point in the history
ThermalFluid script fix
  • Loading branch information
ChrisRackauckas authored Jun 25, 2024
2 parents cabacc5 + e244668 commit ff74b32
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion benchmarks/ModelingToolkit/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/ModelingToolkit/RCCircuit.jmd
Original file line number Diff line number Diff line change
Expand Up @@ -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, :])")
Expand Down
16 changes: 8 additions & 8 deletions benchmarks/ModelingToolkit/ThermalFluid.jmd
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ max_sizes = [480, last(N), 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
Expand All @@ -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"
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit ff74b32

Please sign in to comment.