[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #NAZ-877935]: nf90_create_par



> I can't figure out what is wrong with the following program. I tried the
> mode flag being both the current setup and just nf90_netcdf4 and neither
> works. This is the error I get:
> 
> 
> 
> 1  failure to create
> 
> Can't add HDF5 file metadata
> 
> 
> 
> 
> The process that fails changes with each run. I am running on jaguarpf at
> ORNL. I did a module load netcdf which installed the hdf5 compiled 4.0.1.1
> version. I am using the default cray compiler.
> 
> 
> 
> Any suggestions would be appreciated. Based on the example code from the web
> page, this should work fine.
> 
> 
> 
> Thanks
> 
> 
> 
> Jay Lofstead
> 
> 
> 
> 
> 
> program a
> 
> use netcdf
> 
> implicit none
> 
> #include "mpif.h"
> 
> integer :: adios_err, rank, ncid, nc_err
> 
> integer :: mode_flag
> 
> 
> 
> integer :: myid_varid
> 
> 
> 
> call MPI_Init (adios_err)
> 
> call MPI_Comm_rank (MPI_COMM_WORLD, rank, adios_err)
> 
> 
> 
> mode_flag = IOR(nf90_netcdf4, nf90_classic_model)
> 
> 
> 
> nc_err = nf90_create_par ("filename.nc4", mode_flag, MPI_COMM_WORLD,
> MPI_INFO_NULL, ncid)
> 
> if (nc_err /= nf90_noerr) write (*,*) rank, ' failure to create ',
> nf90_strerror (nc_err)
> 
> 
> 
> nc_err = nf90_def_var (ncid, "myid", NF90_INT, varid=myid_varid)
> 
> if (nc_err /= nf90_noerr) write (*,*) rank, ' failure to def var ',
> nf90_strerror (nc_err)
> 
> nc_err = nf90_enddef (ncid)
> 
> if (nc_err /= nf90_noerr) write (*,*) rank, ' failure to enddef ',
> nf90_strerror (nc_err)
> 
> if (rank == 0) then
> 
> nc_err = nf90_put_var (ncid, myid_varid, rank)
> 
> if (nc_err /= nf90_noerr) write (*,*) rank, ' failure to put var ',
> nf90_strerror (nc_err)
> 
> endif
> 
> 
> 
> nc_err = nf90_close (ncid)
> 
> if (nc_err /= nf90_noerr) write (*,*) rank, ' failure to close ',
> nf90_strerror (nc_err)
> 
> 
> 
> end program
> 
> 
> 

Sorry Jay, your support request fell through the cracks here at Unidata. 

In answer to your question above, you must use either NC_MPIIO or NC_MPIPOSIX 
in your create mode flag.

You must learn from your sysadmin which to use, the MPI IO layer, or the MPI 
Posix layer. They will probably both work, but one may be a lot faster than the 
other on your platform.

A sample parallel I/O file can be found in the distribution:
nf_test/f90tst_parallel.f90

This program (and parallel I/O tests) will be built if you configure with 
--enable-parallel-tests.

Finally, some important parallel I/O improvements have taken place recently. I 
suggest you get the netCDF daily snapshot release, if you are building netcdf 
from source:

ftp://ftp.unidata.ucar.edu/pub/netcdf/snapshot/netcdf-4-daily.tar.gz

Thanks,

Ed

Ticket Details
===================
Ticket ID: NAZ-877935
Department: Support netCDF
Priority: Critical
Status: Closed