Fortran API and fix

Glaesemann, Kurt R (Kort) kurt.glaesemann at pnl.gov
Fri Jul 27 12:33:08 CDT 2007


I put this as a ticket also:
http://trac.mcs.anl.gov/projects/parallel-netcdf/ticket/5

P-NetCDF is based in C, but has a Fortran wrapper, which is very nice,
but.....

In Some MPI implementation MPI_COMM_WORLD and other constants are not the
same in C and Fortran (HP MPI for Linux Itanium). Thus, when the Fortran
code calling arguments are passed to the C MPI API, they are wrong and the
code crashes.

P-NetCDF needs to call the MPI explicit C wrapper to convert Fortran handles
to C handles as described in the MPI docs.
http://www.mpi-forum.org/docs/mpi-20-html/node59.htm#Node59

In nfmpi_create_ and nfmpi_open_ Add this code at top:

MPI_Comm comm_c ;
MPI_Info info_c ;
comm_c = MPI_Comm_f2c(*v1);
info_c = MPI_Info_f2c(*v4);

Then change C calls in those two routines to this:
ierr = ncmpi_create(comm_c , p2, *v3, info_c , v5 );
ierr = ncmpi_open(comm_c , p2, *v3, info_c, v5 );

Kurt

PS.  I do not guarantee that there are not other places where this is a
problem, but this is enough to get the tests to run.




More information about the parallel-netcdf mailing list