In Fortran, calls to MPI_File_get_size return a negative value
when the file is larger that 2GB.
I am using Open MPI 1.4.3 on an x86_64 system. This happens with OpenMPI
compiled with Intel compilers or GCC, so I don't think it has
anything to do with the particular compiler in use.
I can fix this by removing the cast to MPI_Fint in
the function mpi_file_get_size_ in ompi/mpi/f77/file_get_size_f.c.
*size = (MPI_Fint) c_size;
*size = c_size;
But my guess is that this is not a proper fix.
There are a few other suspicious casts to MPI_Fint in the f77
directory too that probably cause similar problems:
$ $ grep \(MPI_Fint\) *.c
address_f.c: *address = (MPI_Fint) addr;
file_get_position_f.c: *offset = (MPI_Fint) c_offset;
file_get_position_shared_f.c: *offset = (MPI_Fint) c_offset;
file_get_size_f.c: *size = (MPI_Fint) c_size;
file_get_view_f.c: *disp = (MPI_Fint) c_disp;
type_extent_f.c: *extent = (MPI_Fint)c_extent;
I can also fix this problem by compiling OpenMPI with
the flag -i8, but promoting all Fortran INTEGERs to 8-bytes
does not seem correct either.
So - is this a configuration problem, a compile problem.
a source code bug, or what? Is there an MPI_FOffsetint
and/or MPI_FAddressint type that should be used
in these casts?
William L. George
National Institute of Standards and Technology
ITL - Applied and Computational Mathematics Division, Stop 8911
100 Bureau Drive
Gaithersburg, MD 20899-8911