Ignore:
Timestamp:
01/31/19 12:12:52 (5 years ago)
Author:
yushan
Message:

branch merged with trunk @1645. arch file (ep&mpi) added for ADA

File:
1 edited

Legend:

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

    r1628 r1646  
    2121#include "distribute_file_server2.hpp" 
    2222 
     23#ifdef _usingEP 
    2324using namespace ep_lib; 
     25#endif 
    2426 
    2527namespace xios { 
     
    3537      , idServer_(), client(0), server(0) 
    3638      , allProcessed(false), countChildCtx_(0) 
     39 
    3740   { /* Ne rien faire de plus */ } 
    3841 
     
    6770   */ 
    6871   CContextGroup* CContext::getRoot(void) 
     72   TRY 
    6973   { 
    7074      if(root_ptr == 0) root_ptr = new std::shared_ptr<CContextGroup>(new CContextGroup(xml::CXMLNode::GetRootName())); 
    7175      return root_ptr->get(); 
    7276   } 
     77   CATCH 
    7378 
    7479   //---------------------------------------------------------------- 
     
    7984   */ 
    8085   std::shared_ptr<CCalendar> CContext::getCalendar(void) const 
     86   TRY 
    8187   { 
    8288      return (this->calendar); 
    8389   } 
     90   CATCH 
    8491 
    8592   //---------------------------------------------------------------- 
     
    9097   */ 
    9198   void CContext::setCalendar(std::shared_ptr<CCalendar> newCalendar) 
     99   TRY 
    92100   { 
    93101      this->calendar = newCalendar; 
    94102   } 
     103   CATCH_DUMP_ATTR 
    95104 
    96105   //---------------------------------------------------------------- 
     
    100109   */ 
    101110   void CContext::parse(xml::CXMLNode & node) 
     111   TRY 
    102112   { 
    103113      CContext::SuperClass::parse(node); 
     
    154164      } 
    155165   } 
     166   CATCH_DUMP_ATTR 
    156167 
    157168   //---------------------------------------------------------------- 
    158169   //! Show tree structure of context 
    159170   void CContext::ShowTree(StdOStream & out) 
     171   TRY 
    160172   { 
    161173      StdString currentContextId = CContext::getCurrent() -> getId(); 
     
    178190      CContext::setCurrent(currentContextId); 
    179191   } 
    180  
     192   CATCH 
    181193 
    182194   //---------------------------------------------------------------- 
     
    184196   //! Convert context object into string (to print) 
    185197   StdString CContext::toString(void) const 
     198   TRY 
    186199   { 
    187200      StdOStringStream oss; 
     
    203216 
    204217      } 
    205  
    206218      oss << "</" << CContext::GetName() << " >"; 
    207  
    208219      return (oss.str()); 
    209220   } 
     221   CATCH 
    210222 
    211223   //---------------------------------------------------------------- 
     
    218230   */ 
    219231   void CContext::solveDescInheritance(bool apply, const CAttributeMap * const UNUSED(parent)) 
     232   TRY 
    220233   { 
    221234#define DECLARE_NODE(Name_, name_)    \ 
     
    225238#include "node_type.conf" 
    226239   } 
     240   CATCH_DUMP_ATTR 
    227241 
    228242   //---------------------------------------------------------------- 
     
    230244   //! Verify if all root definition in the context have child. 
    231245   bool CContext::hasChild(void) const 
     246   TRY 
    232247   { 
    233248      return ( 
     
    238253      false); 
    239254} 
     255   CATCH 
    240256 
    241257   //---------------------------------------------------------------- 
    242258 
    243259   void CContext::CleanTree(void) 
     260   TRY 
    244261   { 
    245262#define DECLARE_NODE(Name_, name_) C##Name_##Definition::ClearAllAttributes(); 
     
    247264#include "node_type.conf" 
    248265   } 
     266   CATCH 
     267 
    249268   ///--------------------------------------------------------------- 
    250269 
    251270   //! Initialize client side 
    252271   void CContext::initClient(ep_lib::MPI_Comm intraComm, ep_lib::MPI_Comm interComm, CContext* cxtServer /*= 0*/) 
     272   TRY 
    253273   { 
    254274 
     
    299319     } 
    300320   } 
     321   CATCH_DUMP_ATTR 
    301322 
    302323   /*! 
     
    307328  */ 
    308329   void CContext::setClientServerBuffer(CContextClient* contextClient, bool bufferForWriting) 
     330   TRY 
    309331   { 
    310332      // Estimated minimum event size for small events (10 is an arbitrary constant just for safety) 
     
    353375     } 
    354376     contextClient->setBufferSize(bufferSize, maxEventSize); 
    355  
    356    } 
     377   } 
     378   CATCH_DUMP_ATTR 
    357379 
    358380   //! Verify whether a context is initialized 
    359381   bool CContext::isInitialized(void) 
     382   TRY 
    360383   { 
    361384     return hasClient; 
    362385   } 
     386   CATCH_DUMP_ATTR 
    363387 
    364388   void CContext::initServer(ep_lib::MPI_Comm intraComm, ep_lib::MPI_Comm interComm, CContext* cxtClient /*= 0*/) 
     389   TRY 
    365390   { 
    366391     hasServer=true; 
     
    395420     client = new CContextClient(this,intraCommClient,interCommClient, cxtClient); 
    396421   } 
     422   CATCH_DUMP_ATTR 
    397423 
    398424   //! Try to send the buffers and receive possible answers 
    399425  bool CContext::checkBuffersAndListen(bool enableEventsProcessing /*= true*/) 
     426  TRY 
    400427  { 
    401428    bool clientReady, serverFinished; 
     
    435462    } 
    436463  } 
     464   CATCH_DUMP_ATTR 
    437465 
    438466   //! Terminate a context 
    439467   void CContext::finalize(void) 
     468   TRY 
    440469   { 
    441470      if (hasClient && !hasServer) // For now we only use server level 1 to read data 
     
    481510 
    482511         #pragma omp critical (_output) 
    483          info(20)<<"CContext: Context <"<<getId()<<"> is finalized."<<endl; 
     512         { 
     513          info(20)<<"CContext: Context <"<<getId()<<"> is finalized."<<endl; 
     514         } 
    484515       } 
    485516     } 
     
    497528         // Blocking send of context finalize message to its client (e.g. primary server or model) 
    498529         #pragma omp critical (_output) 
    499          info(100)<<"DEBUG: context "<<getId()<<" Send client finalize<<"<<endl ; 
     530         { 
     531          info(100)<<"DEBUG: context "<<getId()<<" Send client finalize<<"<<endl ; 
     532         } 
    500533         client->finalize(); 
    501534         bool bufferReleased; 
     
    525558 
    526559         #pragma omp critical (_output) 
    527          info(20)<<"CContext: Context <"<<getId()<<"> is finalized."<<endl; 
     560         { 
     561          info(20)<<"CContext: Context <"<<getId()<<"> is finalized."<<endl; 
     562         } 
    528563       } 
    529564 
     
    531566     } 
    532567   } 
     568   CATCH_DUMP_ATTR 
    533569 
    534570   //! Free internally allocated communicators 
    535571   void CContext::freeComms(void) 
     572   TRY 
    536573   { 
    537574     for (std::list<ep_lib::MPI_Comm>::iterator it = comms.begin(); it != comms.end(); ++it) 
     
    539576     comms.clear(); 
    540577   } 
     578   CATCH_DUMP_ATTR 
    541579 
    542580   //! Deallocate buffers allocated by clientContexts 
    543581   void CContext::releaseClientBuffers(void) 
     582   TRY 
    544583   { 
    545584     client->releaseBuffers(); 
     
    547586       clientPrimServer[i]->releaseBuffers(); 
    548587   } 
     588   CATCH_DUMP_ATTR 
    549589 
    550590   void CContext::postProcessingGlobalAttributes() 
     591   TRY 
    551592   { 
    552593     if (allProcessed) return;   
     
    612653     allProcessed = true; 
    613654   } 
     655   CATCH_DUMP_ATTR 
    614656 
    615657   void CContext::sendPostProcessingGlobalAttributes() 
     658   TRY 
    616659   { 
    617660      // Use correct context client to send message 
     
    638681     } 
    639682   } 
     683   CATCH_DUMP_ATTR 
    640684 
    641685   void CContext::recvPostProcessingGlobalAttributes(CEventServer& event) 
     686   TRY 
    642687   { 
    643688      CBufferIn* buffer=event.subEvents.begin()->buffer; 
     
    646691      get(id)->recvPostProcessingGlobalAttributes(*buffer); 
    647692   } 
     693   CATCH 
    648694 
    649695   void CContext::recvPostProcessingGlobalAttributes(CBufferIn& buffer) 
     696   TRY 
    650697   {       
    651698      postProcessingGlobalAttributes(); 
    652699   } 
     700   CATCH_DUMP_ATTR 
    653701 
    654702   /*! 
     
    661709   and the active fields (fields will be written onto active files) 
    662710   */ 
     711 
    663712   void CContext::closeDefinition(void) 
     713   TRY 
    664714   { 
    665715    CTimer::get("Context : close definition").resume() ; 
     
    692742    CTimer::get("Context : close definition").suspend() ; 
    693743   } 
     744   CATCH_DUMP_ATTR 
    694745 
    695746   void CContext::findAllEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles) 
     747   TRY 
    696748   { 
    697749     for (unsigned int i = 0; i < activeFiles.size(); i++) 
    698750     (void)activeFiles[i]->getEnabledFields(); 
    699751   } 
     752   CATCH_DUMP_ATTR 
    700753 
    701754   void CContext::readAttributesOfEnabledFieldsInReadModeFiles() 
     755   TRY 
    702756   { 
    703757      for (unsigned int i = 0; i < this->enabledReadModeFiles.size(); ++i) 
    704758        (void)this->enabledReadModeFiles[i]->readAttributesOfEnabledFieldsInReadMode(); 
    705759   } 
     760   CATCH_DUMP_ATTR 
    706761 
    707762   void CContext::sendGridComponentEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles) 
     763   TRY 
    708764   { 
    709765     int size = activeFiles.size(); 
     
    713769     } 
    714770   } 
     771   CATCH_DUMP_ATTR 
    715772 
    716773   /*! 
     
    719776   */ 
    720777   void CContext::sendGridEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles) 
     778   TRY 
    721779   { 
    722780     int size = activeFiles.size(); 
     
    726784     } 
    727785   } 
     786   CATCH_DUMP_ATTR 
    728787 
    729788   void CContext::checkGridEnabledFields() 
     789   TRY 
    730790   { 
    731791     int size = enabledFiles.size(); 
     
    735795     } 
    736796   } 
     797   CATCH_DUMP_ATTR 
    737798 
    738799   /*! 
     
    741802   */ 
    742803   void CContext::checkGridEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles) 
     804   TRY 
    743805   { 
    744806     int size = activeFiles.size(); 
     
    748810     } 
    749811   } 
     812   CATCH_DUMP_ATTR 
    750813 
    751814    /*! 
     
    755818   */ 
    756819   void CContext::solveOnlyRefOfEnabledFields(bool sendToServer) 
     820   TRY 
    757821   { 
    758822     int size = this->enabledFiles.size(); 
     
    767831     } 
    768832   } 
     833   CATCH_DUMP_ATTR 
    769834 
    770835    /*! 
     
    775840   */ 
    776841   void CContext::solveAllRefOfEnabledFieldsAndTransform(bool sendToServer) 
     842   TRY 
    777843   { 
    778844     int size = this->enabledFiles.size(); 
     
    782848     } 
    783849   } 
     850   CATCH_DUMP_ATTR 
    784851 
    785852   void CContext::buildFilterGraphOfEnabledFields() 
     853   TRY 
    786854   { 
    787855     int size = this->enabledFiles.size(); 
     
    791859     } 
    792860   } 
     861   CATCH_DUMP_ATTR 
    793862 
    794863   void CContext::postProcessFilterGraph() 
     864   TRY 
    795865   { 
    796866     int size = enabledFiles.size(); 
     
    800870     } 
    801871   } 
     872   CATCH_DUMP_ATTR 
    802873 
    803874   void CContext::startPrefetchingOfEnabledReadModeFiles() 
     875   TRY 
    804876   { 
    805877     int size = enabledReadModeFiles.size(); 
     
    809881     } 
    810882   } 
     883   CATCH_DUMP_ATTR 
    811884 
    812885   void CContext::doPreTimestepOperationsForEnabledReadModeFiles() 
     886   TRY 
    813887   { 
    814888     int size = enabledReadModeFiles.size(); 
     
    818892     } 
    819893   } 
     894   CATCH_DUMP_ATTR 
    820895 
    821896   void CContext::doPostTimestepOperationsForEnabledReadModeFiles() 
     897   TRY 
    822898   { 
    823899     int size = enabledReadModeFiles.size(); 
     
    827903     } 
    828904   } 
     905   CATCH_DUMP_ATTR 
    829906 
    830907  void CContext::findFieldsWithReadAccess(void) 
     908  TRY 
    831909  { 
    832910    fieldsWithReadAccess.clear(); 
     
    842920    } 
    843921  } 
     922  CATCH_DUMP_ATTR 
    844923 
    845924  void CContext::solveAllRefOfFieldsWithReadAccess() 
     925  TRY 
    846926  { 
    847927    for (size_t i = 0; i < fieldsWithReadAccess.size(); ++i) 
    848928      fieldsWithReadAccess[i]->solveAllReferenceEnabledField(false); 
    849929  } 
     930  CATCH_DUMP_ATTR 
    850931 
    851932  void CContext::buildFilterGraphOfFieldsWithReadAccess() 
     933  TRY 
    852934  { 
    853935    for (size_t i = 0; i < fieldsWithReadAccess.size(); ++i) 
    854936      fieldsWithReadAccess[i]->buildFilterGraph(garbageCollector, true); 
    855937  } 
     938  CATCH_DUMP_ATTR 
    856939 
    857940   void CContext::solveAllInheritance(bool apply) 
     941   TRY 
    858942   { 
    859943     // Résolution des héritages descendants (càd des héritages de groupes) 
     
    878962 
    879963   } 
     964  CATCH_DUMP_ATTR 
    880965 
    881966   void CContext::findEnabledFiles(void) 
     967   TRY 
    882968   { 
    883969      const std::vector<CFile*> allFiles = CFile::getAll(); 
     
    9281014 
    9291015   } 
     1016   CATCH_DUMP_ATTR 
    9301017 
    9311018   void CContext::distributeFiles(void) 
     1019   TRY 
    9321020   { 
    9331021     bool distFileMemory=false ; 
     
    9371025     else distributeFileOverBandwith() ; 
    9381026   } 
    939  
     1027   CATCH_DUMP_ATTR 
    9401028 
    9411029   void CContext::distributeFileOverBandwith(void) 
     1030   TRY 
    9421031   { 
    9431032     double eps=std::numeric_limits<double>::epsilon()*10 ; 
     
    10091098       { 
    10101099         #pragma omp critical (_output) 
    1011          info(30)<<"Load Balancing for servers (perfect=1) : "<<it->second<<" :  ratio "<<it->first*1./dataPerPool<<endl ; 
     1100         { 
     1101          info(30)<<"Load Balancing for servers (perfect=1) : "<<it->second<<" :  ratio "<<it->first*1./dataPerPool<<endl ; 
     1102         } 
    10121103       } 
    10131104 
     
    10231114     } 
    10241115   } 
     1116   CATCH_DUMP_ATTR 
    10251117 
    10261118   void CContext::distributeFileOverMemoryBandwith(void) 
     1119   TRY 
    10271120   { 
    10281121     // If primary server 
     
    11021195       { 
    11031196         #pragma omp critical (_output) 
    1104          info(100)<<"Pool server level2 "<<i<<"   assigned file bandwith "<<bandwithSize[i]*86400.*4./1024/1024.<<" Mb / days"<<endl ; 
     1197         { 
     1198          info(100)<<"Pool server level2 "<<i<<"   assigned file bandwith "<<bandwithSize[i]*86400.*4./1024/1024.<<" Mb / days"<<endl ; 
     1199         } 
    11051200       } 
    11061201       for (int i = 0; i < nbPools; ++i) 
    11071202       { 
    11081203         #pragma omp critical (_output) 
    1109          info(100)<<"Pool server level2 "<<i<<"   assigned grid memory "<<memorySize[i]*100/1024./1024.<<" Mb"<<endl ; 
     1204         { 
     1205          info(100)<<"Pool server level2 "<<i<<"   assigned grid memory "<<memorySize[i]*100/1024./1024.<<" Mb"<<endl ; 
     1206         } 
    11101207       } 
    11111208 
     
    11221219   } 
    11231220} 
    1124  
    1125  
     1221   CATCH_DUMP_ATTR 
    11261222 
    11271223   /*! 
     
    11291225   */ 
    11301226   void CContext::findEnabledWriteModeFiles(void) 
     1227   TRY 
    11311228   { 
    11321229     int size = this->enabledFiles.size(); 
     
    11381235     } 
    11391236   } 
     1237   CATCH_DUMP_ATTR 
    11401238 
    11411239   /*! 
     
    11431241   */ 
    11441242   void CContext::findEnabledReadModeFiles(void) 
     1243   TRY 
    11451244   { 
    11461245     int size = this->enabledFiles.size(); 
     
    11511250     } 
    11521251   } 
     1252   CATCH_DUMP_ATTR 
    11531253 
    11541254   void CContext::closeAllFile(void) 
     1255   TRY 
    11551256   { 
    11561257     std::vector<CFile*>::const_iterator 
     
    11601261     { 
    11611262       #pragma omp critical (_output) 
    1162        info(30)<<"Closing File : "<<(*it)->getId()<<endl; 
     1263       { 
     1264        info(30)<<"Closing File : "<<(*it)->getId()<<endl; 
     1265       } 
    11631266       (*it)->close(); 
    11641267     } 
    11651268   } 
     1269   CATCH_DUMP_ATTR 
    11661270 
    11671271   /*! 
     
    11731277   */ 
    11741278   bool CContext::dispatchEvent(CEventServer& event) 
     1279   TRY 
    11751280   { 
    11761281 
     
    12141319      } 
    12151320   } 
     1321   CATCH 
    12161322 
    12171323   //! Client side: Send a message to server to make it close 
    12181324   void CContext::sendCloseDefinition(void) 
     1325   TRY 
    12191326   { 
    12201327     // Use correct context client to send message 
     
    12391346     } 
    12401347   } 
     1348   CATCH_DUMP_ATTR 
    12411349 
    12421350   //! Server side: Receive a message of client announcing a context close 
    12431351   void CContext::recvCloseDefinition(CEventServer& event) 
     1352   TRY 
    12441353   { 
    12451354      CBufferIn* buffer=event.subEvents.begin()->buffer; 
     
    12481357      get(id)->closeDefinition(); 
    12491358   } 
     1359   CATCH 
    12501360 
    12511361   //! Client side: Send a message to update calendar in each time step 
    12521362   void CContext::sendUpdateCalendar(int step) 
     1363   TRY 
    12531364   { 
    12541365     // Use correct context client to send message 
     
    12741385     } 
    12751386   } 
     1387   CATCH_DUMP_ATTR 
    12761388 
    12771389   //! Server side: Receive a message of client annoucing calendar update 
    12781390   void CContext::recvUpdateCalendar(CEventServer& event) 
     1391   TRY 
    12791392   { 
    12801393      CBufferIn* buffer=event.subEvents.begin()->buffer; 
     
    12831396      get(id)->recvUpdateCalendar(*buffer); 
    12841397   } 
     1398   CATCH 
    12851399 
    12861400   //! Server side: Receive a message of client annoucing calendar update 
    12871401   void CContext::recvUpdateCalendar(CBufferIn& buffer) 
     1402   TRY 
    12881403   { 
    12891404      int step; 
     
    12951410      } 
    12961411   } 
     1412   CATCH_DUMP_ATTR 
    12971413 
    12981414   //! Client side: Send a message to create header part of netcdf file 
    12991415   void CContext::sendCreateFileHeader(void) 
     1416   TRY 
    13001417   { 
    13011418     // Use correct context client to send message 
     
    13221439     } 
    13231440   } 
     1441   CATCH_DUMP_ATTR 
    13241442 
    13251443   //! Server side: Receive a message of client annoucing the creation of header part of netcdf file 
    13261444   void CContext::recvCreateFileHeader(CEventServer& event) 
     1445   TRY 
    13271446   { 
    13281447      CBufferIn* buffer=event.subEvents.begin()->buffer; 
     
    13311450      get(id)->recvCreateFileHeader(*buffer); 
    13321451   } 
     1452   CATCH 
    13331453 
    13341454   //! Server side: Receive a message of client annoucing the creation of header part of netcdf file 
    13351455   void CContext::recvCreateFileHeader(CBufferIn& buffer) 
     1456   TRY 
    13361457   { 
    13371458      if (!hasClient && hasServer)  
    13381459        createFileHeader(); 
    13391460   } 
     1461   CATCH_DUMP_ATTR 
    13401462 
    13411463   //! Client side: Send a message to do some post processing on server 
    13421464   void CContext::sendProcessingGridOfEnabledFields() 
     1465   TRY 
    13431466   { 
    13441467      // Use correct context client to send message 
     
    13641487     } 
    13651488   } 
     1489   CATCH_DUMP_ATTR 
    13661490 
    13671491   //! Server side: Receive a message to do some post processing 
    13681492   void CContext::recvProcessingGridOfEnabledFields(CEventServer& event) 
     1493   TRY 
    13691494   { 
    13701495      CBufferIn* buffer=event.subEvents.begin()->buffer; 
     
    13721497      *buffer>>id;       
    13731498   } 
     1499   CATCH 
    13741500 
    13751501   //! Client side: Send a message to do some post processing on server 
    13761502   void CContext::sendPostProcessing() 
     1503   TRY 
    13771504   { 
    13781505      // Use correct context client to send message 
     
    13981525     } 
    13991526   } 
     1527   CATCH_DUMP_ATTR 
    14001528 
    14011529   //! Server side: Receive a message to do some post processing 
    14021530   void CContext::recvPostProcessing(CEventServer& event) 
     1531   TRY 
    14031532   { 
    14041533      CBufferIn* buffer=event.subEvents.begin()->buffer; 
     
    14071536      get(id)->recvPostProcessing(*buffer); 
    14081537   } 
     1538   CATCH 
    14091539 
    14101540   //! Server side: Receive a message to do some post processing 
    14111541   void CContext::recvPostProcessing(CBufferIn& buffer) 
     1542   TRY 
    14121543   { 
    14131544      CCalendarWrapper::get(CCalendarWrapper::GetDefName())->createCalendar(); 
    14141545      postProcessing(); 
    14151546   } 
     1547   CATCH_DUMP_ATTR 
    14161548 
    14171549   const StdString& CContext::getIdServer() 
     1550   TRY 
    14181551   { 
    14191552      if (hasClient) 
     
    14251558      if (hasServer) return (this->getId()); 
    14261559   } 
     1560   CATCH_DUMP_ATTR 
    14271561 
    14281562   const StdString& CContext::getIdServer(const int i) 
     1563   TRY 
    14291564   { 
    14301565     idServer_ = this->getId(); 
     
    14331568     return idServer_; 
    14341569   } 
    1435  
     1570   CATCH_DUMP_ATTR 
    14361571 
    14371572   /*! 
     
    14421577   */ 
    14431578   void CContext::postProcessing() 
     1579   TRY 
    14441580   { 
    14451581     if (isPostProcessed) return; 
     
    15041640      isPostProcessed = true; 
    15051641   } 
     1642   CATCH_DUMP_ATTR 
    15061643 
    15071644   /*! 
     
    15141651   std::map<int, StdSize> CContext::getAttributesBufferSize(std::map<int, StdSize>& maxEventSize, 
    15151652                                                           CContextClient* contextClient, bool bufferForWriting /*= "false"*/) 
     1653   TRY 
    15161654   { 
    15171655         // As calendar attributes are sent even if there are no active files or fields, maps are initialized according the size of calendar attributes 
     
    15451683     return attributesSize; 
    15461684   } 
     1685   CATCH_DUMP_ATTR 
    15471686 
    15481687   /*! 
     
    15551694   std::map<int, StdSize> CContext::getDataBufferSize(std::map<int, StdSize>& maxEventSize, 
    15561695                                                      CContextClient* contextClient, bool bufferForWriting /*= "false"*/) 
     1696   TRY 
    15571697   { 
    15581698     std::map<int, StdSize> dataSize; 
     
    15631703     for (size_t i = 0; i < numEnabledFiles; ++i) 
    15641704     { 
    1565 //       CFile* file = this->enabledFiles[i]; 
    15661705       CFile* file = fileList[i]; 
    15671706       if (file->getContextClient() == contextClient) 
     
    15911730     return dataSize; 
    15921731   } 
     1732   CATCH_DUMP_ATTR 
    15931733 
    15941734   //! Client side: Send infomation of active files (files are enabled to write out) 
    15951735   void CContext::sendEnabledFiles(const std::vector<CFile*>& activeFiles) 
     1736   TRY 
    15961737   { 
    15971738     int size = activeFiles.size(); 
     
    16111752     } 
    16121753   } 
     1754   CATCH_DUMP_ATTR 
    16131755 
    16141756   //! Client side: Send information of active fields (ones are written onto files) 
    16151757   void CContext::sendEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles) 
     1758   TRY 
    16161759   { 
    16171760     int size = activeFiles.size(); 
     
    16211764     } 
    16221765   } 
     1766   CATCH_DUMP_ATTR 
    16231767 
    16241768   //! Client side: Check if the defined axis, domains and grids are eligible for compressed indexed output 
    16251769   void CContext::checkAxisDomainsGridsEligibilityForCompressedOutput() 
     1770   TRY 
    16261771   { 
    16271772     if (!hasClient) return; 
     
    16391784       (*it)->checkEligibilityForCompressedOutput(); 
    16401785   } 
     1786   CATCH_DUMP_ATTR 
    16411787 
    16421788   //! Client side: Prepare the timeseries by adding the necessary files 
    16431789   void CContext::prepareTimeseries() 
     1790   TRY 
    16441791   { 
    16451792     if (!hasClient) return; 
     
    17391886     } 
    17401887   } 
     1888   CATCH_DUMP_ATTR 
    17411889 
    17421890   //! Client side: Send information of reference grid of active fields 
    17431891   void CContext::sendRefGrid(const std::vector<CFile*>& activeFiles) 
     1892   TRY 
    17441893   { 
    17451894     std::set<StdString> gridIds; 
     
    17731922     } 
    17741923   } 
     1924   CATCH_DUMP_ATTR 
    17751925 
    17761926   //! Client side: Send information of reference domain, axis and scalar of active fields 
    17771927   void CContext::sendRefDomainsAxisScalars(const std::vector<CFile*>& activeFiles) 
     1928   TRY 
    17781929   { 
    17791930     std::set<StdString> domainIds, axisIds, scalarIds; 
     
    18341985     } 
    18351986   } 
     1987   CATCH_DUMP_ATTR 
    18361988 
    18371989   //! Update calendar in each time step 
    18381990   void CContext::updateCalendar(int step) 
     1991   TRY 
    18391992   { 
    18401993      int prevStep = calendar->getStep(); 
     
    18472000        } 
    18482001 
    1849         //#pragma omp critical (_output) 
    1850         info(150) << "updateCalendar : before : " << calendar->getCurrentDate() << endl; 
     2002        #pragma omp critical (_output) 
     2003        { 
     2004          info(100) << "updateCalendar : before : " << calendar->getCurrentDate() << endl; 
     2005        } 
    18512006        calendar->update(step); 
    1852         //#pragma omp critical (_output) 
    1853         info(150) << "updateCalendar : after : " << calendar->getCurrentDate() << endl; 
     2007        #pragma omp critical (_output) 
     2008        { 
     2009          info(100) << "updateCalendar : after : " << calendar->getCurrentDate() << endl; 
     2010        } 
    18542011  #ifdef XIOS_MEMTRACK_LIGHT 
    18552012        #pragma omp critical (_output) 
    1856         info(50) << " Current memory used by XIOS : "<<  MemTrack::getCurrentMemorySize()*1.0/(1024*1024)<<" Mbyte, at timestep "<<step<<" of context "<<this->getId()<<endl ; 
     2013        { 
     2014          info(50) << " Current memory used by XIOS : "<<  MemTrack::getCurrentMemorySize()*1.0/(1024*1024)<<" Mbyte, at timestep "<<step<<" of context "<<this->getId()<<endl ; 
     2015        } 
    18572016  #endif 
    18582017 
     
    18662025      { 
    18672026        #pragma omp critical (_output) 
    1868         info(50) << "updateCalendar: already at step " << step << ", no operation done." << endl; 
     2027        { 
     2028          info(50) << "updateCalendar: already at step " << step << ", no operation done." << endl; 
     2029        } 
    18692030      } 
    18702031      else // if (prevStep > step) 
     
    18722033              << "Illegal calendar update: previous step was " << prevStep << ", new step " << step << "is in the past!") 
    18732034   } 
     2035   CATCH_DUMP_ATTR 
    18742036 
    18752037   void CContext::initReadFiles(void) 
     2038   TRY 
    18762039   { 
    18772040      vector<CFile*>::const_iterator it; 
     
    18822045      } 
    18832046   } 
     2047   CATCH_DUMP_ATTR 
    18842048 
    18852049   //! Server side: Create header of netcdf file 
    18862050   void CContext::createFileHeader(void) 
     2051   TRY 
    18872052   { 
    18882053      vector<CFile*>::const_iterator it; 
     
    18942059      } 
    18952060   } 
     2061   CATCH_DUMP_ATTR 
    18962062 
    18972063   //! Get current context 
    18982064   CContext* CContext::getCurrent(void) 
     2065   TRY 
    18992066   { 
    19002067     return CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()).get(); 
    19012068   } 
     2069   CATCH 
    19022070 
    19032071   /*! 
     
    19062074   */ 
    19072075   void CContext::setCurrent(const string& id) 
     2076   TRY 
    19082077   { 
    19092078     CObjectFactory::SetCurrentContextId(id); 
    19102079     CGroupFactory::SetCurrentContextId(id); 
    19112080   } 
     2081   CATCH 
    19122082 
    19132083  /*! 
     
    19172087  */ 
    19182088  CContext* CContext::create(const StdString& id) 
     2089  TRY 
    19192090  { 
    19202091    CContext::setCurrent(id); 
     
    19322103    return (context); 
    19332104  } 
    1934  
     2105  CATCH 
    19352106 
    19362107     //! Server side: Receive a message to do some post processing 
    19372108  void CContext::recvRegistry(CEventServer& event) 
     2109  TRY 
    19382110  { 
    19392111    CBufferIn* buffer=event.subEvents.begin()->buffer; 
     
    19422114    get(id)->recvRegistry(*buffer); 
    19432115  } 
     2116  CATCH 
    19442117 
    19452118  void CContext::recvRegistry(CBufferIn& buffer) 
     2119  TRY 
    19462120  { 
    19472121    if (server->intraCommRank==0) 
     
    19522126    } 
    19532127  } 
     2128  CATCH_DUMP_ATTR 
    19542129 
    19552130  void CContext::sendRegistry(void) 
     2131  TRY 
    19562132  { 
    19572133    registryOut->hierarchicalGatherRegistry() ; 
     
    19792155    } 
    19802156  } 
     2157  CATCH_DUMP_ATTR 
    19812158 
    19822159  /*! 
     
    19852162  */ 
    19862163  bool CContext::isFinalized(void) 
     2164  TRY 
    19872165  { 
    19882166    return finalized; 
    19892167  } 
     2168  CATCH_DUMP_ATTR 
     2169  ///-------------------------------------------------------------- 
     2170  StdString CContext::dumpClassAttributes(void) 
     2171  { 
     2172    StdString str; 
     2173    str.append("enabled files=\""); 
     2174    int size = this->enabledFiles.size(); 
     2175    for (int i = 0; i < size; ++i) 
     2176    { 
     2177      str.append(enabledFiles[i]->getId()); 
     2178      str.append(" "); 
     2179    } 
     2180    str.append("\""); 
     2181    return str; 
     2182  } 
    19902183 
    19912184} // namespace xios 
Note: See TracChangeset for help on using the changeset viewer.