MPI_Info in pnetcdf
Mark Taylor
mataylo at sandia.gov
Sun Jun 10 13:57:19 CDT 2007
openMPI has the same requirement. To get parallel-netcdf working on an
openMPI syste, I had to make that change you suggest and also convert
the communicators with MPI_Comm_f2c(). I hope this makes it in the next
release!
Mark
On Sun, 2007-06-10 at 12:16 -0500, Wei-keng Liao wrote:
> After replacing
> ierr = ncmpi_open((MPI_Comm)(*v1), p2, *v3, (MPI_Info)(*v4), v5);
> with
> ierr = ncmpi_open((MPI_Comm)(*v1), p2, *v3, MPI_Info_f2c(*v4), v5);
> in file src/libf/openf.c, everything is fine.
>
> Similar for src/libf/createf.c.
> ierr = ncmpi_create((MPI_Comm)(*v1), p2, *v3, MPI_Info_f2c(*v4), v5);
>
> Thanks.
> (I assume these changes will be added to the CVS.)
>
> Wei-keng
>
>
> On Sun, 10 Jun 2007, Rajeev Thakur wrote:
>
> > The Pnetcdf code should internally use MPI_Info_f2c.
> >
> > Rajeev
> >
> >> -----Original Message-----
> >> From: owner-parallel-netcdf at mcs.anl.gov
> >> [mailto:owner-parallel-netcdf at mcs.anl.gov] On Behalf Of Wei-keng Liao
> >> Sent: Sunday, June 10, 2007 12:59 AM
> >> To: parallel-netcdf at mcs.anl.gov
> >> Subject: MPI_Info in pnetcdf
> >>
> >>
> >> Pnetcdf seems to assume that data type of MPI_Info is int,
> >> which is OK if pnetcdf is built on top of MPICH2 (MPICH2
> >> type-defines MPI_Info as int.)
> >>
> >> But MPI_Info is defined differently in MPICH1 as
> >> typedef struct MPIR_Info *MPI_Info;
> >>
> >> So, when I ran the codes below using MPICH1, I got a seg fault.
> >>
> >> Wei-keng
> >>
> >> ---------------------------------------------------------------
> >> % cat pnf_test.f90
> >> program pnf_test
> >> implicit none
> >> include 'mpif.h'
> >> # include "pnetcdf.inc"
> >>
> >> integer ierr, info, ncid
> >>
> >> call MPI_Init(ierr)
> >>
> >> call MPI_Info_create(info, ierr)
> >> call MPI_Info_set(info, 'cb_buffer_size', '1048576', ierr)
> >>
> >> ierr = nfmpi_create(MPI_COMM_WORLD, 'testfile.nc', &
> >> NF_CLOBBER, info, ncid)
> >> ierr = nfmpi_enddef(ncid)
> >> ierr = nfmpi_close(ncid)
> >>
> >> call MPI_Info_free(info, ierr)
> >> call MPI_Finalize(ierr)
> >> end program pnf_test
> >>
> >>
> >
>
>
More information about the parallel-netcdf
mailing list