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 committed Sep 18, 2020
1 parent 6f78475 commit 90901af
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 @@ -439,7 +439,15 @@ bool Runtime::finalize(bool const force_now) {
}

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 90901af

Please sign in to comment.