Skip to content

Commit

Permalink
Merge pull request #255 from mabarnes/exceptions-to-stderr
Browse files Browse the repository at this point in the history
When we catch an exception, print it to stderr before calling MPI.Abort
  • Loading branch information
johnomotani authored Sep 17, 2024
2 parents 2546f32 + 5b036b8 commit 6af9bb8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions moment_kinetics/src/moment_kinetics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ function run_moment_kinetics(to::Union{TimerOutput,Nothing}, input_dict=Dict();
# Stop code from hanging when running on multiple processes if only one of them
# throws an error
if global_size[] > 1
println("$(typeof(e)) on process $(global_rank[]):")
showerror(stdout, e, catch_backtrace())
println(stderr, "$(typeof(e)) on process $(global_rank[]):")
showerror(stderr, e, catch_backtrace())
flush(stdout)
flush(stderr)
MPI.Abort(comm_world, 1)
Expand Down

0 comments on commit 6af9bb8

Please sign in to comment.