Skip to content

Commit

Permalink
Merge pull request #311 from dionysos-dev/ab/bench_try_cath
Browse files Browse the repository at this point in the history
Try catch to benchmark script
  • Loading branch information
adrienbanse authored Oct 4, 2023
2 parents 6e9a020 + 3ef2ef0 commit e8618b7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions bench/benchmark.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@ for (i, ((method, problem), optimizer)) in enumerate(bench)
println("$i) ($method, $problem)")
redirect_stdio(; stdout = devnull) do
global df
solve_time_sec, memory_usage = benchmark(optimizer)
return push!(df, (method, problem, solve_time_sec, memory_usage))
try
solve_time_sec, memory_usage = benchmark(optimizer)
return push!(df, (method, problem, solve_time_sec, memory_usage))
catch
# -1 in the CSV file means that the method failed
return push!(df, (method, problem, -1.0, -1))
end
end
end

CSV.write("./benchmark.csv", df)

0 comments on commit e8618b7

Please sign in to comment.