Changeset 8f0a211 for GenericIO.h


Ignore:
Timestamp:
04/12/16 19:18:46 (8 years ago)
Author:
Hal Finkel <hfinkel@…>
Branches:
master, pympi
Children:
14e73bb
Parents:
a4fee13
git-author:
Hal Finkel <hfinkel@…> (04/12/16 19:18:46)
git-committer:
Hal Finkel <hfinkel@…> (04/12/16 19:18:46)
Message:

Add redistribution support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GenericIO.h

    ra4fee13 r8f0a211  
    188188  GenericIO(const MPI_Comm &C, const std::string &FN, unsigned FIOT = -1) 
    189189    : NElems(0), FileIOType(FIOT == (unsigned) -1 ? DefaultFileIOType : FIOT), 
    190       Partition(DefaultPartition), Comm(C), FileName(FN), SplitComm(MPI_COMM_NULL) { 
     190      Partition(DefaultPartition), Comm(C), FileName(FN), Redistributing(false), 
     191      DisableCollErrChecking(false), SplitComm(MPI_COMM_NULL) { 
    191192    std::fill(PhysOrigin, PhysOrigin + 3, 0.0); 
    192193    std::fill(PhysScale,  PhysScale + 3, 0.0); 
     
    195196  GenericIO(const std::string &FN, unsigned FIOT = -1) 
    196197    : NElems(0), FileIOType(FIOT == (unsigned) -1 ? DefaultFileIOType : FIOT), 
    197       Partition(DefaultPartition), FileName(FN) { 
     198      Partition(DefaultPartition), FileName(FN), Redistributing(false), 
     199      DisableCollErrChecking(false) { 
    198200    std::fill(PhysOrigin, PhysOrigin + 3, 0.0); 
    199201    std::fill(PhysScale,  PhysScale + 3, 0.0); 
     
    264266#endif 
    265267 
     268  enum MismatchBehavior { 
     269    MismatchAllowed, 
     270    MismatchDisallowed, 
     271    MismatchRedistribute 
     272  }; 
     273 
    266274  // Reading 
    267   void openAndReadHeader(bool MustMatch = true, int EffRank = -1, 
    268                          bool CheckPartMap = true); 
     275  void openAndReadHeader(MismatchBehavior MB = MismatchDisallowed, 
     276                         int EffRank = -1, bool CheckPartMap = true); 
    269277 
    270278  int readNRanks(); 
     
    280288 
    281289  int getNumberOfVariables() { return this->Vars.size(); }; 
    282  
    283290 
    284291  void getVariableInfo(std::vector<VariableInfo> &VI); 
     
    330337 
    331338  template <bool IsBigEndian> 
    332   void readHeaderLeader(void *GHPtr, bool MustMatch, int SplitNRanks, 
    333                         std::string &LocalFileName, uint64_t &HeaderSize, 
    334                         std::vector<char> &Header); 
     339  void readHeaderLeader(void *GHPtr, MismatchBehavior MB, int Rank, int NRanks, 
     340                        int SplitNRanks, std::string &LocalFileName, 
     341                        uint64_t &HeaderSize, std::vector<char> &Header); 
    335342 
    336343  template <bool IsBigEndian> 
     
    358365  void readCoords(int Coords[3], int EffRank); 
    359366 
    360   template <bool IsBigEndian> 
    361   void readData(int EffRank, bool PrintStats, bool CollStats); 
     367  void readData(int EffRank, size_t RowOffset, int Rank, 
     368                uint64_t &TotalReadSize, int NErrs[3]); 
     369 
     370  template <bool IsBigEndian> 
     371  void readData(int EffRank, size_t RowOffset, 
     372                int Rank, uint64_t &TotalReadSize, int NErrs[3]); 
    362373 
    363374  template <bool IsBigEndian> 
     
    384395  static std::size_t CollectiveMPIIOThreshold; 
    385396#endif 
     397 
     398  // When redistributing, the rank blocks which this process should read. 
     399  bool Redistributing, DisableCollErrChecking; 
     400  std::vector<int> SourceRanks; 
    386401 
    387402  std::vector<int> RankMap; 
Note: See TracChangeset for help on using the changeset viewer.