Skip to content

Commit 12ce2dc

Browse files
committed
Handle MPI_Iprobe errors
1 parent 1d7e7f8 commit 12ce2dc

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

modules/runners/src/runners.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ void UnreadMessagesDetector::OnTestEnd(const ::testing::TestInfo& /*test_info*/)
2424
int flag = -1;
2525
MPI_Status status;
2626

27-
MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &flag, &status);
27+
const int iprobe_res = MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &flag, &status);
28+
if (iprobe_res != MPI_SUCCESS) {
29+
std::cerr << std::format("[ PROCESS {} ] [ ERROR ] MPI_Iprobe failed with code {}", rank, iprobe_res) << '\n';
30+
MPI_Abort(MPI_COMM_WORLD, iprobe_res);
31+
}
2832

2933
if (flag != 0) {
3034
std::cerr

0 commit comments

Comments
 (0)