[mpich2-dev] [PATCH 1/1] Issue 4120: MPI_Fint is really an MPI_Aint?

Bob Cernohous bobc at us.ibm.com
Wed Mar 26 15:19:34 CDT 2008


I believe this parameter is really an MPI_Aint.  Casting to
MPI_Fint seems wrong if MPI_Aint is 64bit and MPI_Fint is
an int which is 32 bit.

Casting the pointer seems like the best fix.  It should work 32 or
64 bit.

This code doesn't build on BG/P so I'm not testing it.  For review
and comment.

Signed-off-by: Bob Cernohous <bobc at us.ibm.com>
---
 .../src/mpi/romio/mpi-io/fortran/get_extentf.c     |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/mpi/mpich2/src/mpi/romio/mpi-io/fortran/get_extentf.c b/lib/mpi/mpich2/src/mpi/romio/mpi-io/fortran/get_extentf.c
index 9fea49a..a62a959 100644
--- a/lib/mpi/mpich2/src/mpi/romio/mpi-io/fortran/get_extentf.c
+++ b/lib/mpi/mpich2/src/mpi/romio/mpi-io/fortran/get_extentf.c
@@ -105,7 +105,7 @@ void mpi_file_get_type_extent_(MPI_Fint *fh,MPI_Fint *datatype,
     datatype_c = MPI_Type_f2c(*datatype);
 
     *ierr = MPI_File_get_type_extent(fh_c,datatype_c, &extent_c);
-    *extent = (MPI_Fint) extent_c;
+    *(MPI_Aint*)extent = extent_c; /* Have to assume it's really an MPI_Aint?*/
 }
 
 #else
@@ -121,6 +121,6 @@ FORTRAN_API void FORT_CALL mpi_file_get_type_extent_(MPI_Fint *fh,MPI_Datatype *
     
     fh_c = MPI_File_f2c(*fh);
     *ierr = MPI_File_get_type_extent(fh_c,*datatype, &extent_c);
-    *extent = (MPI_Fint) extent_c;
+    *(MPI_Aint*)extent = extent_c; /* Have to assume it's really an MPI_Aint?*/
 }
 #endif
-- 
1.5.3.7




More information about the mpich2-dev mailing list