Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Correct way to STOP with MPI

Tags:

fortran

mpi

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?

like image 259
Richard Taylor Avatar asked Dec 16 '10 22:12

Richard Taylor


1 Answers

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.

like image 109
Jonathan Dursi Avatar answered Sep 27 '22 17:09

Jonathan Dursi