<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hi PETSc folks,
<div class=""><br class="">
</div>
<div class="">In the MPI Forum, we're getting close to adopting a proposal to change the default communicator where errors are raised when they don't have anywhere else to go (think something like MPI_ALLOC_MEM, which doesn't have a communicator). Instead of
 getting those errors on the error handler for MPI_COMM_WORLD, it would move to MPI_COMM_SELF to allow more local error handling. Rather than having an error for passing an invalid argument potentially cause all processes to trigger the error handler, only
 the local process would see it.</div>
<div class=""><br class="">
</div>
<div class="">This doesn't impact normal error handling, such as if an MPI_RECV fails for some reason. That would trigger the error handler attached to the communicator in the receive. However, this is potentially a backward incompatible change due to the fact
 that people might be changing the error handler of MPI_COMM_WORLD, but not MPI_COMM_SELF.</div>
<div class=""><br class="">
</div>
<div class="">The details can be found on <a href="https://github.com/mpi-forum/mpi-issues/issues/3" class="">this</a> GitHub issue and in <a href="https://github.com/mpi-forum/mpi-issues/files/1511327/issues-1-3-markedup.pdf" class="">this</a> PDF (search
 for ticket3).</div>
<div class=""><br class="">
</div>
<div class="">I see that in PETSc, you guys do some basic error handling by changing the default error handler to MPI_ERRORS_RETURN on PETSC_COMM_WORLD, which may or may not be equal to MPI_COMM_WORLD. So in this case, I believe that in order to get the same
 error handling in all possible (though unlikely) cases, you would also need to set the same error handler on MPI_COMM_SELF. Probably something along the lines of:</div>
<div class=""><br class="">
</div>
<div class=""><font face="Menlo" class="">MPI_Comm_set_errhandler(MPI_COMM_SELF, MPI_ERRORS_RETURN);</font></div>
<div class=""><br class="">
</div>
<div class="">Or, if you want to preserve the user error handler:</div>
<div class=""><br class="">
</div>
<div class=""><font face="Menlo" class="">MPI_Comm_get_errhandler(MPI_COMM_SELF, &orig_errhandler);</font></div>
<div class=""><font face="Menlo" class="">if (orig_errhandler != MPI_ERRORS_ARE_FATAL) {</font></div>
<div class=""><font face="Menlo" class="">    /* Create custom error handler to deal with internal</font></div>
<div class=""><font face="Menlo" class="">     * PETSc errors and then call the user's error handler */</font></div>
<div class=""><font face="Menlo" class="">}</font></div>
<div class=""><br class="">
</div>
<div class="">Before we vote this in next week, we wanted to reach out to some users to see if you have strong opinions about this. Despite the fact that this will have some impact on users, we think this is the right way to go to improve error management in
 the MPI Standard (there are other efforts going on if you're interested).</div>
<div class=""><br class="">
</div>
<div class="">
<div class="">Thanks,</div>
<div class="">Wesley Bland</div>
</div>
</body>
</html>