Ignore:
Timestamp:
12/11/18 13:22:07 (5 years ago)
Author:
oabramkina
Message:

Exception handling on trunk.

To activate it, compilation flag -DXIOS_EXCEPTION should be added.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/node/context.cpp

    r1542 r1622  
    3333      , idServer_(), client(0), server(0) 
    3434      , allProcessed(false), countChildCtx_(0) 
     35 
    3536   { /* Ne rien faire de plus */ } 
    3637 
     
    6566   */ 
    6667   CContextGroup* CContext::getRoot(void) 
     68   TRY 
    6769   { 
    6870      if (root.get()==NULL) root=std::shared_ptr<CContextGroup>(new CContextGroup(xml::CXMLNode::GetRootName())); 
    6971      return root.get(); 
    7072   } 
     73   CATCH 
    7174 
    7275   //---------------------------------------------------------------- 
     
    7780   */ 
    7881   std::shared_ptr<CCalendar> CContext::getCalendar(void) const 
     82   TRY 
    7983   { 
    8084      return (this->calendar); 
    8185   } 
     86   CATCH 
    8287 
    8388   //---------------------------------------------------------------- 
     
    8893   */ 
    8994   void CContext::setCalendar(std::shared_ptr<CCalendar> newCalendar) 
     95   TRY 
    9096   { 
    9197      this->calendar = newCalendar; 
    9298   } 
     99   CATCH_DUMP_ATTR 
    93100 
    94101   //---------------------------------------------------------------- 
     
    98105   */ 
    99106   void CContext::parse(xml::CXMLNode & node) 
     107   TRY 
    100108   { 
    101109      CContext::SuperClass::parse(node); 
     
    152160      } 
    153161   } 
     162   CATCH_DUMP_ATTR 
    154163 
    155164   //---------------------------------------------------------------- 
    156165   //! Show tree structure of context 
    157166   void CContext::ShowTree(StdOStream & out) 
     167   TRY 
    158168   { 
    159169      StdString currentContextId = CContext::getCurrent() -> getId(); 
     
    176186      CContext::setCurrent(currentContextId); 
    177187   } 
    178  
     188   CATCH 
    179189 
    180190   //---------------------------------------------------------------- 
     
    182192   //! Convert context object into string (to print) 
    183193   StdString CContext::toString(void) const 
     194   TRY 
    184195   { 
    185196      StdOStringStream oss; 
     
    201212 
    202213      } 
    203  
    204214      oss << "</" << CContext::GetName() << " >"; 
    205  
    206215      return (oss.str()); 
    207216   } 
     217   CATCH 
    208218 
    209219   //---------------------------------------------------------------- 
     
    216226   */ 
    217227   void CContext::solveDescInheritance(bool apply, const CAttributeMap * const UNUSED(parent)) 
     228   TRY 
    218229   { 
    219230#define DECLARE_NODE(Name_, name_)    \ 
     
    223234#include "node_type.conf" 
    224235   } 
     236   CATCH_DUMP_ATTR 
    225237 
    226238   //---------------------------------------------------------------- 
     
    228240   //! Verify if all root definition in the context have child. 
    229241   bool CContext::hasChild(void) const 
     242   TRY 
    230243   { 
    231244      return ( 
     
    236249      false); 
    237250} 
     251   CATCH 
    238252 
    239253   //---------------------------------------------------------------- 
    240254 
    241255   void CContext::CleanTree(void) 
     256   TRY 
    242257   { 
    243258#define DECLARE_NODE(Name_, name_) C##Name_##Definition::ClearAllAttributes(); 
     
    245260#include "node_type.conf" 
    246261   } 
     262   CATCH 
     263 
    247264   ///--------------------------------------------------------------- 
    248265 
    249266   //! Initialize client side 
    250267   void CContext::initClient(MPI_Comm intraComm, MPI_Comm interComm, CContext* cxtServer /*= 0*/) 
     268   TRY 
    251269   { 
    252270 
     
    298316     } 
    299317   } 
     318   CATCH_DUMP_ATTR 
    300319 
    301320   /*! 
     
    306325  */ 
    307326   void CContext::setClientServerBuffer(CContextClient* contextClient, bool bufferForWriting) 
     327   TRY 
    308328   { 
    309329      // Estimated minimum event size for small events (10 is an arbitrary constant just for safety) 
     
    352372     } 
    353373     contextClient->setBufferSize(bufferSize, maxEventSize); 
    354  
    355    } 
     374   } 
     375   CATCH_DUMP_ATTR 
    356376 
    357377   //! Verify whether a context is initialized 
    358378   bool CContext::isInitialized(void) 
     379   TRY 
    359380   { 
    360381     return hasClient; 
    361382   } 
     383   CATCH_DUMP_ATTR 
    362384 
    363385   void CContext::initServer(MPI_Comm intraComm, MPI_Comm interComm, CContext* cxtClient /*= 0*/) 
     386   TRY 
    364387   { 
    365388     hasServer=true; 
     
    394417     client = new CContextClient(this,intraCommClient,interCommClient, cxtClient); 
    395418   } 
     419   CATCH_DUMP_ATTR 
    396420 
    397421   //! Try to send the buffers and receive possible answers 
    398422  bool CContext::checkBuffersAndListen(bool enableEventsProcessing /*= true*/) 
     423  TRY 
    399424  { 
    400425    bool clientReady, serverFinished; 
     
    434459    } 
    435460  } 
     461   CATCH_DUMP_ATTR 
    436462 
    437463   //! Terminate a context 
    438464   void CContext::finalize(void) 
     465   TRY 
    439466   { 
    440467      if (hasClient && !hasServer) // For now we only use server level 1 to read data 
     
    527554     } 
    528555   } 
     556   CATCH_DUMP_ATTR 
    529557 
    530558   //! Free internally allocated communicators 
    531559   void CContext::freeComms(void) 
     560   TRY 
    532561   { 
    533562     for (std::list<MPI_Comm>::iterator it = comms.begin(); it != comms.end(); ++it) 
     
    535564     comms.clear(); 
    536565   } 
     566   CATCH_DUMP_ATTR 
    537567 
    538568   //! Deallocate buffers allocated by clientContexts 
    539569   void CContext::releaseClientBuffers(void) 
     570   TRY 
    540571   { 
    541572     client->releaseBuffers(); 
     
    543574       clientPrimServer[i]->releaseBuffers(); 
    544575   } 
     576   CATCH_DUMP_ATTR 
    545577 
    546578   void CContext::postProcessingGlobalAttributes() 
     579   TRY 
    547580   { 
    548581     if (allProcessed) return;   
     
    608641     allProcessed = true; 
    609642   } 
     643   CATCH_DUMP_ATTR 
    610644 
    611645   void CContext::sendPostProcessingGlobalAttributes() 
     646   TRY 
    612647   { 
    613648      // Use correct context client to send message 
     
    634669     } 
    635670   } 
     671   CATCH_DUMP_ATTR 
    636672 
    637673   void CContext::recvPostProcessingGlobalAttributes(CEventServer& event) 
     674   TRY 
    638675   { 
    639676      CBufferIn* buffer=event.subEvents.begin()->buffer; 
     
    642679      get(id)->recvPostProcessingGlobalAttributes(*buffer); 
    643680   } 
     681   CATCH 
    644682 
    645683   void CContext::recvPostProcessingGlobalAttributes(CBufferIn& buffer) 
     684   TRY 
    646685   {       
    647686      postProcessingGlobalAttributes(); 
    648687   } 
     688   CATCH_DUMP_ATTR 
    649689 
    650690   /*! 
     
    657697   and the active fields (fields will be written onto active files) 
    658698   */ 
     699 
    659700   void CContext::closeDefinition(void) 
     701   TRY 
    660702   { 
    661703    CTimer::get("Context : close definition").resume() ; 
     
    688730    CTimer::get("Context : close definition").suspend() ; 
    689731   } 
     732   CATCH_DUMP_ATTR 
    690733 
    691734   void CContext::findAllEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles) 
     735   TRY 
    692736   { 
    693737     for (unsigned int i = 0; i < activeFiles.size(); i++) 
    694738     (void)activeFiles[i]->getEnabledFields(); 
    695739   } 
     740   CATCH_DUMP_ATTR 
    696741 
    697742   void CContext::readAttributesOfEnabledFieldsInReadModeFiles() 
     743   TRY 
    698744   { 
    699745      for (unsigned int i = 0; i < this->enabledReadModeFiles.size(); ++i) 
    700746        (void)this->enabledReadModeFiles[i]->readAttributesOfEnabledFieldsInReadMode(); 
    701747   } 
     748   CATCH_DUMP_ATTR 
    702749 
    703750   void CContext::sendGridComponentEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles) 
     751   TRY 
    704752   { 
    705753     int size = activeFiles.size(); 
     
    709757     } 
    710758   } 
     759   CATCH_DUMP_ATTR 
    711760 
    712761   /*! 
     
    715764   */ 
    716765   void CContext::sendGridEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles) 
     766   TRY 
    717767   { 
    718768     int size = activeFiles.size(); 
     
    722772     } 
    723773   } 
     774   CATCH_DUMP_ATTR 
    724775 
    725776   void CContext::checkGridEnabledFields() 
     777   TRY 
    726778   { 
    727779     int size = enabledFiles.size(); 
     
    731783     } 
    732784   } 
     785   CATCH_DUMP_ATTR 
    733786 
    734787   /*! 
     
    737790   */ 
    738791   void CContext::checkGridEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles) 
     792   TRY 
    739793   { 
    740794     int size = activeFiles.size(); 
     
    744798     } 
    745799   } 
     800   CATCH_DUMP_ATTR 
    746801 
    747802    /*! 
     
    751806   */ 
    752807   void CContext::solveOnlyRefOfEnabledFields(bool sendToServer) 
     808   TRY 
    753809   { 
    754810     int size = this->enabledFiles.size(); 
     
    763819     } 
    764820   } 
     821   CATCH_DUMP_ATTR 
    765822 
    766823    /*! 
     
    771828   */ 
    772829   void CContext::solveAllRefOfEnabledFieldsAndTransform(bool sendToServer) 
     830   TRY 
    773831   { 
    774832     int size = this->enabledFiles.size(); 
     
    778836     } 
    779837   } 
     838   CATCH_DUMP_ATTR 
    780839 
    781840   void CContext::buildFilterGraphOfEnabledFields() 
     841   TRY 
    782842   { 
    783843     int size = this->enabledFiles.size(); 
     
    787847     } 
    788848   } 
     849   CATCH_DUMP_ATTR 
    789850 
    790851   void CContext::postProcessFilterGraph() 
     852   TRY 
    791853   { 
    792854     int size = enabledFiles.size(); 
     
    796858     } 
    797859   } 
     860   CATCH_DUMP_ATTR 
    798861 
    799862   void CContext::startPrefetchingOfEnabledReadModeFiles() 
     863   TRY 
    800864   { 
    801865     int size = enabledReadModeFiles.size(); 
     
    805869     } 
    806870   } 
     871   CATCH_DUMP_ATTR 
    807872 
    808873   void CContext::doPreTimestepOperationsForEnabledReadModeFiles() 
     874   TRY 
    809875   { 
    810876     int size = enabledReadModeFiles.size(); 
     
    814880     } 
    815881   } 
     882   CATCH_DUMP_ATTR 
    816883 
    817884   void CContext::doPostTimestepOperationsForEnabledReadModeFiles() 
     885   TRY 
    818886   { 
    819887     int size = enabledReadModeFiles.size(); 
     
    823891     } 
    824892   } 
     893   CATCH_DUMP_ATTR 
    825894 
    826895  void CContext::findFieldsWithReadAccess(void) 
     896  TRY 
    827897  { 
    828898    fieldsWithReadAccess.clear(); 
     
    838908    } 
    839909  } 
     910  CATCH_DUMP_ATTR 
    840911 
    841912  void CContext::solveAllRefOfFieldsWithReadAccess() 
     913  TRY 
    842914  { 
    843915    for (size_t i = 0; i < fieldsWithReadAccess.size(); ++i) 
    844916      fieldsWithReadAccess[i]->solveAllReferenceEnabledField(false); 
    845917  } 
     918  CATCH_DUMP_ATTR 
    846919 
    847920  void CContext::buildFilterGraphOfFieldsWithReadAccess() 
     921  TRY 
    848922  { 
    849923    for (size_t i = 0; i < fieldsWithReadAccess.size(); ++i) 
    850924      fieldsWithReadAccess[i]->buildFilterGraph(garbageCollector, true); 
    851925  } 
     926  CATCH_DUMP_ATTR 
    852927 
    853928   void CContext::solveAllInheritance(bool apply) 
     929   TRY 
    854930   { 
    855931     // Résolution des héritages descendants (càd des héritages de groupes) 
     
    874950 
    875951   } 
     952  CATCH_DUMP_ATTR 
    876953 
    877954   void CContext::findEnabledFiles(void) 
     955   TRY 
    878956   { 
    879957      const std::vector<CFile*> allFiles = CFile::getAll(); 
     
    9241002 
    9251003   } 
     1004   CATCH_DUMP_ATTR 
    9261005 
    9271006   void CContext::distributeFiles(void) 
     1007   TRY 
    9281008   { 
    9291009     bool distFileMemory=false ; 
     
    9331013     else distributeFileOverBandwith() ; 
    9341014   } 
    935  
     1015   CATCH_DUMP_ATTR 
    9361016 
    9371017   void CContext::distributeFileOverBandwith(void) 
     1018   TRY 
    9381019   { 
    9391020     double eps=std::numeric_limits<double>::epsilon()*10 ; 
     
    10151096     } 
    10161097   } 
     1098   CATCH_DUMP_ATTR 
    10171099 
    10181100   void CContext::distributeFileOverMemoryBandwith(void) 
     1101   TRY 
    10191102   { 
    10201103     // If primary server 
     
    11071190   } 
    11081191} 
    1109  
    1110  
     1192   CATCH_DUMP_ATTR 
    11111193 
    11121194   /*! 
     
    11141196   */ 
    11151197   void CContext::findEnabledWriteModeFiles(void) 
     1198   TRY 
    11161199   { 
    11171200     int size = this->enabledFiles.size(); 
     
    11231206     } 
    11241207   } 
     1208   CATCH_DUMP_ATTR 
    11251209 
    11261210   /*! 
     
    11281212   */ 
    11291213   void CContext::findEnabledReadModeFiles(void) 
     1214   TRY 
    11301215   { 
    11311216     int size = this->enabledFiles.size(); 
     
    11361221     } 
    11371222   } 
     1223   CATCH_DUMP_ATTR 
    11381224 
    11391225   void CContext::closeAllFile(void) 
     1226   TRY 
    11401227   { 
    11411228     std::vector<CFile*>::const_iterator 
     
    11481235     } 
    11491236   } 
     1237   CATCH_DUMP_ATTR 
    11501238 
    11511239   /*! 
     
    11571245   */ 
    11581246   bool CContext::dispatchEvent(CEventServer& event) 
     1247   TRY 
    11591248   { 
    11601249 
     
    11981287      } 
    11991288   } 
     1289   CATCH 
    12001290 
    12011291   //! Client side: Send a message to server to make it close 
    12021292   void CContext::sendCloseDefinition(void) 
     1293   TRY 
    12031294   { 
    12041295     // Use correct context client to send message 
     
    12231314     } 
    12241315   } 
     1316   CATCH_DUMP_ATTR 
    12251317 
    12261318   //! Server side: Receive a message of client announcing a context close 
    12271319   void CContext::recvCloseDefinition(CEventServer& event) 
     1320   TRY 
    12281321   { 
    12291322      CBufferIn* buffer=event.subEvents.begin()->buffer; 
     
    12321325      get(id)->closeDefinition(); 
    12331326   } 
     1327   CATCH 
    12341328 
    12351329   //! Client side: Send a message to update calendar in each time step 
    12361330   void CContext::sendUpdateCalendar(int step) 
     1331   TRY 
    12371332   { 
    12381333     // Use correct context client to send message 
     
    12581353     } 
    12591354   } 
     1355   CATCH_DUMP_ATTR 
    12601356 
    12611357   //! Server side: Receive a message of client annoucing calendar update 
    12621358   void CContext::recvUpdateCalendar(CEventServer& event) 
     1359   TRY 
    12631360   { 
    12641361      CBufferIn* buffer=event.subEvents.begin()->buffer; 
     
    12671364      get(id)->recvUpdateCalendar(*buffer); 
    12681365   } 
     1366   CATCH 
    12691367 
    12701368   //! Server side: Receive a message of client annoucing calendar update 
    12711369   void CContext::recvUpdateCalendar(CBufferIn& buffer) 
     1370   TRY 
    12721371   { 
    12731372      int step; 
     
    12791378      } 
    12801379   } 
     1380   CATCH_DUMP_ATTR 
    12811381 
    12821382   //! Client side: Send a message to create header part of netcdf file 
    12831383   void CContext::sendCreateFileHeader(void) 
     1384   TRY 
    12841385   { 
    12851386     // Use correct context client to send message 
     
    13061407     } 
    13071408   } 
     1409   CATCH_DUMP_ATTR 
    13081410 
    13091411   //! Server side: Receive a message of client annoucing the creation of header part of netcdf file 
    13101412   void CContext::recvCreateFileHeader(CEventServer& event) 
     1413   TRY 
    13111414   { 
    13121415      CBufferIn* buffer=event.subEvents.begin()->buffer; 
     
    13151418      get(id)->recvCreateFileHeader(*buffer); 
    13161419   } 
     1420   CATCH 
    13171421 
    13181422   //! Server side: Receive a message of client annoucing the creation of header part of netcdf file 
    13191423   void CContext::recvCreateFileHeader(CBufferIn& buffer) 
     1424   TRY 
    13201425   { 
    13211426      if (!hasClient && hasServer)  
    13221427        createFileHeader(); 
    13231428   } 
     1429   CATCH_DUMP_ATTR 
    13241430 
    13251431   //! Client side: Send a message to do some post processing on server 
    13261432   void CContext::sendProcessingGridOfEnabledFields() 
     1433   TRY 
    13271434   { 
    13281435      // Use correct context client to send message 
     
    13481455     } 
    13491456   } 
     1457   CATCH_DUMP_ATTR 
    13501458 
    13511459   //! Server side: Receive a message to do some post processing 
    13521460   void CContext::recvProcessingGridOfEnabledFields(CEventServer& event) 
     1461   TRY 
    13531462   { 
    13541463      CBufferIn* buffer=event.subEvents.begin()->buffer; 
     
    13561465      *buffer>>id;       
    13571466   } 
     1467   CATCH 
    13581468 
    13591469   //! Client side: Send a message to do some post processing on server 
    13601470   void CContext::sendPostProcessing() 
     1471   TRY 
    13611472   { 
    13621473      // Use correct context client to send message 
     
    13821493     } 
    13831494   } 
     1495   CATCH_DUMP_ATTR 
    13841496 
    13851497   //! Server side: Receive a message to do some post processing 
    13861498   void CContext::recvPostProcessing(CEventServer& event) 
     1499   TRY 
    13871500   { 
    13881501      CBufferIn* buffer=event.subEvents.begin()->buffer; 
     
    13911504      get(id)->recvPostProcessing(*buffer); 
    13921505   } 
     1506   CATCH 
    13931507 
    13941508   //! Server side: Receive a message to do some post processing 
    13951509   void CContext::recvPostProcessing(CBufferIn& buffer) 
     1510   TRY 
    13961511   { 
    13971512      CCalendarWrapper::get(CCalendarWrapper::GetDefName())->createCalendar(); 
    13981513      postProcessing(); 
    13991514   } 
     1515   CATCH_DUMP_ATTR 
    14001516 
    14011517   const StdString& CContext::getIdServer() 
     1518   TRY 
    14021519   { 
    14031520      if (hasClient) 
     
    14091526      if (hasServer) return (this->getId()); 
    14101527   } 
     1528   CATCH_DUMP_ATTR 
    14111529 
    14121530   const StdString& CContext::getIdServer(const int i) 
     1531   TRY 
    14131532   { 
    14141533     idServer_ = this->getId(); 
     
    14171536     return idServer_; 
    14181537   } 
    1419  
     1538   CATCH_DUMP_ATTR 
    14201539 
    14211540   /*! 
     
    14261545   */ 
    14271546   void CContext::postProcessing() 
     1547   TRY 
    14281548   { 
    14291549     if (isPostProcessed) return; 
     
    14881608      isPostProcessed = true; 
    14891609   } 
     1610   CATCH_DUMP_ATTR 
    14901611 
    14911612   /*! 
     
    14981619   std::map<int, StdSize> CContext::getAttributesBufferSize(std::map<int, StdSize>& maxEventSize, 
    14991620                                                           CContextClient* contextClient, bool bufferForWriting /*= "false"*/) 
     1621   TRY 
    15001622   { 
    15011623         // As calendar attributes are sent even if there are no active files or fields, maps are initialized according the size of calendar attributes 
     
    15291651     return attributesSize; 
    15301652   } 
     1653   CATCH_DUMP_ATTR 
    15311654 
    15321655   /*! 
     
    15391662   std::map<int, StdSize> CContext::getDataBufferSize(std::map<int, StdSize>& maxEventSize, 
    15401663                                                      CContextClient* contextClient, bool bufferForWriting /*= "false"*/) 
     1664   TRY 
    15411665   { 
    15421666     std::map<int, StdSize> dataSize; 
     
    15471671     for (size_t i = 0; i < numEnabledFiles; ++i) 
    15481672     { 
    1549 //       CFile* file = this->enabledFiles[i]; 
    15501673       CFile* file = fileList[i]; 
    15511674       if (file->getContextClient() == contextClient) 
     
    15751698     return dataSize; 
    15761699   } 
     1700   CATCH_DUMP_ATTR 
    15771701 
    15781702   //! Client side: Send infomation of active files (files are enabled to write out) 
    15791703   void CContext::sendEnabledFiles(const std::vector<CFile*>& activeFiles) 
     1704   TRY 
    15801705   { 
    15811706     int size = activeFiles.size(); 
     
    15951720     } 
    15961721   } 
     1722   CATCH_DUMP_ATTR 
    15971723 
    15981724   //! Client side: Send information of active fields (ones are written onto files) 
    15991725   void CContext::sendEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles) 
     1726   TRY 
    16001727   { 
    16011728     int size = activeFiles.size(); 
     
    16051732     } 
    16061733   } 
     1734   CATCH_DUMP_ATTR 
    16071735 
    16081736   //! Client side: Check if the defined axis, domains and grids are eligible for compressed indexed output 
    16091737   void CContext::checkAxisDomainsGridsEligibilityForCompressedOutput() 
     1738   TRY 
    16101739   { 
    16111740     if (!hasClient) return; 
     
    16231752       (*it)->checkEligibilityForCompressedOutput(); 
    16241753   } 
     1754   CATCH_DUMP_ATTR 
    16251755 
    16261756   //! Client side: Prepare the timeseries by adding the necessary files 
    16271757   void CContext::prepareTimeseries() 
     1758   TRY 
    16281759   { 
    16291760     if (!hasClient) return; 
     
    17231854     } 
    17241855   } 
     1856   CATCH_DUMP_ATTR 
    17251857 
    17261858   //! Client side: Send information of reference grid of active fields 
    17271859   void CContext::sendRefGrid(const std::vector<CFile*>& activeFiles) 
     1860   TRY 
    17281861   { 
    17291862     std::set<StdString> gridIds; 
     
    17571890     } 
    17581891   } 
     1892   CATCH_DUMP_ATTR 
    17591893 
    17601894   //! Client side: Send information of reference domain, axis and scalar of active fields 
    17611895   void CContext::sendRefDomainsAxisScalars(const std::vector<CFile*>& activeFiles) 
     1896   TRY 
    17621897   { 
    17631898     std::set<StdString> domainIds, axisIds, scalarIds; 
     
    18181953     } 
    18191954   } 
     1955   CATCH_DUMP_ATTR 
    18201956 
    18211957   //! Update calendar in each time step 
    18221958   void CContext::updateCalendar(int step) 
     1959   TRY 
    18231960   { 
    18241961      int prevStep = calendar->getStep(); 
     
    18501987              << "Illegal calendar update: previous step was " << prevStep << ", new step " << step << "is in the past!") 
    18511988   } 
     1989   CATCH_DUMP_ATTR 
    18521990 
    18531991   void CContext::initReadFiles(void) 
     1992   TRY 
    18541993   { 
    18551994      vector<CFile*>::const_iterator it; 
     
    18601999      } 
    18612000   } 
     2001   CATCH_DUMP_ATTR 
    18622002 
    18632003   //! Server side: Create header of netcdf file 
    18642004   void CContext::createFileHeader(void) 
     2005   TRY 
    18652006   { 
    18662007      vector<CFile*>::const_iterator it; 
     
    18722013      } 
    18732014   } 
     2015   CATCH_DUMP_ATTR 
    18742016 
    18752017   //! Get current context 
    18762018   CContext* CContext::getCurrent(void) 
     2019   TRY 
    18772020   { 
    18782021     return CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()).get(); 
    18792022   } 
     2023   CATCH 
    18802024 
    18812025   /*! 
     
    18842028   */ 
    18852029   void CContext::setCurrent(const string& id) 
     2030   TRY 
    18862031   { 
    18872032     CObjectFactory::SetCurrentContextId(id); 
    18882033     CGroupFactory::SetCurrentContextId(id); 
    18892034   } 
     2035   CATCH 
    18902036 
    18912037  /*! 
     
    18952041  */ 
    18962042  CContext* CContext::create(const StdString& id) 
     2043  TRY 
    18972044  { 
    18982045    CContext::setCurrent(id); 
     
    19102057    return (context); 
    19112058  } 
    1912  
     2059  CATCH 
    19132060 
    19142061     //! Server side: Receive a message to do some post processing 
    19152062  void CContext::recvRegistry(CEventServer& event) 
     2063  TRY 
    19162064  { 
    19172065    CBufferIn* buffer=event.subEvents.begin()->buffer; 
     
    19202068    get(id)->recvRegistry(*buffer); 
    19212069  } 
     2070  CATCH 
    19222071 
    19232072  void CContext::recvRegistry(CBufferIn& buffer) 
     2073  TRY 
    19242074  { 
    19252075    if (server->intraCommRank==0) 
     
    19302080    } 
    19312081  } 
     2082  CATCH_DUMP_ATTR 
    19322083 
    19332084  void CContext::sendRegistry(void) 
     2085  TRY 
    19342086  { 
    19352087    registryOut->hierarchicalGatherRegistry() ; 
     
    19572109    } 
    19582110  } 
     2111  CATCH_DUMP_ATTR 
    19592112 
    19602113  /*! 
     
    19632116  */ 
    19642117  bool CContext::isFinalized(void) 
     2118  TRY 
    19652119  { 
    19662120    return finalized; 
    19672121  } 
     2122  CATCH_DUMP_ATTR 
     2123  ///-------------------------------------------------------------- 
     2124  StdString CContext::dumpClassAttributes(void) 
     2125  { 
     2126    StdString str; 
     2127    str.append("enabled files=\""); 
     2128    int size = this->enabledFiles.size(); 
     2129    for (int i = 0; i < size; ++i) 
     2130    { 
     2131      str.append(enabledFiles[i]->getId()); 
     2132      str.append(" "); 
     2133    } 
     2134    str.append("\""); 
     2135    return str; 
     2136  } 
    19682137 
    19692138} // namespace xios 
Note: See TracChangeset for help on using the changeset viewer.