1
1

Fix MPI_File_c2f -- ensure that if you invoke

MPI_File_c2f(MPI_FILE_NULL), you actually get 0, not -1.  Thanks for
Lisandro Dalcin for the bug report.

This commit was SVN r20511.
Этот коммит содержится в:
Jeff Squyres 2009-02-11 00:48:12 +00:00
родитель b33b5a91dc
Коммит c596a1bcb3

Просмотреть файл

@ -41,7 +41,16 @@ MPI_Fint MPI_File_c2f(MPI_File file)
if (MPI_PARAM_CHECK) {
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
if (ompi_file_invalid(file)) {
/* Note that ompi_file_invalid() explicitly checks for
MPI_FILE_NULL, but MPI_FILE_C2F is supposed to treat
MPI_FILE_NULL as a valid file (and therefore return a valid
Fortran handle for it). Hence, this function should not
return an error if MPI_FILE_NULL is passed in.
See a big comment in ompi/communicator/communicator.h about
this. */
if (ompi_file_invalid(file) && MPI_FILE_NULL != file) {
return OMPI_INT_2_FINT(-1);
}
}