Ignore:
Timestamp:
05/11/17 18:25:20 (7 years ago)
Author:
mhnguyen
Message:

Updating two-level server.
Each client now can play the role of server: It can forward data to other clients or write data like a server.
Each client must combine all data received from other client(s) before forward them or write them on files

+) Correct some bugs of exchange data_index in domain and axis
+) Reorder some functions in context.cpp to make sure that all necessary attributes are available before computing index
+) Add the mapping index for client to write data.

Test
+) On Curie
+) test_client and test_complete
+) Mode:

  • Only one level: Correct
  • Two levels: Work if using ddt (bug)

+) Only zoom is tested but other transformations should work
+) No reading test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_olga/src/node/grid.hpp

    r1099 r1129  
    140140         void computeIndexScalarGrid(); 
    141141         void computeCompressedIndex(); 
     142         void computeWrittenIndex(); 
    142143 
    143144         void solveDomainRef(bool checkAtt); 
     
    224225         std::vector<map<int,int> > nbSenders; 
    225226 
    226          map<int, CArray<size_t, 1> > outIndexFromClient, compressedOutIndexFromClient; 
     227         map<int, CArray<size_t, 1> > outIndexFromClient, compressedOutIndexFromClient, outGlobalIndexFromClient; 
     228 
     229         // A client receives global index from other clients (via recvIndex) 
     230         // then does mapping these index into local index of STORE_CLIENTINDEX 
     231         // In this way, store_clientIndex can be used as an input of a source filter 
     232         // Maybe we need a flag to determine whether a client wants to write. TODO 
     233         map<int, CArray<size_t, 1> > outLocalIndexStoreOnClient;  
     234 
     235         // If a client wants to write out data, it'll use this index. 
     236         // A client receives global index of data from other clients (via recvIndex), 
     237         // then does remapping these index into local index to WRITE into a file 
     238         CArray<size_t,1> localIndexToWriteOnClient, localIndexToWriteOnServer; 
     239 
    227240         CArray<size_t,1> indexFromClients; 
    228241         void checkMask(void); 
    229242         void createMask(void); 
    230          void modifyMask(const CArray<int,1>& indexToModify); 
     243         void modifyMask(const CArray<int,1>& indexToModify, bool valueToModify = false); 
     244         void modifyMaskSize(const std::vector<int>& newDimensionSize, bool newValue = false); 
    231245 
    232246         void computeGridGlobalDimension(const std::vector<CDomain*>& domains, 
     
    243257                          bool createMask = false); 
    244258        template<int N> 
    245         void modifyGridMask(CArray<bool,N>& gridMask, const CArray<int,1>& indexToModify); 
     259        void modifyGridMask(CArray<bool,N>& gridMask, const CArray<int,1>& indexToModify, bool valueToModify); 
     260 
     261        template<int N> 
     262        void modifyGridMaskSize(CArray<bool,N>& gridMask, const std::vector<int>& eachDimSize, bool newValue); 
    246263 
    247264        void setVirtualDomainGroup(CDomainGroup* newVDomainGroup); 
     
    285302        std::set<std::string> relFilesCompressed; 
    286303 
    287         bool isTransformed_; 
    288         bool isGenerated_; 
     304        bool isTransformed_, isGenerated_; 
     305        bool computedWrittenIndex_; 
    289306        std::vector<int> axisPositionInGrid_; 
    290307        CGridTransformation* transformations_; 
     
    416433   } 
    417434 
     435   template<int N> 
     436   void CGrid::modifyGridMaskSize(CArray<bool,N>& gridMask, 
     437                                  const std::vector<int>& eachDimSize, 
     438                                  bool newValue) 
     439   { 
     440      if (N != eachDimSize.size()) 
     441      { 
     442        // ERROR("CGrid::modifyGridMaskSize(CArray<bool,N>& gridMask, 
     443        //                                  const std::vector<int>& eachDimSize, 
     444        //                                  bool newValue)", 
     445        //       << "Dimension size of the mask is different from input dimension size." << std::endl 
     446        //       << "Mask dimension is " << N << "." << std::endl 
     447        //       << "Input dimension is " << eachDimSize.size() << "." << std::endl 
     448        //       << "Grid = " << this->GetName()) 
     449      } 
     450      CArrayBoolTraits<CArray<bool,N> >::resizeArray(gridMask,eachDimSize); 
     451      gridMask = newValue; 
     452   } 
     453                                  
     454 
    418455   /*! 
    419456     Modify the current mask of grid, the local index to be modified will take value false 
     
    422459   */ 
    423460   template<int N> 
    424    void CGrid::modifyGridMask(CArray<bool,N>& gridMask, const CArray<int,1>& indexToModify) 
    425    { 
    426      bool valueToModify = false; 
     461   void CGrid::modifyGridMask(CArray<bool,N>& gridMask, const CArray<int,1>& indexToModify, bool valueToModify) 
     462   {      
    427463     int num = indexToModify.numElements(); 
    428464     for (int idx = 0; idx < num; ++idx) 
Note: See TracChangeset for help on using the changeset viewer.