nfmpi_create with NF_CLOBBER
Wei-keng Liao
wkliao at ece.northwestern.edu
Sat Jun 9 23:08:03 CDT 2007
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