-
Notifications
You must be signed in to change notification settings - Fork 937
Description
At the bottom is a short program for testing MPI_File_get_info().
It reports zero key in the info object returned from an opened file. i.e.
% ~/OpenMPI/4.0.1/bin/mpicc ompi_file_info.c
% ~/OpenMPI/4.0.1/bin/mpirun -n 1 a.out
MPI File Info has nkeys = 0
When I ran it with ROMIO module, it also reports nkeys=0.
% ~/OpenMPI/4.0.1/bin/mpirun -mca io romio321 -n 1 a.out
MPI File Info has nkeys = 0
This implies OpenMPI fails to call ROMIO's implementation of MPI_File_get_info()
defined in ompi/mca/io/romio321/romio/mpi-io/get_info.c
The same test program, if compiled with MPICH 3.3, shows nkeys=17, as ROMIO defines and adds 17 default hints.
% ~/MPICH/3.3/bin/mpicc ompi_file_info.c
% ~/MPICH/3.3/bin/mpiexec -n 1 a.out
MPI File Info has nkeys = 17
When opening a file, the ROMIO's implementation in OpenMPI should call ADIOI_GEN_SetInfo() defined in ompi/mca/io/romio321/romio/adio/common/ad_hints.c, where you will see some default hints are added to an info object stored internally. This internal info object is expected to be duplicated in ROMIO's MPI_File_get_info() and returns to user.
% cat ompi_file_info.c
#include <stdio.h>
#include <mpi.h>
int main(int argc, char **argv)
{
int nkeys;
MPI_File fh;
MPI_Info info_used;
MPI_Init(&argc,&argv);
MPI_File_open(MPI_COMM_WORLD, "testfile", MPI_MODE_CREATE | MPI_MODE_RDWR,
MPI_INFO_NULL, &fh);
MPI_File_get_info(fh, &info_used);
MPI_Info_get_nkeys(info_used, &nkeys);
printf("MPI File Info has nkeys = %d\n",nkeys);
MPI_Info_free(&info_used);
MPI_File_close(&fh);
MPI_Finalize();
return 0;
}