Skip to content

Commit

Permalink
#1014: runtime: check MPI_Comm for use during component startup
Browse files Browse the repository at this point in the history
  • Loading branch information
lifflander authored and Jakub Strzebonski committed Sep 22, 2020
1 parent 38d97fa commit fa1e6a1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/vt/runtime/runtime.cc
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,15 @@ bool Runtime::finalize(bool const force_now, bool const disable_sig) {
}

void Runtime::sync() {
MPI_Barrier(communicator_);
MPI_Comm comm = communicator_;
if (comm == MPI_COMM_NULL and theContext != nullptr) {
comm = theContext->getComm();
}
if (comm == MPI_COMM_NULL) {
vtAbort("Trying to sync runtime while the communicator is not available");
} else {
MPI_Barrier(comm);
}
}

void Runtime::runScheduler() {
Expand Down

0 comments on commit fa1e6a1

Please sign in to comment.