Changeset 605 for XIOS/branchs/xios-1.0/src/output/onetcdf4.cpp
- Timestamp:
- 06/03/15 15:06:24 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/branchs/xios-1.0/src/output/onetcdf4.cpp
r501 r605 13 13 (const StdString & filename, bool exist, const MPI_Comm * comm, bool multifile) 14 14 : path() 15 {16 this->wmpi = (comm != NULL) && !multifile;15 , wmpi(false) 16 { 17 17 this->initialize(filename, exist, comm,multifile); 18 18 } … … 31 31 (const StdString & filename, bool exist, const MPI_Comm * comm, bool multifile) 32 32 { 33 // Don't use parallel mode if there is only one process 34 if (comm) 35 { 36 int commSize = 0; 37 MPI_Comm_size(*comm, &commSize); 38 if (commSize <= 1) 39 comm = NULL; 40 } 41 wmpi = comm && !multifile; 42 33 43 if (!exist) 34 44 { 35 if (comm != NULL) 36 { 37 if (!multifile) (CNetCdfInterface::createPar(filename, NC_NETCDF4|NC_MPIIO, *comm, MPI_INFO_NULL, (this->ncidp))); 38 else (CNetCdfInterface::create(filename, NC_NETCDF4, this->ncidp)); 39 } 40 else (CNetCdfInterface::create(filename, NC_NETCDF4, this->ncidp)); 45 if (wmpi) 46 CNetCdfInterface::createPar(filename, NC_NETCDF4|NC_MPIIO, *comm, MPI_INFO_NULL, this->ncidp); 47 else 48 CNetCdfInterface::create(filename, NC_NETCDF4, this->ncidp); 41 49 } 42 50 else 43 51 { 44 if (comm != NULL) 45 { 46 if (!multifile) (CNetCdfInterface::openPar(filename, NC_NETCDF4|NC_MPIIO, *comm, MPI_INFO_NULL, this->ncidp)); 47 else (CNetCdfInterface::open(filename, NC_NETCDF4, this->ncidp)); 48 } 49 else (CNetCdfInterface::open(filename, NC_NETCDF4, this->ncidp)); 52 if (wmpi) 53 CNetCdfInterface::openPar(filename, NC_NETCDF4|NC_MPIIO, *comm, MPI_INFO_NULL, this->ncidp); 54 else 55 CNetCdfInterface::open(filename, NC_NETCDF4, this->ncidp); 50 56 } 51 57 }
Note: See TracChangeset
for help on using the changeset viewer.