Changeset 1239


Ignore:
Timestamp:
08/08/17 20:21:43 (7 years ago)
Author:
mhnguyen
Message:

Correcting a minor bug on detecting server reading level

+) Reading server level should be 1 (for now). In the future, maybe level-2 server can be used
+) Correct nbReadSenders with the right ContextClient?

Test
+) On Curie
+) Work with toy

Location:
XIOS/dev/XIOS_DEV_CMIP6/src/node
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/XIOS_DEV_CMIP6/src/node/context.cpp

    r1237 r1239  
    558558        sendEnabledFieldsInFiles(this->enabledReadModeFiles); 
    559559 
    560       // We have all info of domain, axis and scalar, so send them 
     560      // Then, check whether we have domain_ref, axis_ref or scalar_ref attached to the enabled fields 
     561      // If any, so send them to server 
    561562       sendRefDomainsAxisScalars(this->enabledWriteModeFiles); 
    562563      if (!hasServer) 
    563564        sendRefDomainsAxisScalars(this->enabledReadModeFiles);         
    564565 
    565        // After that, send all grid (if any) 
     566       // Check whether enabled fields have grid_ref, if any, send this info to server 
    566567      sendRefGrid(this->enabledFiles); 
    567568      // This code may be useful in the future when we want to seperate completely read and write 
     
    569570      // if (!hasServer) 
    570571      //   sendRefGrid(this->enabledReadModeFiles); 
     572       
     573      // A grid of enabled fields composed of several components which must be checked then their 
     574      // checked attributes should be sent to server 
     575      sendGridComponentEnabledFieldsInFiles(this->enabledFiles); // This code can be seperated in two (one for reading, another for writing) 
    571576 
    572577       // We have a xml tree on the server side and now, it should be also processed 
    573        sendPostProcessing(); 
     578      sendPostProcessing(); 
    574579        
    575        sendGridEnabledFieldsInFiles(this->enabledWriteModeFiles);        
    576        if (!hasServer) 
     580      // Finally, we send information of grid itself to server  
     581      sendGridEnabledFieldsInFiles(this->enabledWriteModeFiles);        
     582      if (!hasServer) 
    577583        sendGridEnabledFieldsInFiles(this->enabledReadModeFiles);        
    578584     } 
     
    669675      for (unsigned int i = 0; i < this->enabledReadModeFiles.size(); ++i) 
    670676        (void)this->enabledReadModeFiles[i]->readAttributesOfEnabledFieldsInReadMode(); 
     677   } 
     678 
     679   void CContext::sendGridComponentEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles) 
     680   { 
     681     int size = activeFiles.size(); 
     682     for (int i = 0; i < size; ++i) 
     683     {        
     684       activeFiles[i]->sendGridComponentOfEnabledFields(); 
     685     } 
    671686   } 
    672687 
  • XIOS/dev/XIOS_DEV_CMIP6/src/node/context.hpp

    r1232 r1239  
    131131         void checkGridEnabledFields(); 
    132132         void checkGridEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles); 
    133          void sendGridEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles);          
     133         void sendGridEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles);   
     134         void sendGridComponentEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles)       ; 
    134135 
    135136//         std::map<int, StdSize> getAttributesBufferSize(std::map<int, StdSize>& maxEventSize); 
  • XIOS/dev/XIOS_DEV_CMIP6/src/node/field.cpp

    r1236 r1239  
    376376                  break; 
    377377                case RF_NODATA: 
    378                   msg << int(-2); 
     378                  msg << int(-2) << recvDataSrv; 
    379379                  break; 
    380380                case RF_EOF:                   
     
    797797   } 
    798798 
     799   void CField::sendGridComponentOfEnabledFields() 
     800   { 
     801      solveGridDomainAxisRef(true); 
     802      // solveCheckMaskIndex(true); 
     803   } 
     804 
    799805   void CField::sendGridOfEnabledFields() 
    800806   { 
    801       solveGridDomainAxisRef(true); 
     807      // solveGridDomainAxisRef(true); 
    802808      solveCheckMaskIndex(true); 
    803    } 
    804  
    805  
    806     void CField::solveOnlyReferenceEnabledField(bool doSending2Server) 
     809   }    
     810 
     811   void CField::solveOnlyReferenceEnabledField(bool doSending2Server) 
    807812   { 
    808813     CContext* context = CContext::getCurrent(); 
  • XIOS/dev/XIOS_DEV_CMIP6/src/node/field.hpp

    r1236 r1239  
    130130         void checkGridOfEnabledFields(); 
    131131         void sendGridOfEnabledFields(); 
     132         void sendGridComponentOfEnabledFields();    
    132133 
    133134         void buildFilterGraph(CGarbageCollector& gc, bool enableOutput); 
  • XIOS/dev/XIOS_DEV_CMIP6/src/node/file.cpp

    r1234 r1239  
    327327      // Done by classical server or secondary server 
    328328      // TODO: This condition should be changed soon. It only works with maximum number of level as 2 
    329       if (CServer::serverLevel == 0 || CServer::serverLevel == 2) 
     329      if (CServer::serverLevel == 0 || CServer::serverLevel == 1) 
    330330      { 
    331331        if (!mode.isEmpty() && mode.getValue() == mode_attr::read) 
     
    795795   } 
    796796 
     797   void CFile::sendGridComponentOfEnabledFields() 
     798   {  
     799     int size = this->enabledFields.size(); 
     800     for (int i = 0; i < size; ++i) 
     801     { 
     802       this->enabledFields[i]->sendGridComponentOfEnabledFields(); 
     803     } 
     804   } 
     805 
    797806   void CFile::sendGridOfEnabledFields() 
    798807   {  
  • XIOS/dev/XIOS_DEV_CMIP6/src/node/file.hpp

    r1232 r1239  
    116116         void checkGridOfEnabledFields(); 
    117117         void sendGridOfEnabledFields(); 
     118         void sendGridComponentOfEnabledFields();    
    118119 
    119120         // Add component into file 
  • XIOS/dev/XIOS_DEV_CMIP6/src/node/grid.cpp

    r1238 r1239  
    15411541    { 
    15421542      CContextServer* server = (!context->hasClient) ? context->server : context->serverPrimServer[p]; 
    1543       CContextClient* client = (!context->hasClient) ? context->client : context->clientPrimServer[p]; 
     1543      CContextClient* client = context->client;   //(!context->hasClient) ? context->client : context->clientPrimServer[p]; 
    15441544       
    15451545      int idx = 0, numElement = axis_domain_order.numElements(); 
Note: See TracChangeset for help on using the changeset viewer.