nfmpi_create with NF_CLOBBER

Mark Taylor mataylo at sandia.gov
Sun Jun 10 13:58:32 CDT 2007


Thanks for posting this.  I made that change to my local copy.  It is
going to save me thousands of warning lines clogging my log files!

Mark



On Sat, 2007-06-09 at 23:08 -0500, Wei-keng Liao wrote:
> I found that in mpincio.c, function ncmpiio_create() may cause a problem.
> If the file does not exist, MPI_File_delete() will still be called.
> 
> I suggest:
> 1. remove the else block of "if (fIsSet(ioflags, NC_NOCLOBBER))"
> 2. add a MPI_File_set_size() after MPI_File_open() to set the
>     file size to zero, if NF_CLOBBER or NC_CLOBBER is used.
> 
> Wei-keng
> 
> 
> On Sat, 9 Jun 2007, Wei-keng Liao wrote:
> 
> >
> > As defined in netCDF, when NF_CLOBBER, NC_CLOBBER is used in the cmode 
> > argument of nfmpi_create(), the file will be overwritten if it exists.
> >
> > In mpincio.c,, function ncmpiio_create, I can see that in this case, the file 
> > is first deleted by MPI_File_delete() and later created by MPI_File_open().
> >
> > Since MPI_File_delete() is non-collective, all MPI processes will try to 
> > delete the file simultaneously, which results in only one success and fail 
> > for all others.
> >
> > Shouldn't it be done by just having one process call delete and others 
> > waiting at a MPI_Barrier()?
> >
> >
> > Wei-keng
> >
> 
> 





More information about the parallel-netcdf mailing list