Changeset 1485


Ignore:
Timestamp:
04/17/18 11:55:51 (3 years ago)
Author:
oabramkina
Message:

Enforcing sequential I/O on the client side during reading of metadata by client processes. Parallel I/O can still be used in this case via setting file attribute "read_metadata_par" to true.

Location:
XIOS/dev/XIOS_DEV_CMIP6/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/XIOS_DEV_CMIP6/src/config/file_attribute.conf

    r1201 r1485  
    2121DECLARE_ATTRIBUTE(bool,      append) 
    2222DECLARE_ENUM2(mode,          read, write) 
     23DECLARE_ATTRIBUTE(bool,      read_metadata_par) 
    2324DECLARE_ENUM7(time_counter,  centered, instant, record, exclusive, centered_exclusive, instant_exclusive, none) 
    2425DECLARE_ATTRIBUTE(StdString, time_counter_name) 
  • XIOS/dev/XIOS_DEV_CMIP6/src/io/inetcdf4.cpp

    r1447 r1485  
    77namespace xios 
    88{ 
    9   CINetCDF4::CINetCDF4(const StdString& filename, const MPI_Comm* comm /*= NULL*/, bool multifile /*= true*/, const StdString& timeCounterName /*= "time_counter"*/) 
     9  CINetCDF4::CINetCDF4(const StdString& filename, const MPI_Comm* comm /*= NULL*/, bool multifile /*= true*/, 
     10                       bool readMetaDataPar /*= false*/, const StdString& timeCounterName /*= "time_counter"*/) 
    1011  { 
    1112    // Don't use parallel mode if there is only one process 
     
    1718        comm = NULL; 
    1819    } 
    19     mpi = comm && !multifile; 
     20    mpi = comm && !multifile && readMetaDataPar; 
    2021 
    2122    // The file format will be detected automatically by NetCDF, it is safe to always set NC_MPIIO 
  • XIOS/dev/XIOS_DEV_CMIP6/src/io/inetcdf4.hpp

    r1445 r1485  
    2323      /// Constructors /// 
    2424      CINetCDF4(const StdString& filename, const MPI_Comm* comm = NULL, bool multifile = true, 
    25                 const StdString& timeCounterName = "time_counter"); 
     25                bool readMetaDataPar = false, const StdString& timeCounterName = "time_counter"); 
     26 
    2627      CINetCDF4(const CINetCDF4& inetcdf4);       // Not implemented. 
    2728      CINetCDF4(const CINetCDF4* const inetcdf4); // Not implemented. 
  • XIOS/dev/XIOS_DEV_CMIP6/src/io/nc4_data_input.cpp

    r1479 r1485  
    1010namespace xios 
    1111{ 
    12   CNc4DataInput::CNc4DataInput(const StdString& filename, MPI_Comm comm_file, bool multifile, bool isCollective /*= true*/, const StdString& timeCounterName /*= "time_counter"*/) 
     12  CNc4DataInput::CNc4DataInput(const StdString& filename, MPI_Comm comm_file, bool multifile, bool isCollective /*= true*/, 
     13                               bool readMetaDataPar /*= false*/, const StdString& timeCounterName /*= "time_counter"*/) 
    1314    : SuperClass() 
    14     , SuperClassWriter(filename, &comm_file, multifile, timeCounterName) 
     15    , SuperClassWriter(filename, &comm_file, multifile, readMetaDataPar, timeCounterName) 
    1516    , comm_file(comm_file) 
    1617    , filename(filename) 
  • XIOS/dev/XIOS_DEV_CMIP6/src/io/nc4_data_input.hpp

    r967 r1485  
    2424    /// Constructors /// 
    2525    CNc4DataInput(const StdString& filename, MPI_Comm comm_file, bool multifile, bool isCollective = true, 
    26                   const StdString& timeCounterName = "time_counter"); 
     26                  bool readMetaDataPar = false, const StdString& timeCounterName = "time_counter"); 
    2727    CNc4DataInput(const CNc4DataInput& dataInput);       // Not implemented. 
    2828    CNc4DataInput(const CNc4DataInput* const dataInput); // Not implemented. 
  • XIOS/dev/XIOS_DEV_CMIP6/src/node/file.cpp

    r1405 r1485  
    657657 
    658658      bool isCollective = par_access.isEmpty() || par_access == par_access_attr::collective; 
     659      bool readMetaDataPar = true; 
     660      if (!context->hasServer) readMetaDataPar = (read_metadata_par.isEmpty()) ? false : read_metadata_par; 
    659661 
    660662      if (isOpen) data_out->closeFile(); 
    661       if (time_counter_name.isEmpty()) data_in = shared_ptr<CDataInput>(new CNc4DataInput(oss.str(), readComm, multifile, isCollective)); 
    662       else data_in = shared_ptr<CDataInput>(new CNc4DataInput(oss.str(), readComm, multifile, isCollective, time_counter_name)); 
     663      if (time_counter_name.isEmpty()) data_in = shared_ptr<CDataInput>(new CNc4DataInput(oss.str(), readComm, multifile, isCollective, readMetaDataPar)); 
     664      else data_in = shared_ptr<CDataInput>(new CNc4DataInput(oss.str(), readComm, multifile, isCollective, readMetaDataPar, time_counter_name)); 
    663665      isOpen = true; 
    664666    } 
Note: See TracChangeset for help on using the changeset viewer.