From e4e294ae9344997998f2263136c27146436269c1 Mon Sep 17 00:00:00 2001 From: Ed Hartnett Date: Fri, 3 Jun 2011 13:58:39 +0000 Subject: [PATCH] make new parallel I/O flag requirement work with pnetcdf library --- libdispatch/parallel.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/libdispatch/parallel.c b/libdispatch/parallel.c index a44bcd8a5..fe4537203 100644 --- a/libdispatch/parallel.c +++ b/libdispatch/parallel.c @@ -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;