Answer the question
In order to leave comments, you need to log in
MPI. How to interrupt the execution of all processes?
Suppose an error occurred in one of the running processes, due to which the further execution of the entire parallel program is basically impossible, as a result of which it is necessary to correctly terminate the work of all processes.
I know about the MPI_Abort function provided for these purposes, but it is not very convenient ...
In general, I would like to put a correct emergency exit from the process directly into the program execution algorithm. Something like this design for handling the occurrence of an emergency:
try
{
...
}
catch (std::exception &err)
{
errCode = 2;
for (int i = 0; i < procCount; i++)
{
if (i == procRank)
continue;
const int msg = 0;
MPI_Send(&msg, 1, MPI_INT, i, MSG_WORK, MPI_COMM_WORLD);
}
std::cerr << "Error : " << err.what() << '\n';
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question