I'm using MPI, and at some points want to use STOP (or another method), to exit the program with an error message.
Right now, I'm doing something like this:
STOP 'Error'
But I have a feeling I'm doing something wrong. Do I need to call MPI_FINALIZE first? Is there something else to be doing?
In a catastrophic error condition, the usual way to exit is call MPI_Abort(MPI_COMM_WORLD, errcode, ierr)
. In most implementations, this will kill all tasks. In less drastic situations you could make sure all the tasks know of the condition and then have them all excit more gracefully with an MPI_Finalize
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With