Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 340: Add a prefix to benchmarks #414

Merged
merged 1 commit into from
Aug 5, 2024
Merged
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
25 changes: 23 additions & 2 deletions benchmark/make_epiaware_suite.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,28 @@
"""
function make_epiaware_suite(model; check = true,
adbackends = [:forwarddiff, :reversediff, :reversediff_compiled])
suite = TuringBenchmarking.make_turing_suite(
model; check = check, adbackends = adbackends)
suite = prefix_warnings(
() -> TuringBenchmarking.make_turing_suite(
model; check = check, adbackends = adbackends),
model
)
return suite
end

function prefix_warnings(f, g)
seabbs marked this conversation as resolved.
Show resolved Hide resolved
original_stderr = stderr
(read_pipe, write_pipe) = redirect_stderr()
result = nothing
try
result = f()
finally
redirect_stderr(original_stderr)
close(write_pipe)
output = String(read(read_pipe))
if !isempty(output)
println(stderr, "\nWarnings from $(g):")
println(stderr, output)
end
end
return result
end
Loading