Dear All,

Next is about "MPI_FILE_SEEK_SHARED" in Fortran.

When MPI_FILE_SEEK_SHARED is called in Fortran Program,
the shared file pointer is not updated.

Incorrent function call is  the following part:
----ompi/mpi/f77/file_seek_shared_f.c-----------
 60 void mpi_file_seek_shared_f(MPI_Fint *fh, MPI_Offset *offset,
 61                 MPI_Fint *whence, MPI_Fint *ierr)
 62 {
 63     MPI_File c_fh = MPI_File_f2c(*fh);
 64
 65     *ierr = OMPI_INT_2_FINT(MPI_File_seek(c_fh, (MPI_Offset) *offset,
 66                       OMPI_FINT_2_INT(*whence)));
 67 }
----ompi/mpi/f77/file_seek_shared_f.c-----------
Attached patch fixes it(Patch is for in V1.4x).

Best regards,
Yuki MATSUMOTO
MPI development team,
Fujitsu

Index: ompi/mpi/f77/file_seek_shared_f.c
===================================================================
--- ompi/mpi/f77/file_seek_shared_f.c   (revision 25723)
+++ ompi/mpi/f77/file_seek_shared_f.c   (working copy)
@@ -62,6 +62,6 @@
 {    
     MPI_File c_fh = MPI_File_f2c(*fh);
 
-    *ierr = OMPI_INT_2_FINT(MPI_File_seek(c_fh, (MPI_Offset) *offset,
+    *ierr = OMPI_INT_2_FINT(MPI_File_seek_shared(c_fh, (MPI_Offset) *offset,
                                                         
OMPI_FINT_2_INT(*whence)));
 }

Reply via email to