Changeset 5625

Show
Ignore:
Timestamp:
10/29/09 16:57:00 (4 weeks ago)
Author:
goodell
Message:

Reset the errhandler in MPI_File_close and ADIO_End.

Prior to this commit we leaked user-defined errhandlers because the file
closure was never communicated back to MPICH2 in order to release the
errhandler reference.

Reviewed by robl@.

Location:
mpich2/trunk/src/mpi/romio
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • mpich2/trunk/src/mpi/romio/adio/common/ad_end.c

    r4026 r5625  
    1717     
    1818/*    FPRINTF(stderr, "reached end\n"); */ 
     19 
     20    /* if a default errhandler was set on MPI_FILE_NULL then we need to ensure 
     21     * that our reference to that errhandler is released */ 
     22    PMPI_File_set_errhandler(MPI_FILE_NULL, MPI_ERRORS_RETURN); 
    1923 
    2024/* delete the flattened datatype list */ 
  • mpich2/trunk/src/mpi/romio/mpi-io/close.c

    r5355 r5625  
    7373    } 
    7474 
     75    /* Because ROMIO expects the MPI library to provide error handler management 
     76     * routines but it doesn't ever participate in MPI_File_close, we have to 
     77     * somehow inform the MPI library that we no longer hold a reference to any 
     78     * user defined error handler.  We do this by setting the errhandler at this 
     79     * point to MPI_ERRORS_RETURN. */ 
     80    error_code = PMPI_File_set_errhandler(*mpi_fh, MPI_ERRORS_RETURN); 
     81    if (error_code != MPI_SUCCESS) goto fn_fail; 
     82 
    7583    ADIO_Close(fh, &error_code); 
    7684    MPIO_File_free(mpi_fh);