On Nov 7, 2013, at 2:13 PM, "Andrus, Brian Contractor" <bdand...@nps.edu> wrote:

> Good to know. Thanks!

(sorry for the delay in replying; I was traveling last week, which always makes 
a disaster of my INBOX)

> Seems really like MPI_ABORT should only be used within error traps after MPI 
> functions have been started.

Correct.  We treat MPI_Abort to mean that something Bad has happened, and we 
should be noisy about it.

> Code-wise, the sample I got was not the best. Usage should be checked before 
> MPI_Initialize, I think :)
> 
> It seems the expectation is that MPI_ABORT is only called when the user 
> should be notified something went haywire.

Yes.  Another way you might consider handling this is to have one process do 
the error checking (e.g., MCW rank 0) and then broadcast out a flag result 
indicating "time to MPI_Finalize/exit" or "everything looks good; let's 
proceed."  I.e., something like this (pseudocode typed off the top of my head; 
excuse errors):

-----
   int rank, flag = 0;
   MPI_Init(...);
   MPI_Comm_rank(MPI_COMM_WORLD, &rank);
   if (0 == rank) {
       check_for_badness();
       if (bad) {
           fprintf(stderr, "Badness...\n");
           flag = 1;
       }
   }
   MPI_Bcast(&flag, 1, MPI_INT, 0, MPI_COMM_WORLD);
   if (flag) {
       MPI_Finalize();
       exit(1);
   }
-----

-- 
Jeff Squyres
jsquy...@cisco.com
For corporate legal information go to: 
http://www.cisco.com/web/about/doing_business/legal/cri/

Reply via email to