On Oct 9, 2006, at 8:41 AM, Lisandro Dalcin wrote:

Looking at MPI-2 errata document,
http://www.mpi-forum.org/docs/errata-20-2.html, is says:

Page 61, after line 36. Add the following (paralleling the errata to MPI-1.1):

MPI_{COMM,WIN,FILE}_GET_ERRHANDLER behave as if a new error handler
object is created. That is, once the error handler is no longer
needed, MPI_ERRHANDLER_FREE should be called with the error handler
returned from MPI_ERRHANDLER_GET or MPI_{COMM,WIN,FILE}_GET_ERRHANDLER
to mark the error handler for deallocation. This provides behavior
similar to that of MPI_COMM_GROUP and MPI_GROUP_FREE.

Well, is seems that OMPI does not currently follow this specification.
Any plans to change this? Or it will not go in?

I'm not sure what you mean here -- OMPI currently increases the reference count on the errhandlers returned by COM|WIN| FILE_GET_ERRHANDLER (ERRHANDLER_GET is a synonym for COMM_GET_ERRHANDLER). So when you call ERRHANDLER_FREE, it decreases the refcount, and if the refcount is 0, it actually frees the error handler (the user's handle is always set to ERRHANDLER_NULL, regardless of whether the reference count went to 0 or not).

Remember, too, that all communications increase the refcount on the associated communicator's errhandler. So even if you ERRHANDLER_FREE an errhandler, if it's still associated with an ongoing communication, the back-end object won't be freed right away.

Can you cite a specific example of what you're trying to do and how OMPI is doing it wrong?

Additionaly, I've noted that MPI_File_get_errhandler fails with
MPI_ERR_FILE is passed file handle is MPI_FILE_NULL. However, I
undersand (regarding the standard) this is the handle to query to
get/set/reset the default error handler for new files... I think
MPI_File_{get|set}_errhandler should accept MPI_FILE_NULL handle. Am I
right?

By MPI-2:9.7, you are exactly correct. OMPI currently allows MPI_FILE_SET_ERRHANDLER(MPI_FILE_NULL, ...) (there's even an explicit reference to MPI-2:9.7 in a comment in the source), but it looks like an oversight that we don't allow MPI_FILE_GET_ERRHANDLER (MPI_FILE_NULL, ...). I will fix.

Thanks!

--
Jeff Squyres
Server Virtualization Business Unit
Cisco Systems

Reply via email to