make new parallel I/O flag requirement work with pnetcdf library

This commit is contained in:
Ed Hartnett 2011-06-03 13:58:39 +00:00
parent 069574d842
commit e4e294ae93

View File

@ -23,8 +23,10 @@ nc_create_par(const char *path, int cmode, MPI_Comm comm,
MPI_Comm comm_c = 0;
MPI_Info info_c = 0;
/* One of these two parallel IO modes must be chosen by the user. */
if (!(cmode & NC_MPIIO || cmode & NC_MPIPOSIX))
/* One of these two parallel IO modes must be chosen by the user,
* or else pnetcdf must be in use. */
if (!(cmode & NC_MPIIO || cmode & NC_MPIPOSIX) &&
!(cmode & NC_PNETCDF))
return NC_EINVAL;
#ifdef HAVE_MPI_COMM_F2C
@ -51,8 +53,10 @@ nc_open_par(const char *path, int mode, MPI_Comm comm,
#else
NC_MPI_INFO mpi_data;
/* One of these two parallel IO modes must be chosen by the user. */
if (!(mode & NC_MPIIO || mode & NC_MPIPOSIX))
/* One of these two parallel IO modes must be chosen by the user,
* or else pnetcdf must be in use. */
if (!(mode & NC_MPIIO || mode & NC_MPIPOSIX) &&
!(mode & NC_PNETCDF))
return NC_EINVAL;
mpi_data.comm = comm;