Skip to content

Commit

Permalink
#1359: runtime: exit cleanly when vt help requested
Browse files Browse the repository at this point in the history
  • Loading branch information
nlslatt authored and lifflander committed Sep 21, 2021
1 parent 6dd9675 commit 2bfa64f
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/vt/runtime/runtime.cc
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,20 @@ Runtime::Runtime(
// exit code of 0 -> 'help'
std::ostream& out = exit_code == 0 ? std::cout : std::cerr;

out << "--- VT INITIALIZATION ABORT ---" << "\n\n"
<< msg << "\n"
<< "--- VT INITIALIZATION ABORT ---" << "\n"
<< std::flush;
if (exit_code != 0) {
out << "--- VT INITIALIZATION ABORT ---" << "\n";
}
out << "\n" << msg << "\n";
if (exit_code != 0) {
out << "--- VT INITIALIZATION ABORT ---" << "\n";
}
out << std::flush;
}

// Even in interop mode, still abort MPI on bad args.
MPI_Abort(comm, exit_code);
if (exit_code != 0) {
// Even in interop mode, still abort MPI on bad args.
MPI_Abort(comm, exit_code);
}
MPI_Finalize();

std::_Exit(exit_code); // no return
Expand Down

0 comments on commit 2bfa64f

Please sign in to comment.