Changeset 736 for XIOS/trunk/src
- Timestamp:
- 10/14/15 13:58:26 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/io/inetcdf4.cpp
r686 r736 7 7 { 8 8 CINetCDF4::CINetCDF4(const StdString& filename, const MPI_Comm* comm /*= NULL*/, bool multifile /*= true*/) 9 : mpi(comm != NULL && !multifile) 10 { 11 if (comm != NULL) 12 { 13 if (!multifile) CNetCdfInterface::openPar(filename, NC_NOWRITE, *comm, MPI_INFO_NULL, this->ncidp); 14 else CNetCdfInterface::open(filename, NC_NOWRITE, this->ncidp); 15 } 16 else CNetCdfInterface::open(filename, NC_NOWRITE, this->ncidp); 9 { 10 // Don't use parallel mode if there is only one process 11 if (comm) 12 { 13 int commSize = 0; 14 MPI_Comm_size(*comm, &commSize); 15 if (commSize <= 1) 16 comm = NULL; 17 } 18 mpi = comm && !multifile; 19 20 // The file format will be detected automatically by NetCDF, it is safe to always set NC_MPIIO 21 // even if Parallel NetCDF ends up being used. 22 if (mpi) 23 CNetCdfInterface::openPar(filename, NC_NOWRITE | NC_MPIIO, *comm, MPI_INFO_NULL, this->ncidp); 24 else 25 CNetCdfInterface::open(filename, NC_NOWRITE, this->ncidp); 17 26 } 18 27
Note: See TracChangeset
for help on using the changeset viewer.