The right way to stop with MPI

I use MPI and in some cases I want to use STOP (or another method) to exit the program with an error message.

Now I am doing something like this:

STOP 'Error'

But I have a feeling that I'm doing something wrong. Do I need to call MPI_FINALIZE first? Is there anything else?

+3
source share
2 answers

In the event of a catastrophic error, the usual way out is call MPI_Abort(MPI_COMM_WORLD, errcode, ierr). In most implementations, this will kill all tasks. In less harsh situations, you can make sure that all tasks are aware of the state, and then all of them gracefully excite with MPI_Finalize.

+7
source

Take a look at MPI_Abort :

MPI_ABORT      (comm, errorcode), MPI_COMM_WORLD,       . ,      MPI_ABORT (MPI_COMM_WORLD, )       MPI_COMM_WORLD .

+4

Source: https://habr.com/ru/post/1780776/


All Articles