Ignore:
Timestamp:
11/23/18 14:48:14 (6 years ago)
Author:
oabramkina
Message:

Dev: adding exception handling.

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

Location:
XIOS/dev/dev_olga/src/node
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_olga/src/node/axis.cpp

    r1600 r1612  
    4848   bool CAxis::dummyTransformationMapList_ = CAxis::initializeTransformationMap(CAxis::transformationMapList_); 
    4949   bool CAxis::initializeTransformationMap(std::map<StdString, ETranformationType>& m) 
     50   TRY 
    5051   { 
    5152     m["zoom_axis"] = TRANS_ZOOM_AXIS; 
     
    6061 
    6162   } 
     63   CATCH 
    6264 
    6365   ///--------------------------------------------------------------- 
    6466 
    6567   const std::set<StdString> & CAxis::getRelFiles(void) const 
     68   TRY 
    6669   { 
    6770      return (this->relFiles); 
    6871   } 
     72   CATCH 
    6973 
    7074   bool CAxis::IsWritten(const StdString & filename) const 
     75   TRY 
    7176   { 
    7277      return (this->relFiles.find(filename) != this->relFiles.end()); 
    7378   } 
     79   CATCH 
    7480 
    7581   bool CAxis::isWrittenCompressed(const StdString& filename) const 
     82   TRY 
    7683   { 
    7784      return (this->relFilesCompressed.find(filename) != this->relFilesCompressed.end()); 
    7885   } 
     86   CATCH 
    7987 
    8088   bool CAxis::isDistributed(void) const 
     89   TRY 
    8190   { 
    8291      bool distributed = (!this->begin.isEmpty() && !this->n.isEmpty() && (this->begin + this->n < this->n_glo)) || 
    8392             (!this->n.isEmpty() && (this->n != this->n_glo)); 
    84       // A same stupid condition to make sure that if there is only one client, axis 
     93      // A condition to make sure that if there is only one client, axis 
    8594      // should be considered to be distributed. This should be a temporary solution      
    8695      distributed |= (1 == CContext::getCurrent()->client->clientSize); 
    8796      return distributed; 
    8897   } 
     98   CATCH 
    8999 
    90100   /*! 
     
    94104    */ 
    95105   bool CAxis::isCompressible(void) const 
     106   TRY 
    96107   { 
    97108      return isCompressible_; 
    98109   } 
     110   CATCH 
    99111 
    100112   void CAxis::addRelFile(const StdString & filename) 
     113   TRY 
    101114   { 
    102115      this->relFiles.insert(filename); 
    103116   } 
     117   CATCH_DUMP_ATTR 
    104118 
    105119   void CAxis::addRelFileCompressed(const StdString& filename) 
     120   TRY 
    106121   { 
    107122      this->relFilesCompressed.insert(filename); 
    108123   } 
     124   CATCH_DUMP_ATTR 
    109125 
    110126   //---------------------------------------------------------------- 
     
    115131   */ 
    116132   int CAxis::getNumberWrittenIndexes(MPI_Comm writtenCom) 
     133   TRY 
    117134   { 
    118135     int writtenSize; 
     
    120137     return numberWrittenIndexes_[writtenSize]; 
    121138   } 
     139   CATCH_DUMP_ATTR 
    122140 
    123141   /*! 
     
    126144   */ 
    127145   int CAxis::getTotalNumberWrittenIndexes(MPI_Comm writtenCom) 
     146   TRY 
    128147   { 
    129148     int writtenSize; 
     
    131150     return totalNumberWrittenIndexes_[writtenSize]; 
    132151   } 
     152   CATCH_DUMP_ATTR 
    133153 
    134154   /*! 
     
    137157   */ 
    138158   int CAxis::getOffsetWrittenIndexes(MPI_Comm writtenCom) 
     159   TRY 
    139160   { 
    140161     int writtenSize; 
     
    142163     return offsetWrittenIndexes_[writtenSize]; 
    143164   } 
     165   CATCH_DUMP_ATTR 
    144166 
    145167   CArray<int, 1>& CAxis::getCompressedIndexToWriteOnServer(MPI_Comm writtenCom) 
     168   TRY 
    146169   { 
    147170     int writtenSize; 
     
    149172     return compressedIndexToWriteOnServer[writtenSize]; 
    150173   } 
     174   CATCH_DUMP_ATTR 
     175 
    151176   //---------------------------------------------------------------- 
    152177 
     
    158183   std::map<int, StdSize> CAxis::getAttributesBufferSize(CContextClient* client, const std::vector<int>& globalDim, int orderPositionInGrid, 
    159184                                                         CServerDistributionDescription::ServerDistributionType distType) 
     185   TRY 
    160186   { 
    161187 
     
    221247       } 
    222248     } 
    223  
    224249     return attributesSizes; 
    225250   } 
     251   CATCH_DUMP_ATTR 
    226252 
    227253   //---------------------------------------------------------------- 
     
    234260 
    235261   CAxis* CAxis::createAxis() 
     262   TRY 
    236263   { 
    237264     CAxis* axis = CAxisGroup::get("axis_definition")->createChild(); 
    238265     return axis; 
    239266   } 
     267   CATCH 
    240268 
    241269   /*! 
     
    244272   */ 
    245273   void CAxis::checkAttributes(void) 
     274   TRY 
    246275   { 
    247276     CContext* context=CContext::getCurrent(); 
     
    311340      } 
    312341   } 
     342   CATCH_DUMP_ATTR 
    313343 
    314344   /*! 
     
    317347 
    318348   void CAxis::checkData() 
     349   TRY 
    319350   { 
    320351      if (data_begin.isEmpty()) data_begin.setValue(0); 
     
    363394 
    364395   } 
     396   CATCH_DUMP_ATTR 
    365397 
    366398    size_t CAxis::getGlobalWrittenSize(void) 
     
    373405   */ 
    374406   void CAxis::checkMask() 
     407   TRY 
    375408   { 
    376409      if (!mask.isEmpty()) 
     
    391424      } 
    392425   } 
     426   CATCH_DUMP_ATTR 
    393427 
    394428   /*! 
     
    396430   */ 
    397431   void CAxis::checkBounds() 
     432   TRY 
    398433   { 
    399434     if (!bounds.isEmpty()) 
     
    408443     else hasBounds = false; 
    409444   } 
     445   CATCH_DUMP_ATTR 
    410446 
    411447  void CAxis::checkLabel() 
     448  TRY 
    412449  { 
    413450    if (!label.isEmpty()) 
     
    422459    else hasLabel = false; 
    423460  } 
     461  CATCH_DUMP_ATTR 
    424462 
    425463  /*! 
     
    427465  */ 
    428466  void CAxis::checkEligibilityForCompressedOutput() 
     467  TRY 
    429468  { 
    430469    // We don't check if the mask is valid here, just if a mask has been defined at this point. 
    431470    isCompressible_ = !mask.isEmpty(); 
    432471  } 
     472  CATCH_DUMP_ATTR 
    433473 
    434474  /*! 
     
    436476  */ 
    437477  bool CAxis::dispatchEvent(CEventServer& event) 
     478  TRY 
    438479  { 
    439480     if (SuperClass::dispatchEvent(event)) return true; 
     
    461502     } 
    462503  } 
     504  CATCH 
    463505 
    464506   /*! 
     
    466508   */ 
    467509   void CAxis::checkAttributesOnClient() 
     510   TRY 
    468511   { 
    469512     if (this->areClientAttributesChecked_) return; 
     
    474517     this->areClientAttributesChecked_ = true; 
    475518   } 
     519   CATCH_DUMP_ATTR 
    476520 
    477521   /* 
     
    481525   void CAxis::checkAttributesOnClientAfterTransformation(const std::vector<int>& globalDim, int orderPositionInGrid, 
    482526                                                          CServerDistributionDescription::ServerDistributionType distType) 
     527   TRY 
    483528   { 
    484529     CContext* context=CContext::getCurrent() ; 
     
    494539     this->isClientAfterTransformationChecked = true; 
    495540   } 
     541   CATCH_DUMP_ATTR 
    496542 
    497543   /* 
     
    504550   void CAxis::sendCheckedAttributes(const std::vector<int>& globalDim, int orderPositionInGrid, 
    505551                                     CServerDistributionDescription::ServerDistributionType distType) 
     552   TRY 
    506553   { 
    507554     if (!this->areClientAttributesChecked_) checkAttributesOnClient(); 
     
    514561     this->isChecked = true; 
    515562   } 
     563   CATCH_DUMP_ATTR 
    516564 
    517565  /*! 
     
    522570  void CAxis::sendAttributes(const std::vector<int>& globalDim, int orderPositionInGrid, 
    523571                             CServerDistributionDescription::ServerDistributionType distType) 
     572  TRY 
    524573  { 
    525574     sendDistributionAttribute(globalDim, orderPositionInGrid, distType); 
     
    536585     }      
    537586  } 
     587  CATCH_DUMP_ATTR 
    538588 
    539589  /* 
     
    547597  void CAxis::computeConnectedClients(const std::vector<int>& globalDim, int orderPositionInGrid, 
    548598                                     CServerDistributionDescription::ServerDistributionType distType) 
     599  TRY 
    549600  { 
    550601    CContext* context = CContext::getCurrent(); 
     
    666717    } 
    667718  } 
     719  CATCH_DUMP_ATTR 
    668720 
    669721  /* 
     
    673725  */ 
    674726  void CAxis::computeWrittenIndex() 
     727  TRY 
    675728  {   
    676729    if (computedWrittenIndex_) return; 
     
    714767 
    715768  } 
     769  CATCH_DUMP_ATTR 
    716770 
    717771  void CAxis::computeWrittenCompressedIndex(MPI_Comm writtenComm) 
     772  TRY 
    718773  { 
    719774    int writtenCommSize; 
     
    804859    } 
    805860  } 
     861  CATCH_DUMP_ATTR 
    806862 
    807863  /*! 
     
    814870  void CAxis::sendDistributionAttribute(const std::vector<int>& globalDim, int orderPositionInGrid, 
    815871                                        CServerDistributionDescription::ServerDistributionType distType) 
     872  TRY 
    816873  { 
    817874    std::list<CContextClient*>::iterator it; 
     
    852909    } 
    853910  } 
     911  CATCH_DUMP_ATTR 
    854912 
    855913  /* 
     
    858916  */ 
    859917  void CAxis::recvDistributionAttribute(CEventServer& event) 
     918  TRY 
    860919  { 
    861920    CBufferIn* buffer = event.subEvents.begin()->buffer; 
     
    864923    get(axisId)->recvDistributionAttribute(*buffer); 
    865924  } 
     925  CATCH 
    866926 
    867927  /* 
     
    870930  */ 
    871931  void CAxis::recvDistributionAttribute(CBufferIn& buffer) 
     932  TRY 
    872933  { 
    873934    int ni_srv, begin_srv; 
     
    879940    begin.setValue(begin_srv); 
    880941  } 
     942  CATCH_DUMP_ATTR 
    881943 
    882944  /* 
     
    886948  */ 
    887949  void CAxis::sendNonDistributedAttributes() 
     950  TRY 
    888951  { 
    889952    std::list<CContextClient*>::iterator it; 
     
    9391002    } 
    9401003  } 
     1004  CATCH_DUMP_ATTR 
    9411005 
    9421006  /* 
     
    9451009  */ 
    9461010  void CAxis::recvNonDistributedAttributes(CEventServer& event) 
     1011  TRY 
    9471012  { 
    9481013    list<CEventServer::SSubEvent>::iterator it; 
     
    9551020    } 
    9561021  } 
     1022  CATCH 
    9571023 
    9581024  /* 
     
    9621028  */ 
    9631029  void CAxis::recvNonDistributedAttributes(int rank, CBufferIn& buffer) 
     1030  TRY 
    9641031  {  
    9651032    CArray<int,1> tmp_index, tmp_data_index; 
     
    10031070    for (int idx = 0; idx < index.numElements(); ++idx) globalLocalIndexMap_[index(idx)] = idx; 
    10041071  } 
     1072  CATCH_DUMP_ATTR 
    10051073 
    10061074  /* 
     
    10101078  */ 
    10111079  void CAxis::sendDistributedAttributes(void) 
     1080  TRY 
    10121081  { 
    10131082    int ind, idx; 
     
    11131182    } 
    11141183  } 
     1184  CATCH_DUMP_ATTR 
    11151185 
    11161186  /* 
     
    11191189  */ 
    11201190  void CAxis::recvDistributedAttributes(CEventServer& event) 
     1191  TRY 
    11211192  { 
    11221193    string axisId; 
     
    11341205    get(axisId)->recvDistributedAttributes(ranks, buffers); 
    11351206  } 
     1207  CATCH 
    11361208 
    11371209  /* 
     
    11411213  */ 
    11421214  void CAxis::recvDistributedAttributes(vector<int>& ranks, vector<CBufferIn*> buffers) 
     1215  TRY 
    11431216  { 
    11441217    int nbReceived = ranks.size(), idx, ind, gloInd, locInd; 
     
    12591332    data_n.setValue(data_index.numElements()); 
    12601333  } 
     1334  CATCH_DUMP_ATTR 
    12611335 
    12621336  /*! 
     
    12681342  */ 
    12691343  bool CAxis::isEqual(CAxis* obj) 
     1344  TRY 
    12701345  { 
    12711346    vector<StdString> excludedAttr; 
     
    12911366    return objEqual; 
    12921367  } 
     1368  CATCH_DUMP_ATTR 
    12931369 
    12941370  /* 
     
    12981374  */ 
    12991375  CTransformation<CAxis>* CAxis::addTransformation(ETranformationType transType, const StdString& id) 
     1376  TRY 
    13001377  { 
    13011378    transformationMap_.push_back(std::make_pair(transType, CTransformation<CAxis>::createTransformation(transType,id))); 
    13021379    return transformationMap_.back().second; 
    13031380  } 
     1381  CATCH_DUMP_ATTR 
    13041382 
    13051383  /* 
     
    13071385  */ 
    13081386  bool CAxis::hasTransformation() 
     1387  TRY 
    13091388  { 
    13101389    return (!transformationMap_.empty()); 
    13111390  } 
     1391  CATCH_DUMP_ATTR 
    13121392 
    13131393  /* 
     
    13161396  */ 
    13171397  void CAxis::setTransformations(const TransMapTypes& axisTrans) 
     1398  TRY 
    13181399  { 
    13191400    transformationMap_ = axisTrans; 
    13201401  } 
     1402  CATCH_DUMP_ATTR 
    13211403 
    13221404  /* 
     
    13251407  */ 
    13261408  CAxis::TransMapTypes CAxis::getAllTransformations(void) 
     1409  TRY 
    13271410  { 
    13281411    return transformationMap_; 
    13291412  } 
     1413  CATCH_DUMP_ATTR 
    13301414 
    13311415  /* 
     
    13341418  */ 
    13351419  void CAxis::duplicateTransformation(CAxis* src) 
     1420  TRY 
    13361421  { 
    13371422    if (src->hasTransformation()) 
     
    13401425    } 
    13411426  } 
     1427  CATCH_DUMP_ATTR 
    13421428 
    13431429  /*! 
     
    13451431   */ 
    13461432  void CAxis::solveInheritanceTransformation() 
     1433  TRY 
    13471434  { 
    13481435    if (hasTransformation() || !hasDirectAxisReference()) 
     
    13611448        refAxis[i]->setTransformations(axis->getAllTransformations()); 
    13621449  } 
     1450  CATCH_DUMP_ATTR 
    13631451 
    13641452  void CAxis::setContextClient(CContextClient* contextClient) 
     1453  TRY 
    13651454  { 
    13661455    if (clientsSet.find(contextClient)==clientsSet.end()) 
     
    13701459    } 
    13711460  } 
     1461  CATCH_DUMP_ATTR 
    13721462 
    13731463  void CAxis::parse(xml::CXMLNode & node) 
     1464  TRY 
    13741465  { 
    13751466    SuperClass::parse(node); 
     
    14021493    } 
    14031494  } 
     1495  CATCH_DUMP_ATTR 
    14041496 
    14051497  DEFINE_REF_FUNC(Axis,axis) 
  • XIOS/dev/dev_olga/src/node/context.cpp

    r1542 r1612  
    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 
  • XIOS/dev/dev_olga/src/node/context.hpp

    r1542 r1612  
    9191         void initServer(MPI_Comm intraComm, MPI_Comm interComm, CContext* cxtClient = 0); 
    9292         bool isInitialized(void); 
     93 
     94         StdString dumpClassAttributes(void); 
    9395 
    9496         // Put sever or client into loop state 
     
    143145         void distributeFileOverMemoryBandwith() ; 
    144146          
    145  
    146147         // Send context close definition 
    147148         void sendCloseDefinition(void); 
  • XIOS/dev/dev_olga/src/node/domain.cpp

    r1600 r1612  
    5858 
    5959   void CDomain::assignMesh(const StdString meshName, const int nvertex) 
     60   TRY 
    6061   { 
    6162     mesh = CMesh::getMesh(meshName, nvertex); 
    6263   } 
     64   CATCH_DUMP_ATTR 
    6365 
    6466   CDomain* CDomain::createDomain() 
     67   TRY 
    6568   { 
    6669     CDomain* domain = CDomainGroup::get("domain_definition")->createChild(); 
    6770     return domain; 
    6871   } 
     72   CATCH 
    6973 
    7074   std::map<StdString, ETranformationType> CDomain::transformationMapList_ = std::map<StdString, ETranformationType>(); 
     
    7276 
    7377   bool CDomain::initializeTransformationMap(std::map<StdString, ETranformationType>& m) 
     78   TRY 
    7479   { 
    7580     m["zoom_domain"] = TRANS_ZOOM_DOMAIN; 
     
    8186     m["extract_domain"] = TRANS_EXTRACT_DOMAIN; 
    8287   } 
     88   CATCH 
    8389 
    8490   const std::set<StdString> & CDomain::getRelFiles(void) const 
     91   TRY 
    8592   { 
    8693      return (this->relFiles); 
    8794   } 
    88  
     95   CATCH 
    8996 
    9097   /*! 
     
    93100   */ 
    94101   int CDomain::getNumberWrittenIndexes(MPI_Comm writtenCom) 
     102   TRY 
    95103   { 
    96104     int writtenSize; 
     
    98106     return numberWrittenIndexes_[writtenSize]; 
    99107   } 
     108   CATCH_DUMP_ATTR 
    100109 
    101110   /*! 
     
    104113   */ 
    105114   int CDomain::getTotalNumberWrittenIndexes(MPI_Comm writtenCom) 
     115   TRY 
    106116   { 
    107117     int writtenSize; 
     
    109119     return totalNumberWrittenIndexes_[writtenSize]; 
    110120   } 
     121   CATCH_DUMP_ATTR 
    111122 
    112123   /*! 
     
    115126   */ 
    116127   int CDomain::getOffsetWrittenIndexes(MPI_Comm writtenCom) 
     128   TRY 
    117129   { 
    118130     int writtenSize; 
     
    120132     return offsetWrittenIndexes_[writtenSize]; 
    121133   } 
     134   CATCH_DUMP_ATTR 
    122135 
    123136   CArray<int, 1>& CDomain::getCompressedIndexToWriteOnServer(MPI_Comm writtenCom) 
     137   TRY 
    124138   { 
    125139     int writtenSize; 
     
    127141     return compressedIndexToWriteOnServer[writtenSize]; 
    128142   } 
     143   CATCH_DUMP_ATTR 
    129144 
    130145   //---------------------------------------------------------------- 
     
    136151    */ 
    137152   std::map<int, StdSize> CDomain::getAttributesBufferSize(CContextClient* client, bool bufferForWriting /*= false*/) 
     153   TRY 
    138154   { 
    139155 
     
    176192     return attributesSizes; 
    177193   } 
     194   CATCH_DUMP_ATTR 
    178195 
    179196   //---------------------------------------------------------------- 
    180197 
    181198   bool CDomain::isEmpty(void) const 
     199   TRY 
    182200   { 
    183201     return ((this->i_index.isEmpty()) || (0 == this->i_index.numElements())); 
    184202   } 
     203   CATCH 
    185204 
    186205   //---------------------------------------------------------------- 
    187206 
    188207   bool CDomain::IsWritten(const StdString & filename) const 
     208   TRY 
    189209   { 
    190210      return (this->relFiles.find(filename) != this->relFiles.end()); 
    191211   } 
     212   CATCH 
    192213 
    193214   bool CDomain::isWrittenCompressed(const StdString& filename) const 
     215   TRY 
    194216   { 
    195217      return (this->relFilesCompressed.find(filename) != this->relFilesCompressed.end()); 
    196218   } 
     219   CATCH 
    197220 
    198221   //---------------------------------------------------------------- 
    199222 
    200223   bool CDomain::isDistributed(void) const 
     224   TRY 
    201225   { 
    202226      bool distributed =  !((!ni.isEmpty() && (ni == ni_glo) && !nj.isEmpty() && (nj == nj_glo)) || 
     
    206230      return distributed; 
    207231   } 
     232   CATCH 
    208233 
    209234   //---------------------------------------------------------------- 
     
    215240    */ 
    216241   bool CDomain::isCompressible(void) const 
     242   TRY 
    217243   { 
    218244      return isCompressible_; 
    219245   } 
     246   CATCH 
    220247 
    221248   void CDomain::addRelFile(const StdString & filename) 
     249   TRY 
    222250   { 
    223251      this->relFiles.insert(filename); 
    224252   } 
     253   CATCH_DUMP_ATTR 
    225254 
    226255   void CDomain::addRelFileCompressed(const StdString& filename) 
     256   TRY 
    227257   { 
    228258      this->relFilesCompressed.insert(filename); 
    229259   } 
     260   CATCH_DUMP_ATTR 
    230261 
    231262   StdString CDomain::GetName(void)   { return (StdString("domain")); } 
     
    240271   */ 
    241272   bool CDomain::distributionAttributesHaveValue() const 
     273   TRY 
    242274   { 
    243275      bool hasValues = true; 
     
    251283      return hasValues; 
    252284   } 
     285   CATCH 
    253286 
    254287   /*! 
     
    260293   */ 
    261294   void CDomain::redistribute(int nbLocalDomain) 
     295   TRY 
    262296   { 
    263297     if (this->isRedistributed_) return; 
     
    422456     checkDomain(); 
    423457   } 
     458   CATCH_DUMP_ATTR 
    424459 
    425460   /*! 
     
    427462   */ 
    428463   void CDomain::fillInLonLat() 
     464   TRY 
    429465   { 
    430466     switch (type) 
     
    444480     } 
    445481     completeLonLatClient() ; 
    446  
    447    } 
     482   } 
     483   CATCH_DUMP_ATTR 
    448484 
    449485   /*! 
     
    453489   */ 
    454490   void CDomain::fillInRectilinearLonLat() 
     491   TRY 
    455492   { 
    456493     if (!lonvalue_rectilinear_read_from_file.isEmpty() && lonvalue_2d.isEmpty() && lonvalue_1d.isEmpty()) 
     
    462499       lon_end.setValue(lonvalue_rectilinear_read_from_file(ni_glo-1)); 
    463500     } 
    464      else 
     501     else if (!hasLonInReadFile_) 
    465502     { 
    466503       if (!lonvalue_2d.isEmpty()) lonvalue_2d.free(); 
     
    496533       lat_end.setValue(latvalue_rectilinear_read_from_file(nj_glo-1)); 
    497534     } 
    498      else 
     535     else if (!hasLatInReadFile_) 
    499536     { 
    500537       if (!latvalue_2d.isEmpty()) latvalue_1d.free(); 
     
    521558     } 
    522559   } 
     560   CATCH_DUMP_ATTR 
    523561 
    524562    /* 
     
    527565    */ 
    528566   void CDomain::fillInCurvilinearLonLat() 
     567   TRY 
    529568   { 
    530569     if (!lonvalue_curvilinear_read_from_file.isEmpty() && lonvalue_2d.isEmpty() && lonvalue_1d.isEmpty()) 
     
    569608       bounds_latvalue_curvilinear_read_from_file.free(); 
    570609     } 
    571  
    572    } 
     610   } 
     611   CATCH_DUMP_ATTR 
    573612 
    574613    /* 
     
    577616    */ 
    578617   void CDomain::fillInUnstructuredLonLat() 
     618   TRY 
    579619   { 
    580620     if (i_index.isEmpty()) 
     
    628668     } 
    629669   } 
     670   CATCH_DUMP_ATTR 
    630671 
    631672  /* 
     
    633674  */ 
    634675   void CDomain::AllgatherRectilinearLonLat(CArray<double,1>& lon, CArray<double,1>& lat, CArray<double,1>& lon_g, CArray<double,1>& lat_g) 
     676   TRY 
    635677   { 
    636678     CContext* context = CContext::getCurrent(); 
     
    664706      delete[] nj_g ; 
    665707   } 
     708   CATCH_DUMP_ATTR 
    666709 
    667710   void CDomain::fillInRectilinearBoundLonLat(CArray<double,1>& lon, CArray<double,1>& lat, 
    668711                                              CArray<double,2>& boundsLon, CArray<double,2>& boundsLat) 
    669    { 
     712   TRY 
     713  { 
    670714     int i,j,k; 
    671715 
     
    766810      } 
    767811   } 
     812   CATCH_DUMP_ATTR 
    768813 
    769814   /* 
     
    771816   */ 
    772817   void CDomain::checkDomain(void) 
     818   TRY 
    773819   { 
    774820     if (type.isEmpty()) 
     
    862908     } 
    863909   } 
     910   CATCH_DUMP_ATTR 
    864911 
    865912   size_t CDomain::getGlobalWrittenSize(void) 
     
    871918   // Check validity of local domain on using the combination of 3 parameters: ibegin, ni and i_index 
    872919   void CDomain::checkLocalIDomain(void) 
     920   TRY 
    873921   { 
    874922      // If ibegin and ni are provided then we use them to check the validity of local domain 
     
    929977      } 
    930978   } 
     979   CATCH_DUMP_ATTR 
    931980 
    932981   // Check validity of local domain on using the combination of 3 parameters: jbegin, nj and j_index 
    933982   void CDomain::checkLocalJDomain(void) 
     983   TRY 
    934984   { 
    935985    // If jbegin and nj are provided then we use them to check the validity of local domain 
     
    9801030     } 
    9811031   } 
     1032   CATCH_DUMP_ATTR 
    9821033 
    9831034   //---------------------------------------------------------------- 
    9841035 
    9851036   void CDomain::checkMask(void) 
     1037   TRY 
    9861038   { 
    9871039      if (!mask_1d.isEmpty() && !mask_2d.isEmpty()) 
     
    10291081     } 
    10301082   } 
     1083   CATCH_DUMP_ATTR 
    10311084 
    10321085   //---------------------------------------------------------------- 
    10331086 
    10341087   void CDomain::checkDomainData(void) 
     1088   TRY 
    10351089   { 
    10361090      if (data_dim.isEmpty()) 
     
    10721126      } 
    10731127   } 
     1128   CATCH_DUMP_ATTR 
    10741129 
    10751130   //---------------------------------------------------------------- 
    10761131 
    10771132   void CDomain::checkCompression(void) 
     1133   TRY 
    10781134   { 
    10791135     int i,j,ind; 
     
    12021258      } 
    12031259   } 
     1260   CATCH_DUMP_ATTR 
    12041261 
    12051262   //---------------------------------------------------------------- 
    12061263   void CDomain::computeLocalMask(void) 
     1264   TRY 
    12071265   { 
    12081266     localMask.resize(i_index.numElements()) ; 
     
    12361294     } 
    12371295   } 
     1296   CATCH_DUMP_ATTR 
    12381297 
    12391298   void CDomain::checkEligibilityForCompressedOutput(void) 
     1299   TRY 
    12401300   { 
    12411301     // We don't check if the mask or the indexes are valid here, just if they have been defined at this point. 
    12421302     isCompressible_ = !mask_1d.isEmpty() || !mask_2d.isEmpty() || !data_i_index.isEmpty(); 
    12431303   } 
     1304   CATCH_DUMP_ATTR 
    12441305 
    12451306   //---------------------------------------------------------------- 
     
    12501311   */ 
    12511312   void CDomain::completeLonLatClient(void) 
     1313   TRY 
    12521314   { 
    12531315     bool lonlatValueExisted = (0 != lonvalue.numElements()) || (0 != latvalue.numElements()); 
     
    13631425     } 
    13641426   } 
     1427   CATCH_DUMP_ATTR 
    13651428 
    13661429   /* 
     
    13681431   */ 
    13691432   void CDomain::convertLonLatValue(void) 
     1433   TRY 
    13701434   { 
    13711435     bool lonlatValueExisted = (0 != lonvalue.numElements()) || (0 != latvalue.numElements()); 
     
    14651529     } 
    14661530   } 
    1467  
     1531   CATCH_DUMP_ATTR 
    14681532 
    14691533   void CDomain::checkBounds(void) 
     1534   TRY 
    14701535   { 
    14711536     bool hasBoundValues = (0 != bounds_lonvalue.numElements()) || (0 != bounds_latvalue.numElements()); 
     
    15591624     } 
    15601625   } 
     1626   CATCH_DUMP_ATTR 
    15611627 
    15621628   void CDomain::checkArea(void) 
     1629   TRY 
    15631630   { 
    15641631     bool hasAreaValue = (!areavalue.isEmpty() && 0 != areavalue.numElements()); 
     
    15881655     } 
    15891656   } 
     1657   CATCH_DUMP_ATTR 
    15901658 
    15911659   void CDomain::checkLonLat() 
     1660   TRY 
    15921661   { 
    15931662     if (!hasLonLat) hasLonLat = (!latvalue_1d.isEmpty() && !lonvalue_1d.isEmpty()) || 
     
    16491718     } 
    16501719   } 
     1720   CATCH_DUMP_ATTR 
    16511721 
    16521722   void CDomain::checkAttributesOnClientAfterTransformation() 
     1723   TRY 
    16531724   { 
    16541725     CContext* context=CContext::getCurrent() ; 
     
    16651736     this->isClientAfterTransformationChecked = true; 
    16661737   } 
     1738   CATCH_DUMP_ATTR 
    16671739 
    16681740   //---------------------------------------------------------------- 
     
    16701742   // This function only checks all attributes of current domain 
    16711743   void CDomain::checkAttributesOnClient() 
     1744   TRY 
    16721745   { 
    16731746     if (this->isClientChecked) return; 
     
    16951768      this->isClientChecked = true; 
    16961769   } 
     1770   CATCH_DUMP_ATTR 
    16971771 
    16981772   // Send all checked attributes to server 
    16991773   void CDomain::sendCheckedAttributes() 
     1774   TRY 
    17001775   { 
    17011776     if (!this->isClientChecked) checkAttributesOnClient(); 
     
    17101785     this->isChecked = true; 
    17111786   } 
     1787   CATCH_DUMP_ATTR 
    17121788 
    17131789   void CDomain::checkAttributes(void) 
     1790   TRY 
    17141791   { 
    17151792      if (this->isChecked) return; 
     
    17411818      this->isChecked = true; 
    17421819   } 
     1820   CATCH_DUMP_ATTR 
    17431821 
    17441822  /*! 
     
    17491827  */ 
    17501828  void CDomain::computeConnectedClients() 
     1829  TRY 
    17511830  { 
    17521831    CContext* context=CContext::getCurrent() ; 
     
    18761955    } 
    18771956  } 
     1957  CATCH_DUMP_ATTR 
    18781958 
    18791959   /*! 
     
    18831963   */ 
    18841964   void CDomain::computeWrittenIndex() 
     1965   TRY 
    18851966   {   
    18861967      if (computedWrittenIndex_) return; 
     
    19202001      } 
    19212002   } 
     2003   CATCH_DUMP_ATTR 
    19222004 
    19232005  void CDomain::computeWrittenCompressedIndex(MPI_Comm writtenComm) 
     2006  TRY 
    19242007  { 
    19252008    int writtenCommSize; 
     
    19892072      } 
    19902073  } 
     2074  CATCH_DUMP_ATTR 
    19912075 
    19922076  /*! 
     
    19952079  */ 
    19962080  void CDomain::sendAttributes() 
     2081  TRY 
    19972082  { 
    19982083    sendDistributionAttributes(); 
     
    20022087    sendDataIndex(); 
    20032088  } 
    2004  
     2089  CATCH 
    20052090  /*! 
    20062091    Send global index from client to connected client(s) 
    20072092  */ 
    20082093  void CDomain::sendIndex() 
     2094  TRY 
    20092095  { 
    20102096    int ns, n, i, j, ind, nv, idx; 
     
    20492135    } 
    20502136  } 
     2137  CATCH_DUMP_ATTR 
    20512138 
    20522139  /*! 
     
    20562143  */ 
    20572144  void CDomain::sendDistributionAttributes(void) 
     2145  TRY 
    20582146  { 
    20592147    std::list<CContextClient*>::iterator it; 
     
    21022190    } 
    21032191  } 
     2192  CATCH_DUMP_ATTR 
    21042193 
    21052194  /*! 
     
    21072196  */ 
    21082197  void CDomain::sendArea() 
     2198  TRY 
    21092199  { 
    21102200    if (!hasArea) return; 
     
    21502240    } 
    21512241  } 
     2242  CATCH_DUMP_ATTR 
    21522243 
    21532244  /*! 
     
    21572248  */ 
    21582249  void CDomain::sendLonLat() 
     2250  TRY 
    21592251  { 
    21602252    if (!hasLonLat) return; 
     
    22452337    } 
    22462338  } 
     2339  CATCH_DUMP_ATTR 
    22472340 
    22482341  /*! 
     
    22532346  */ 
    22542347  void CDomain::sendDataIndex() 
     2348  TRY 
    22552349  { 
    22562350    int ns, n, i, j, ind, nv, idx; 
     
    23212415    } 
    23222416  } 
     2417  CATCH 
    23232418   
    23242419  bool CDomain::dispatchEvent(CEventServer& event) 
     2420  TRY 
    23252421  { 
    23262422    if (SuperClass::dispatchEvent(event)) return true; 
     
    23602456    } 
    23612457  } 
     2458  CATCH 
    23622459 
    23632460  /*! 
     
    23662463  */ 
    23672464  void CDomain::recvIndex(CEventServer& event) 
     2465  TRY 
    23682466  { 
    23692467    string domainId; 
     
    23792477    get(domainId)->recvIndex(rankBuffers); 
    23802478  } 
     2479  CATCH 
    23812480 
    23822481  /*! 
     
    23862485  */ 
    23872486  void CDomain::recvIndex(std::map<int, CBufferIn*>& rankBuffers) 
     2487  TRY 
    23882488  { 
    23892489    int nbReceived = rankBuffers.size(), i, ind, index, type_int, iIndex, jIndex; 
     
    24452545    domainMask.resize(0); // Mask is not defined anymore on servers 
    24462546  } 
     2547  CATCH 
    24472548 
    24482549  /*! 
     
    24512552  */ 
    24522553  void CDomain::recvDistributionAttributes(CEventServer& event) 
     2554  TRY 
    24532555  { 
    24542556    CBufferIn* buffer=event.subEvents.begin()->buffer; 
     
    24572559    get(domainId)->recvDistributionAttributes(*buffer); 
    24582560  } 
     2561  CATCH 
    24592562 
    24602563  /*! 
     
    24642567  */ 
    24652568  void CDomain::recvDistributionAttributes(CBufferIn& buffer) 
     2569  TRY 
    24662570  { 
    24672571    int ni_tmp, ibegin_tmp, nj_tmp, jbegin_tmp; 
     
    24792583 
    24802584  } 
    2481  
     2585 CATCH_DUMP_ATTR 
    24822586  /*! 
    24832587    Receive longitude event from clients(s) 
     
    24852589  */ 
    24862590  void CDomain::recvLon(CEventServer& event) 
     2591  TRY 
    24872592  { 
    24882593    string domainId; 
     
    24982603    get(domainId)->recvLon(rankBuffers); 
    24992604  } 
     2605  CATCH 
    25002606 
    25012607  /*! 
     
    25042610  */ 
    25052611  void CDomain::recvLon(std::map<int, CBufferIn*>& rankBuffers) 
     2612  TRY 
    25062613  { 
    25072614    int nbReceived = rankBuffers.size(), i, ind, index, iindex, jindex, lInd; 
     
    25632670    } 
    25642671  } 
     2672  CATCH_DUMP_ATTR 
    25652673 
    25662674  /*! 
     
    25692677  */ 
    25702678  void CDomain::recvLat(CEventServer& event) 
     2679  TRY 
    25712680  { 
    25722681    string domainId; 
     
    25822691    get(domainId)->recvLat(rankBuffers); 
    25832692  } 
     2693  CATCH 
    25842694 
    25852695  /*! 
     
    25882698  */ 
    25892699  void CDomain::recvLat(std::map<int, CBufferIn*>& rankBuffers) 
     2700  TRY 
    25902701  { 
    25912702    int nbReceived = rankBuffers.size(), i, ind, index, iindex, jindex, lInd; 
     
    26492760    } 
    26502761  } 
     2762  CATCH_DUMP_ATTR 
    26512763 
    26522764  /*! 
     
    26552767  */ 
    26562768  void CDomain::recvArea(CEventServer& event) 
     2769  TRY 
    26572770  { 
    26582771    string domainId; 
     
    26682781    get(domainId)->recvArea(rankBuffers); 
    26692782  } 
     2783  CATCH 
    26702784 
    26712785  /*! 
     
    26742788  */ 
    26752789  void CDomain::recvArea(std::map<int, CBufferIn*>& rankBuffers) 
     2790  TRY 
    26762791  { 
    26772792    int nbReceived = rankBuffers.size(), i, ind, index, lInd; 
     
    27192834    } 
    27202835  } 
     2836  CATCH_DUMP_ATTR 
    27212837 
    27222838  /*! 
     
    27282844  */ 
    27292845  bool CDomain::isEqual(CDomain* obj) 
     2846  TRY 
    27302847  { 
    27312848    vector<StdString> excludedAttr; 
     
    27502867    return objEqual; 
    27512868  } 
     2869  CATCH_DUMP_ATTR 
    27522870 
    27532871  /*! 
     
    27562874  */ 
    27572875  void CDomain::recvDataIndex(CEventServer& event) 
     2876  TRY 
    27582877  { 
    27592878    string domainId; 
     
    27692888    get(domainId)->recvDataIndex(rankBuffers); 
    27702889  } 
     2890  CATCH 
    27712891 
    27722892  /*! 
     
    27802900  */ 
    27812901  void CDomain::recvDataIndex(std::map<int, CBufferIn*>& rankBuffers) 
     2902  TRY 
    27822903  { 
    27832904    int nbReceived = rankBuffers.size(), i, ind, index, indexI, indexJ, type_int, lInd;     
     
    28462967    data_jbegin.setValue(0); 
    28472968  } 
     2969  CATCH_DUMP_ATTR 
    28482970 
    28492971  CTransformation<CDomain>* CDomain::addTransformation(ETranformationType transType, const StdString& id) 
     2972  TRY 
    28502973  { 
    28512974    transformationMap_.push_back(std::make_pair(transType, CTransformation<CDomain>::createTransformation(transType,id))); 
    28522975    return transformationMap_.back().second; 
    28532976  } 
     2977  CATCH_DUMP_ATTR 
    28542978 
    28552979  /*! 
     
    28582982  */ 
    28592983  bool CDomain::hasTransformation() 
     2984  TRY 
    28602985  { 
    28612986    return (!transformationMap_.empty()); 
    28622987  } 
     2988  CATCH_DUMP_ATTR 
    28632989 
    28642990  /*! 
     
    28672993  */ 
    28682994  void CDomain::setTransformations(const TransMapTypes& domTrans) 
     2995  TRY 
    28692996  { 
    28702997    transformationMap_ = domTrans; 
    28712998  } 
     2999  CATCH_DUMP_ATTR 
    28723000 
    28733001  /*! 
     
    28763004  */ 
    28773005  CDomain::TransMapTypes CDomain::getAllTransformations(void) 
     3006  TRY 
    28783007  { 
    28793008    return transformationMap_; 
    28803009  } 
     3010  CATCH_DUMP_ATTR 
    28813011 
    28823012  void CDomain::duplicateTransformation(CDomain* src) 
     3013  TRY 
    28833014  { 
    28843015    if (src->hasTransformation()) 
     
    28873018    } 
    28883019  } 
     3020  CATCH_DUMP_ATTR 
    28893021 
    28903022  /*! 
     
    28923024   */ 
    28933025  void CDomain::solveInheritanceTransformation() 
     3026  TRY 
    28943027  { 
    28953028    if (hasTransformation() || !hasDirectDomainReference()) 
     
    29083041        refDomains[i]->setTransformations(domain->getAllTransformations()); 
    29093042  } 
     3043  CATCH_DUMP_ATTR 
    29103044 
    29113045  void CDomain::setContextClient(CContextClient* contextClient) 
     3046  TRY 
    29123047  { 
    29133048    if (clientsSet.find(contextClient)==clientsSet.end()) 
     
    29173052    } 
    29183053  } 
     3054  CATCH_DUMP_ATTR 
    29193055 
    29203056  /*! 
     
    29243060  */ 
    29253061  void CDomain::parse(xml::CXMLNode & node) 
     3062  TRY 
    29263063  { 
    29273064    SuperClass::parse(node); 
     
    29543091    } 
    29553092  } 
     3093  CATCH_DUMP_ATTR 
    29563094   //---------------------------------------------------------------- 
    29573095 
  • XIOS/dev/dev_olga/src/node/field.cpp

    r1594 r1612  
    7171 
    7272   void CField::setVirtualVariableGroup(CVariableGroup* newVVariableGroup) 
     73   TRY 
    7374   { 
    7475      this->vVariableGroup = newVVariableGroup; 
    7576   } 
     77   CATCH 
    7678 
    7779   CVariableGroup* CField::getVirtualVariableGroup(void) const 
     80   TRY 
    7881   { 
    7982      return this->vVariableGroup; 
    8083   } 
     84   CATCH 
    8185 
    8286   std::vector<CVariable*> CField::getAllVariables(void) const 
     87   TRY 
    8388   { 
    8489      return this->vVariableGroup->getAllChildren(); 
    8590   } 
     91   CATCH 
    8692 
    8793   void CField::solveDescInheritance(bool apply, const CAttributeMap* const parent) 
     94   TRY 
    8895   { 
    8996      SuperClassAttribute::setAttributes(parent, apply); 
    9097      this->getVirtualVariableGroup()->solveDescInheritance(apply, NULL); 
    9198   } 
     99   CATCH_DUMP_ATTR 
    92100 
    93101  //---------------------------------------------------------------- 
    94102 
    95103  bool CField::dispatchEvent(CEventServer& event) 
     104  TRY 
    96105  { 
    97106    if (SuperClass::dispatchEvent(event)) return true; 
     
    131140    } 
    132141  } 
     142  CATCH 
    133143 
    134144  void CField::sendUpdateData(const CArray<double,1>& data) 
     145  TRY 
    135146  { 
    136147    CTimer::get("Field : send data").resume(); 
     
    189200    CTimer::get("Field : send data").suspend(); 
    190201  } 
     202  CATCH_DUMP_ATTR 
    191203 
    192204  void CField::recvUpdateData(CEventServer& event) 
     205  TRY 
    193206  { 
    194207    std::map<int,CBufferIn*> rankBuffers; 
     
    207220    CTimer::get("Field : recv data").suspend(); 
    208221  } 
     222  CATCH 
    209223 
    210224  void  CField::recvUpdateData(std::map<int,CBufferIn*>& rankBuffers) 
     225  TRY 
    211226  { 
    212227    CContext* context = CContext::getCurrent(); 
     
    249264    recvDataSrv.reset() ; 
    250265  } 
     266  CATCH_DUMP_ATTR 
    251267 
    252268  void CField::writeUpdateData(const CArray<double,1>& data) 
     269  TRY 
    253270  { 
    254271    CContext* context = CContext::getCurrent(); 
     
    277294    } 
    278295  } 
     296  CATCH_DUMP_ATTR 
    279297 
    280298  void CField::writeField(void) 
     299  TRY 
    281300  { 
    282301    if (!getRelFile()->isEmptyZone()) 
     
    290309    } 
    291310  } 
     311  CATCH_DUMP_ATTR 
    292312 
    293313  /* 
     
    299319  */ 
    300320  bool CField::sendReadDataRequest(const CDate& tsDataRequested) 
     321  TRY 
    301322  { 
    302323    CContext* context = CContext::getCurrent(); 
     
    330351    return !isEOF; 
    331352  } 
     353  CATCH_DUMP_ATTR 
    332354 
    333355  /*! 
     
    336358  */ 
    337359  bool CField::sendReadDataRequestIfNeeded(void) 
     360  TRY 
    338361  { 
    339362    const CDate& currentDate = CContext::getCurrent()->getCalendar()->getCurrentDate(); 
     
    353376    return dataRequested; 
    354377  } 
     378  CATCH_DUMP_ATTR 
    355379 
    356380  void CField::recvReadDataRequest(CEventServer& event) 
     381  TRY 
    357382  { 
    358383    CBufferIn* buffer = event.subEvents.begin()->buffer; 
     
    361386    get(fieldId)->recvReadDataRequest(); 
    362387  } 
     388  CATCH 
    363389 
    364390  /*! 
     
    369395  */ 
    370396  void CField::recvReadDataRequest(void) 
     397  TRY 
    371398  { 
    372399    CContext* context = CContext::getCurrent(); 
     
    449476    } 
    450477  } 
     478  CATCH_DUMP_ATTR 
    451479 
    452480  /*! 
     
    456484  */ 
    457485  CField::EReadField CField::readField(void) 
     486  TRY 
    458487  { 
    459488    CContext* context = CContext::getCurrent(); 
     
    508537    return readState; 
    509538  } 
     539  CATCH_DUMP_ATTR 
    510540 
    511541  /* 
     
    516546  */ 
    517547  void CField::recvReadDataReady(CEventServer& event) 
     548  TRY 
    518549  { 
    519550    string fieldId; 
     
    531562    get(fieldId)->recvReadDataReady(ranks, buffers); 
    532563  } 
     564  CATCH 
    533565 
    534566  /*! 
     
    538570  */ 
    539571  void CField::recvReadDataReady(vector<int> ranks, vector<CBufferIn*> buffers) 
     572  TRY 
    540573  { 
    541574    CContext* context = CContext::getCurrent(); 
     
    574607      serverSourceFilter->streamDataFromServer(lastDataReceivedFromServer, data); 
    575608  } 
     609  CATCH_DUMP_ATTR 
    576610 
    577611  void CField::checkForLateDataFromServer(void) 
     612  TRY 
    578613  { 
    579614    CContext* context = CContext::getCurrent(); 
     
    607642    } 
    608643  } 
     644  CATCH_DUMP_ATTR 
    609645 
    610646  void CField::checkIfMustAutoTrigger(void) 
     647  TRY 
    611648  { 
    612649    mustAutoTrigger = serverSourceFilter ? serverSourceFilter->mustAutoTrigger() : false; 
    613650  } 
     651  CATCH_DUMP_ATTR 
    614652 
    615653  void CField::autoTriggerIfNeeded(void) 
     654  TRY 
    616655  { 
    617656    if (mustAutoTrigger) 
    618657      serverSourceFilter->trigger(CContext::getCurrent()->getCalendar()->getCurrentDate()); 
    619658  } 
     659  CATCH_DUMP_ATTR 
    620660 
    621661   //---------------------------------------------------------------- 
    622662 
    623663   void CField::setRelFile(CFile* _file) 
     664   TRY 
    624665   { 
    625666      this->file = _file; 
    626667      hasOutputFile = true; 
    627668   } 
     669   CATCH_DUMP_ATTR 
    628670 
    629671   //---------------------------------------------------------------- 
     
    636678 
    637679   CGrid* CField::getRelGrid(void) const 
     680   TRY 
    638681   { 
    639682      return this->grid; 
    640683   } 
     684   CATCH 
    641685 
    642686   //---------------------------------------------------------------- 
    643687 
    644688   CFile* CField::getRelFile(void) const 
     689   TRY 
    645690   { 
    646691      return this->file; 
    647692   } 
     693   CATCH 
    648694 
    649695   int CField::getNStep(void) const 
     696   TRY 
    650697   { 
    651698      return this->nstep; 
    652699   } 
     700   CATCH 
    653701 
    654702   func::CFunctor::ETimeType CField::getOperationTimeType() const 
     703   TRY 
    655704   { 
    656705     return operationTimeType; 
    657706   } 
     707   CATCH 
    658708 
    659709   //---------------------------------------------------------------- 
    660710 
    661711   void CField::incrementNStep(void) 
     712   TRY 
    662713   { 
    663714      this->nstep++; 
    664715   } 
     716   CATCH_DUMP_ATTR 
    665717 
    666718   void CField::resetNStep(int nstep /*= 0*/) 
     719   TRY 
    667720   { 
    668721      this->nstep = nstep; 
    669722   } 
     723   CATCH_DUMP_ATTR 
    670724 
    671725   void CField::resetNStepMax(void) 
     726   TRY 
    672727   { 
    673728      this->nstepMax = 0; 
    674729      nstepMaxRead = false; 
    675730   } 
     731   CATCH_DUMP_ATTR 
    676732 
    677733   //---------------------------------------------------------------- 
    678734 
    679735   bool CField::isActive(bool atCurrentTimestep /*= false*/) const 
     736   TRY 
    680737   { 
    681738      if (clientSourceFilter) 
     
    689746      return false; 
    690747   } 
     748   CATCH 
    691749 
    692750   //---------------------------------------------------------------- 
    693751 
    694752   bool CField::wasWritten() const 
     753   TRY 
    695754   { 
    696755     return written; 
    697756   } 
     757   CATCH 
    698758 
    699759   void CField::setWritten() 
     760   TRY 
    700761   { 
    701762     written = true; 
    702763   } 
     764   CATCH_DUMP_ATTR 
    703765 
    704766   //---------------------------------------------------------------- 
    705767 
    706768   bool CField::getUseCompressedOutput() const 
     769   TRY 
    707770   { 
    708771     return useCompressedOutput; 
    709772   } 
     773   CATCH 
    710774 
    711775   void CField::setUseCompressedOutput() 
     776   TRY 
    712777   { 
    713778     useCompressedOutput = true; 
    714779   } 
     780   CATCH_DUMP_ATTR 
    715781 
    716782   //---------------------------------------------------------------- 
    717783 
    718784   std::shared_ptr<COutputPin> CField::getInstantDataFilter() 
     785   TRY 
    719786   { 
    720787     return instantDataFilter; 
    721788   } 
     789   CATCH_DUMP_ATTR 
    722790 
    723791   //---------------------------------------------------------------- 
     
    728796   */ 
    729797   void CField::buildGridTransformationGraph() 
     798   TRY 
    730799   { 
    731800     CContext* context = CContext::getCurrent(); 
     
    738807     } 
    739808   } 
     809   CATCH_DUMP_ATTR 
    740810 
    741811   /*! 
     
    743813   */ 
    744814   void CField::generateNewTransformationGridDest() 
     815   TRY 
    745816   { 
    746817     CContext* context = CContext::getCurrent(); 
     
    797868     } 
    798869   } 
     870   CATCH_DUMP_ATTR 
    799871 
    800872   void CField::updateRef(CGrid* grid) 
     873   TRY 
    801874   { 
    802875     if (!grid_ref.isEmpty()) grid_ref.setValue(grid->getId()); 
     
    820893     } 
    821894   } 
     895   CATCH_DUMP_ATTR 
    822896    
    823897   /*! 
     
    826900   */ 
    827901   void CField::solveAllEnabledFieldsAndTransform() 
     902   TRY 
    828903   { 
    829904     CContext* context = CContext::getCurrent(); 
     
    862937     } 
    863938   } 
     939   CATCH_DUMP_ATTR 
    864940 
    865941   void CField::checkGridOfEnabledFields() 
     942   TRY 
    866943   { 
    867944     if (!isGridChecked) 
     
    871948     } 
    872949   } 
     950   CATCH_DUMP_ATTR 
    873951 
    874952   void CField::sendGridComponentOfEnabledFields() 
     953   TRY 
    875954   { 
    876955      solveGridDomainAxisRef(true); 
    877956      // solveCheckMaskIndex(true); 
    878957   } 
     958   CATCH_DUMP_ATTR 
    879959 
    880960   void CField::sendGridOfEnabledFields() 
     961   TRY 
    881962   { 
    882963      // solveGridDomainAxisRef(true); 
    883964      solveCheckMaskIndex(true); 
    884965   }    
     966   CATCH_DUMP_ATTR 
    885967 
    886968   void CField::solveOnlyReferenceEnabledField(bool doSending2Server) 
     969   TRY 
    887970   { 
    888971     CContext* context = CContext::getCurrent(); 
     
    910993     } 
    911994   } 
    912       
     995   CATCH_DUMP_ATTR 
     996 
    913997   void CField::solveAllReferenceEnabledField(bool doSending2Server) 
     998   TRY 
    914999   { 
    9151000     CContext* context = CContext::getCurrent(); 
     
    9401025     solveCheckMaskIndex(doSending2Server); 
    9411026   } 
     1027   CATCH_DUMP_ATTR 
    9421028 
    9431029   std::map<int, StdSize> CField::getGridAttributesBufferSize(CContextClient* client, bool bufferForWriting /*= "false"*/) 
     1030   TRY 
    9441031   { 
    9451032     return grid->getAttributesBufferSize(client, bufferForWriting); 
    9461033   } 
     1034   CATCH_DUMP_ATTR 
    9471035 
    9481036   std::map<int, StdSize> CField::getGridDataBufferSize(CContextClient* client, bool bufferForWriting /*= "false"*/) 
     1037   TRY 
    9491038   { 
    9501039     return grid->getDataBufferSize(client, getId(), bufferForWriting); 
    9511040   } 
     1041   CATCH_DUMP_ATTR 
    9521042 
    9531043   size_t CField::getGlobalWrittenSize() 
     1044   TRY 
    9541045   { 
    9551046     return grid->getGlobalWrittenSize(); 
    9561047   } 
     1048   CATCH_DUMP_ATTR 
    9571049 
    9581050   //---------------------------------------------------------------- 
    9591051 
    9601052   void CField::solveServerOperation(void) 
     1053   TRY 
    9611054   { 
    9621055      CContext* context = CContext::getCurrent(); 
     
    10011094      operationTimeType = functor->timeType(); 
    10021095   } 
     1096   CATCH_DUMP_ATTR 
    10031097 
    10041098   //---------------------------------------------------------------- 
     
    10131107    */ 
    10141108   void CField::buildFilterGraph(CGarbageCollector& gc, bool enableOutput) 
     1109   TRY 
    10151110   {      
    10161111    if (!isReferenceSolvedAndTransformed) solveAllEnabledFieldsAndTransform(); 
     
    11181213     } 
    11191214   } 
     1215   CATCH_DUMP_ATTR 
    11201216 
    11211217   /*! 
     
    11271223    */ 
    11281224   std::shared_ptr<COutputPin> CField::getFieldReference(CGarbageCollector& gc) 
     1225   TRY 
    11291226   { 
    11301227     if (instantDataFilter || field_ref.isEmpty()) 
     
    11501247     return filters.second; 
    11511248   } 
     1249   CATCH_DUMP_ATTR 
    11521250 
    11531251   /*! 
     
    11611259    */ 
    11621260   std::shared_ptr<COutputPin> CField::getSelfReference(CGarbageCollector& gc) 
     1261   TRY 
    11631262   { 
    11641263     if (instantDataFilter || !hasExpression()) 
     
    12031302     return selfReferenceFilter; 
    12041303   } 
     1304   CATCH_DUMP_ATTR 
    12051305 
    12061306   /*! 
     
    12141314    */ 
    12151315   std::shared_ptr<COutputPin> CField::getTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq) 
     1316   TRY 
    12161317   { 
    12171318     std::map<CDuration, std::shared_ptr<COutputPin> >::iterator it = temporalDataFilters.find(outFreq); 
     
    12371338     return it->second; 
    12381339   } 
     1340   CATCH_DUMP_ATTR 
    12391341 
    12401342  /*! 
     
    12481350    
    12491351   std::shared_ptr<COutputPin> CField::getSelfTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq) 
     1352   TRY 
    12501353   { 
    12511354     if (instantDataFilter || !hasExpression()) 
     
    12781381     } 
    12791382  } 
     1383   CATCH_DUMP_ATTR 
    12801384 
    12811385   //---------------------------------------------------------------- 
     
    12961400 
    12971401   void CField::solveGridReference(void) 
     1402   TRY 
    12981403   { 
    12991404      if (grid_ref.isEmpty() && domain_ref.isEmpty() && axis_ref.isEmpty() && scalar_ref.isEmpty()) 
     
    13791484      } 
    13801485   } 
     1486   CATCH_DUMP_ATTR 
    13811487 
    13821488   void CField::solveGridDomainAxisRef(bool checkAtt) 
     1489   TRY 
    13831490   { 
    13841491     grid->solveDomainAxisRef(checkAtt); 
    13851492   } 
     1493   CATCH_DUMP_ATTR 
    13861494 
    13871495   void CField::solveCheckMaskIndex(bool doSendingIndex) 
     1496   TRY 
    13881497   { 
    13891498     grid->checkMaskIndex(doSendingIndex); 
    13901499   } 
     1500   CATCH_DUMP_ATTR 
    13911501 
    13921502   void CField::solveTransformedGrid() 
     1503   TRY 
    13931504   { 
    13941505     if (grid && !grid->isTransformed() && hasDirectFieldReference() && grid != getDirectFieldReference()->grid) 
     
    14391550     } 
    14401551   } 
     1552   CATCH_DUMP_ATTR 
    14411553 
    14421554   void CField::solveGenerateGrid() 
     1555   TRY 
    14431556   { 
    14441557     if (grid && !grid->isTransformed() && hasDirectFieldReference() && grid != getDirectFieldReference()->grid) 
     
    14471560       grid->completeGrid(); 
    14481561   } 
     1562   CATCH_DUMP_ATTR 
    14491563 
    14501564   void CField::solveGridDomainAxisBaseRef() 
     1565   TRY 
    14511566   { 
    14521567     grid->solveDomainAxisRef(false); 
    14531568     grid->solveDomainAxisBaseRef(); 
    14541569   } 
     1570   CATCH_DUMP_ATTR 
    14551571 
    14561572   ///------------------------------------------------------------------- 
     
    14581574   template <> 
    14591575   void CGroupTemplate<CField, CFieldGroup, CFieldAttributes>::solveRefInheritance(void) 
     1576   TRY 
    14601577   { 
    14611578      if (this->group_ref.isEmpty()) return; 
     
    14811598      } 
    14821599   } 
     1600   CATCH_DUMP_ATTR 
    14831601 
    14841602   void CField::scaleFactorAddOffset(double scaleFactor, double addOffset) 
     1603   TRY 
    14851604   { 
    14861605     recvDataSrv = (recvDataSrv - addOffset) / scaleFactor; 
    14871606   } 
     1607   CATCH_DUMP_ATTR 
    14881608 
    14891609   void CField::invertScaleFactorAddOffset(double scaleFactor, double addOffset) 
     1610   TRY 
    14901611   { 
    14911612     recvDataSrv = recvDataSrv * scaleFactor + addOffset; 
    14921613   } 
     1614   CATCH_DUMP_ATTR 
    14931615 
    14941616   void CField::outputField(CArray<double,1>& fieldOut) 
     1617   TRY 
    14951618   {  
    14961619      CArray<size_t,1>& outIndexClient = grid->localIndexToWriteOnClient; 
     
    15011624      } 
    15021625   } 
     1626   CATCH_DUMP_ATTR 
    15031627 
    15041628   void CField::inputField(CArray<double,1>& fieldIn) 
     1629   TRY 
    15051630   { 
    15061631      CArray<size_t,1>& outIndexClient = grid->localIndexToWriteOnClient; 
     
    15101635        recvDataSrv(outIndexClient(idx)) = fieldIn(outIndexServer(idx)); 
    15111636      } 
    1512  
    1513    } 
     1637   } 
     1638   CATCH_DUMP_ATTR 
    15141639 
    15151640   void CField::outputCompressedField(CArray<double,1>& fieldOut) 
     1641   TRY 
    15161642   { 
    15171643      CArray<size_t,1>& outIndexClient = grid->localIndexToWriteOnClient; 
     
    15221648      } 
    15231649   } 
     1650   CATCH_DUMP_ATTR 
    15241651 
    15251652   ///------------------------------------------------------------------- 
    15261653 
    15271654   void CField::parse(xml::CXMLNode& node) 
     1655   TRY 
    15281656   { 
    15291657      string newContent ; 
     
    15401668      if (node.getContent(newContent)) content=newContent ; 
    15411669    } 
     1670   CATCH_DUMP_ATTR 
    15421671 
    15431672   /*! 
     
    15471676   */ 
    15481677   const std::vector<StdString>& CField::getRefDomainAxisIds() 
     1678   TRY 
    15491679   { 
    15501680     CGrid* cgPtr = getRelGrid(); 
     
    15751705     return (domAxisScalarIds_); 
    15761706   } 
     1707   CATCH_DUMP_ATTR 
    15771708 
    15781709   CVariable* CField::addVariable(const string& id) 
     1710   TRY 
    15791711   { 
    15801712     return vVariableGroup->createChild(id); 
    15811713   } 
     1714   CATCH 
    15821715 
    15831716   CVariableGroup* CField::addVariableGroup(const string& id) 
     1717   TRY 
    15841718   { 
    15851719     return vVariableGroup->createChildGroup(id); 
    15861720   } 
     1721   CATCH 
    15871722 
    15881723   void CField::setContextClient(CContextClient* contextClient) 
     1724   TRY 
    15891725   { 
    15901726     CContext* context = CContext::getCurrent(); 
     
    16021738     } 
    16031739   } 
     1740   CATCH_DUMP_ATTR 
    16041741 
    16051742   CContextClient* CField::getContextClient() 
     1743   TRY 
    16061744   { 
    16071745     return client; 
    16081746   } 
     1747   CATCH 
    16091748 
    16101749   void CField::sendAddAllVariables(CContextClient* client) 
     1750   TRY 
    16111751   { 
    16121752     std::vector<CVariable*> allVar = getAllVariables(); 
     
    16211761     } 
    16221762   } 
    1623  
     1763   CATCH_DUMP_ATTR 
    16241764 
    16251765   /*! 
     
    16291769     
    16301770   void CField::sendAllAttributesToServer(CContextClient* client) 
     1771   TRY 
    16311772   { 
    16321773     if (grid_ref.isEmpty()) 
     
    16381779     else SuperClass::sendAllAttributesToServer(client) ; 
    16391780   } 
     1781   CATCH_DUMP_ATTR 
    16401782     
    16411783   void CField::sendAddVariable(const string& id, CContextClient* client) 
     1784   TRY 
    16421785   { 
    16431786      sendAddItem(id, (int)EVENT_ID_ADD_VARIABLE, client); 
    16441787   } 
     1788   CATCH_DUMP_ATTR 
    16451789 
    16461790   void CField::sendAddVariableGroup(const string& id, CContextClient* client) 
     1791   TRY 
    16471792   { 
    16481793      sendAddItem(id, (int)EVENT_ID_ADD_VARIABLE_GROUP, client); 
    16491794   } 
     1795   CATCH_DUMP_ATTR 
    16501796 
    16511797   void CField::recvAddVariable(CEventServer& event) 
     1798   TRY 
    16521799   { 
    16531800 
     
    16571804      get(id)->recvAddVariable(*buffer); 
    16581805   } 
     1806   CATCH 
    16591807 
    16601808   void CField::recvAddVariable(CBufferIn& buffer) 
     1809   TRY 
    16611810   { 
    16621811      string id; 
     
    16641813      addVariable(id); 
    16651814   } 
     1815   CATCH_DUMP_ATTR 
    16661816 
    16671817   void CField::recvAddVariableGroup(CEventServer& event) 
     1818   TRY 
    16681819   { 
    16691820 
     
    16731824      get(id)->recvAddVariableGroup(*buffer); 
    16741825   } 
     1826   CATCH 
    16751827 
    16761828   void CField::recvAddVariableGroup(CBufferIn& buffer) 
     1829   TRY 
    16771830   { 
    16781831      string id; 
     
    16801833      addVariableGroup(id); 
    16811834   } 
     1835   CATCH_DUMP_ATTR 
    16821836 
    16831837   /*! 
     
    16851839    */ 
    16861840   void CField::checkTimeAttributes(CDuration* freqOp) 
     1841   TRY 
    16871842   { 
    16881843     bool isFieldRead  = file && !file->mode.isEmpty() && file->mode == CFile::mode_attr::read; 
     
    17061861       freq_offset.setValue(isFieldRead ? NoneDu : (freq_op.getValue() - TimeStep)); 
    17071862   } 
     1863   CATCH_DUMP_ATTR 
    17081864 
    17091865   /*! 
     
    17121868    */ 
    17131869   const string& CField::getExpression(void) 
     1870   TRY 
    17141871   { 
    17151872     if (!expr.isEmpty() && content.empty()) 
     
    17211878     return content; 
    17221879   } 
     1880   CATCH_DUMP_ATTR 
    17231881 
    17241882   bool CField::hasExpression(void) const 
     1883   TRY 
    17251884   { 
    17261885     return (!expr.isEmpty() || !content.empty()); 
    17271886   } 
     1887   CATCH 
    17281888 
    17291889   bool CField::hasGridMask(void) const 
     1890   TRY 
    17301891   { 
    17311892     return (this->grid->hasMask()); 
    17321893   } 
     1894   CATCH 
    17331895 
    17341896   DEFINE_REF_FUNC(Field,field) 
  • XIOS/dev/dev_olga/src/node/file.cpp

    r1542 r1612  
    5353 
    5454   const StdString CFile::getFileOutputName(void) const 
     55   TRY 
    5556   { 
    5657     return (name.isEmpty() ? getId() : name) + (name_suffix.isEmpty() ? StdString("") :  name_suffix.getValue()); 
    5758   } 
     59   CATCH 
    5860 
    5961   //---------------------------------------------------------------- 
     
    6567   */ 
    6668   std::shared_ptr<CDataOutput> CFile::getDataOutput(void) const 
     69   TRY 
    6770   { 
    6871      return data_out; 
    6972   } 
     73   CATCH 
    7074 
    7175   /*! 
     
    7680   */ 
    7781   std::shared_ptr<CDataInput> CFile::getDataInput(void) const 
     82   TRY 
    7883   { 
    7984      return data_in; 
    8085   } 
     86   CATCH 
    8187 
    8288   /*! 
     
    8894   */ 
    8995   CFieldGroup* CFile::getVirtualFieldGroup(void) const 
     96   TRY 
    9097   { 
    9198      return (this->vFieldGroup); 
    9299   } 
     100   CATCH 
    93101 
    94102   /*! 
     
    100108   */ 
    101109   CVariableGroup* CFile::getVirtualVariableGroup(void) const 
     110   TRY 
    102111   { 
    103112      return (this->vVariableGroup); 
    104113   } 
     114   CATCH 
    105115 
    106116   //! Get all fields of a file 
    107117   std::vector<CField*> CFile::getAllFields(void) const 
     118   TRY 
    108119   { 
    109120      return (this->vFieldGroup->getAllChildren()); 
    110121   } 
     122   CATCH 
    111123 
    112124   //! Get all variables of a file 
    113125   std::vector<CVariable*> CFile::getAllVariables(void) const 
     126   TRY 
    114127   { 
    115128      return (this->vVariableGroup->getAllChildren()); 
    116129   } 
     130   CATCH 
    117131 
    118132   //---------------------------------------------------------------- 
     
    129143                                                int default_level, 
    130144                                                bool default_enabled) 
     145   TRY 
    131146   { 
    132147      if (!this->enabledFields.empty()) 
     
    145160         { 
    146161            if (! (*it)->enabled.getValue()) continue; 
    147 //            { it--; this->enabledFields.erase(it+1); continue; } 
    148162         } 
    149163         else // Si l'attribut 'enabled' n'est pas dfini ... 
    150164         { 
    151165            if (!default_enabled) continue; 
    152 //            { it--; this->enabledFields.erase(it+1); continue; } 
    153166         } 
    154167 
     
    156169         { 
    157170            if ((*it)->level.getValue() > _outputlevel) continue; 
    158 //            { it--; this->enabledFields.erase(it+1); continue; } 
    159171         } 
    160172         else // Si l'attribut 'level' n'est pas dfini ... 
    161173         { 
    162174            if (default_level > _outputlevel) continue; 
    163 //            { it--; this->enabledFields.erase(it+1); continue; } 
    164175         } 
    165176 
    166 //         CField* field_tmp=(*it).get(); 
    167 //         shared_ptr<CField> sptfield=*it; 
    168 //         field_tmp->refObject.push_back(sptfield); 
    169177         newEnabledFields.push_back(*it); 
    170          // Le champ est finalement actif, on y ajoute sa propre reference. 
    171 //         (*it)->refObject.push_back(*it); 
    172178         // Le champ est finalement actif, on y ajoute la rfrence au champ de base. 
    173179         (*it)->setRelFile(CFile::get(this)); 
     
    177183      return (this->enabledFields); 
    178184   } 
     185   CATCH_DUMP_ATTR 
    179186 
    180187   //---------------------------------------------------------------- 
    181188   //! Change virtual field group to a new one 
    182189   void CFile::setVirtualFieldGroup(CFieldGroup* newVFieldGroup) 
     190   TRY 
    183191   { 
    184192      this->vFieldGroup = newVFieldGroup; 
    185193   } 
     194   CATCH_DUMP_ATTR 
    186195 
    187196   //! Change virtual variable group to new one 
    188197   void CFile::setVirtualVariableGroup(CVariableGroup* newVVariableGroup) 
     198   TRY 
    189199   { 
    190200      this->vVariableGroup = newVVariableGroup; 
    191201   } 
     202   CATCH_DUMP_ATTR 
    192203 
    193204   //---------------------------------------------------------------- 
    194205   bool CFile::isSyncTime(void) 
     206   TRY 
    195207   { 
    196208     CContext* context = CContext::getCurrent(); 
     
    206218      return false; 
    207219    } 
     220    CATCH_DUMP_ATTR 
    208221 
    209222   //! Initialize a file in order to write into it 
    210223   void CFile::initWrite(void) 
     224   TRY 
    211225   { 
    212226      CContext* context = CContext::getCurrent(); 
     
    261275      if (time_counter_name.isEmpty()) time_counter_name = "time_counter"; 
    262276    } 
     277    CATCH_DUMP_ATTR 
    263278 
    264279    //! Initialize a file in order to write into it 
    265280    void CFile::initRead(void) 
     281    TRY 
    266282    { 
    267283      if (checkRead) return; 
     
    269285      checkRead = true; 
    270286    } 
     287    CATCH_DUMP_ATTR 
    271288 
    272289    /*! 
     
    274291    */ 
    275292    void CFile::createSubComFile() 
     293    TRY 
    276294    { 
    277295      CContext* context = CContext::getCurrent(); 
     
    292310      if (allZoneEmpty) MPI_Comm_free(&fileComm); 
    293311    } 
     312    CATCH_DUMP_ATTR 
    294313 
    295314    /* 
     
    299318    */ 
    300319    void CFile::checkWriteFile(void) 
     320    TRY 
    301321    { 
    302322      CContext* context = CContext::getCurrent(); 
     
    315335      } 
    316336    } 
     337    CATCH_DUMP_ATTR 
    317338 
    318339    /* 
     
    323344    */ 
    324345    void CFile::checkReadFile(void) 
     346    TRY 
    325347    { 
    326348      CContext* context = CContext::getCurrent(); 
     
    340362      } 
    341363    } 
     364    CATCH_DUMP_ATTR 
    342365 
    343366    /*! 
     
    346369    */ 
    347370    bool CFile::isEmptyZone() 
     371    TRY 
    348372    { 
    349373      return allZoneEmpty; 
    350374    } 
     375    CATCH_DUMP_ATTR 
    351376 
    352377    /*! 
     
    357382    */ 
    358383   bool CFile::checkSync(void) 
     384   TRY 
    359385   { 
    360386     CContext* context = CContext::getCurrent(); 
     
    371397      return false; 
    372398    } 
     399   CATCH_DUMP_ATTR 
    373400 
    374401    /*! 
     
    379406    */ 
    380407    bool CFile::checkSplit(void) 
     408    TRY 
    381409    { 
    382410      CContext* context = CContext::getCurrent(); 
     
    402430      return false; 
    403431    } 
     432    CATCH_DUMP_ATTR 
    404433 
    405434   /*! 
     
    408437   */ 
    409438   void CFile::createHeader(void) 
     439   TRY 
    410440   { 
    411441      CContext* context = CContext::getCurrent(); 
     
    594624      } 
    595625   } 
     626   CATCH_DUMP_ATTR 
    596627 
    597628  /*! 
     
    599630  */ 
    600631  void CFile::openInReadMode() 
     632  TRY 
    601633  { 
    602634    CContext* context = CContext::getCurrent(); 
     
    675707    } 
    676708  } 
     709  CATCH_DUMP_ATTR 
    677710 
    678711   //! Close file 
    679712   void CFile::close(void) 
     713   TRY 
    680714   { 
    681715     if (!allZoneEmpty) 
     
    690724      if (fileComm != MPI_COMM_NULL) MPI_Comm_free(&fileComm); 
    691725   } 
     726   CATCH_DUMP_ATTR 
     727 
    692728   //---------------------------------------------------------------- 
    693729 
    694730   void CFile::readAttributesOfEnabledFieldsInReadMode() 
     731   TRY 
    695732   { 
    696733     if (enabledFields.empty()) return; 
     
    722759     close(); 
    723760   } 
    724  
     761   CATCH_DUMP_ATTR 
    725762 
    726763   /*! 
     
    729766   */ 
    730767   void CFile::parse(xml::CXMLNode & node) 
     768   TRY 
    731769   { 
    732770      SuperClass::parse(node); 
     
    741779        node.goToParentElement(); 
    742780      } 
    743  
    744    } 
     781   } 
     782   CATCH_DUMP_ATTR 
     783 
    745784   //---------------------------------------------------------------- 
    746785 
     
    750789   */ 
    751790   StdString CFile::toString(void) const 
     791   TRY 
    752792   { 
    753793      StdOStringStream oss; 
     
    762802      return (oss.str()); 
    763803   } 
     804   CATCH 
    764805 
    765806   //---------------------------------------------------------------- 
     
    772813   */ 
    773814   void CFile::solveDescInheritance(bool apply, const CAttributeMap * const parent) 
     815   TRY 
    774816   { 
    775817      SuperClassAttribute::setAttributes(parent,apply); 
     
    777819      this->getVirtualVariableGroup()->solveDescInheritance(apply, NULL); 
    778820   } 
     821   CATCH_DUMP_ATTR 
    779822 
    780823   //---------------------------------------------------------------- 
     
    789832   */ 
    790833   void CFile::solveOnlyRefOfEnabledFields(bool sendToServer) 
     834   TRY 
    791835   { 
    792836     int size = this->enabledFields.size(); 
     
    796840     } 
    797841   } 
     842   CATCH_DUMP_ATTR 
    798843 
    799844   void CFile::checkGridOfEnabledFields() 
     845   TRY 
    800846   {  
    801847     int size = this->enabledFields.size(); 
     
    805851     } 
    806852   } 
     853   CATCH_DUMP_ATTR 
    807854 
    808855   void CFile::sendGridComponentOfEnabledFields() 
     856   TRY 
    809857   {  
    810858     int size = this->enabledFields.size(); 
     
    814862     } 
    815863   } 
     864   CATCH_DUMP_ATTR 
    816865 
    817866   /*! 
     
    820869   */ 
    821870   void CFile::sortEnabledFieldsForUgrid() 
     871   TRY 
    822872   { 
    823873     int size = this->enabledFields.size(); 
     
    868918     } 
    869919   } 
     920   CATCH_DUMP_ATTR 
    870921 
    871922   void CFile::sendGridOfEnabledFields() 
     923   TRY 
    872924   {  
    873925     int size = this->enabledFields.size(); 
     
    877929     } 
    878930   } 
     931   CATCH_DUMP_ATTR 
    879932 
    880933   void CFile::generateNewTransformationGridDest() 
     934   TRY 
    881935   { 
    882936     int size = this->enabledFields.size(); 
     
    886940     } 
    887941   } 
     942   CATCH_DUMP_ATTR 
    888943 
    889944   /*! 
     
    896951   */ 
    897952   void CFile::solveAllRefOfEnabledFieldsAndTransform(bool sendToServer) 
     953   TRY 
    898954   { 
    899955     int size = this->enabledFields.size(); 
     
    903959     } 
    904960   } 
     961   CATCH_DUMP_ATTR 
    905962 
    906963   /*! 
     
    910967    */ 
    911968   void CFile::buildFilterGraphOfEnabledFields(CGarbageCollector& gc) 
     969   TRY 
    912970   { 
    913971     int size = this->enabledFields.size(); 
     
    917975     } 
    918976   } 
     977   CATCH_DUMP_ATTR 
    919978 
    920979   /*! 
     
    922981    */ 
    923982   void CFile::postProcessFilterGraph() 
     983   TRY 
    924984   { 
    925985     int size = this->enabledFields.size(); 
     
    929989     } 
    930990   } 
     991   CATCH_DUMP_ATTR 
    931992 
    932993   /*! 
     
    934995   */ 
    935996   void CFile::prefetchEnabledReadModeFields(void) 
     997   TRY 
    936998   { 
    937999     if (mode.isEmpty() || mode.getValue() != mode_attr::read) 
     
    9421004       this->enabledFields[i]->sendReadDataRequest(CContext::getCurrent()->getCalendar()->getCurrentDate()); 
    9431005   } 
     1006   CATCH_DUMP_ATTR 
    9441007 
    9451008   /*! 
     
    9491012   */ 
    9501013   void CFile::doPreTimestepOperationsForEnabledReadModeFields(void) 
     1014   TRY 
    9511015   { 
    9521016     if (mode.isEmpty() || mode.getValue() != mode_attr::read) 
     
    9601024     } 
    9611025   } 
     1026   CATCH_DUMP_ATTR 
    9621027 
    9631028   /*! 
     
    9661031   */ 
    9671032   void CFile::doPostTimestepOperationsForEnabledReadModeFields(void) 
     1033   TRY 
    9681034   { 
    9691035     if (mode.isEmpty() || mode.getValue() != mode_attr::read) 
     
    9761042     } 
    9771043   } 
     1044   CATCH_DUMP_ATTR 
    9781045 
    9791046   void CFile::solveFieldRefInheritance(bool apply) 
     1047   TRY 
    9801048   { 
    9811049      // Rsolution des hritages par rfrence de chacun des champs contenus dans le fichier. 
     
    9841052         allF[i]->solveRefInheritance(apply); 
    9851053   } 
     1054   CATCH_DUMP_ATTR 
    9861055 
    9871056   //---------------------------------------------------------------- 
     
    9961065   */ 
    9971066   CField* CFile::addField(const string& id) 
     1067   TRY 
    9981068   { 
    9991069     return vFieldGroup->createChild(id); 
    10001070   } 
     1071   CATCH_DUMP_ATTR 
    10011072 
    10021073   /*! 
     
    10081079   */ 
    10091080   CFieldGroup* CFile::addFieldGroup(const string& id) 
     1081   TRY 
    10101082   { 
    10111083     return vFieldGroup->createChildGroup(id); 
    10121084   } 
     1085   CATCH_DUMP_ATTR 
    10131086 
    10141087   /*! 
     
    10231096   */ 
    10241097   CVariable* CFile::addVariable(const string& id) 
     1098   TRY 
    10251099   { 
    10261100     return vVariableGroup->createChild(id); 
    10271101   } 
     1102   CATCH_DUMP_ATTR 
    10281103 
    10291104   /*! 
     
    10351110   */ 
    10361111   CVariableGroup* CFile::addVariableGroup(const string& id) 
     1112   TRY 
    10371113   { 
    10381114     return vVariableGroup->createChildGroup(id); 
    10391115   } 
     1116   CATCH_DUMP_ATTR 
    10401117 
    10411118   void CFile::setContextClient(CContextClient* newContextClient) 
     1119   TRY 
    10421120   { 
    10431121     client = newContextClient; 
     
    10481126     } 
    10491127   } 
     1128   CATCH_DUMP_ATTR 
    10501129 
    10511130   CContextClient* CFile::getContextClient() 
     1131   TRY 
    10521132   { 
    10531133     return client; 
    10541134   } 
     1135   CATCH_DUMP_ATTR 
    10551136 
    10561137   void CFile::setReadContextClient(CContextClient* readContextclient) 
     1138   TRY 
    10571139   { 
    10581140     read_client = readContextclient; 
    10591141   } 
     1142   CATCH_DUMP_ATTR 
    10601143 
    10611144   CContextClient* CFile::getReadContextClient() 
     1145   TRY 
    10621146   { 
    10631147     return read_client; 
    10641148   } 
     1149   CATCH_DUMP_ATTR 
    10651150 
    10661151   /*! 
     
    10691154   */ 
    10701155   void CFile::sendAddField(const string& id, CContextClient* client) 
     1156   TRY 
    10711157   { 
    10721158      sendAddItem(id, EVENT_ID_ADD_FIELD, client); 
    10731159   } 
     1160   CATCH_DUMP_ATTR 
    10741161 
    10751162   /*! 
     
    10781165   */ 
    10791166   void CFile::sendAddFieldGroup(const string& id, CContextClient* client) 
     1167   TRY 
    10801168   { 
    10811169      sendAddItem(id, (int)EVENT_ID_ADD_FIELD_GROUP, client); 
    10821170   } 
     1171   CATCH_DUMP_ATTR 
    10831172 
    10841173   /*! 
     
    10871176   */ 
    10881177   void CFile::recvAddField(CEventServer& event) 
     1178   TRY 
    10891179   { 
    10901180 
     
    10941184      get(id)->recvAddField(*buffer); 
    10951185   } 
     1186   CATCH 
    10961187 
    10971188   /*! 
     
    11001191   */ 
    11011192   void CFile::recvAddField(CBufferIn& buffer) 
     1193   TRY 
    11021194   { 
    11031195      string id; 
     
    11051197      addField(id); 
    11061198   } 
     1199   CATCH_DUMP_ATTR 
    11071200 
    11081201   /*! 
     
    11111204   */ 
    11121205   void CFile::recvAddFieldGroup(CEventServer& event) 
     1206   TRY 
    11131207   { 
    11141208 
     
    11181212      get(id)->recvAddFieldGroup(*buffer); 
    11191213   } 
     1214   CATCH 
    11201215 
    11211216   /*! 
     
    11241219   */ 
    11251220   void CFile::recvAddFieldGroup(CBufferIn& buffer) 
     1221   TRY 
    11261222   { 
    11271223      string id; 
     
    11291225      addFieldGroup(id); 
    11301226   } 
     1227   CATCH_DUMP_ATTR 
    11311228 
    11321229   /*! 
     
    11371234   */ 
    11381235   void CFile::sendAddAllVariables(CContextClient* client) 
     1236   TRY 
    11391237   { 
    11401238     std::vector<CVariable*> allVar = getAllVariables(); 
     
    11491247     } 
    11501248   } 
     1249   CATCH_DUMP_ATTR 
    11511250 
    11521251   /*! 
     
    11561255   */ 
    11571256   void CFile::sendAddVariableGroup(const string& id, CContextClient* client) 
     1257   TRY 
    11581258   { 
    11591259      sendAddItem(id, (int)EVENT_ID_ADD_VARIABLE_GROUP, client); 
    11601260   } 
     1261   CATCH_DUMP_ATTR 
    11611262 
    11621263   /* 
     
    11661267   */ 
    11671268   void CFile::sendAddVariable(const string& id, CContextClient* client) 
     1269   TRY 
    11681270   { 
    11691271      sendAddItem(id, (int)EVENT_ID_ADD_VARIABLE, client); 
    11701272   } 
     1273   CATCH_DUMP_ATTR 
    11711274 
    11721275   /*! 
     
    11751278   */ 
    11761279   void CFile::recvAddVariable(CEventServer& event) 
    1177    { 
    1178  
     1280   TRY 
     1281   { 
    11791282      CBufferIn* buffer = event.subEvents.begin()->buffer; 
    11801283      string id; 
     
    11821285      get(id)->recvAddVariable(*buffer); 
    11831286   } 
     1287   CATCH 
    11841288 
    11851289   /*! 
     
    11881292   */ 
    11891293   void CFile::recvAddVariable(CBufferIn& buffer) 
     1294   TRY 
    11901295   { 
    11911296      string id; 
     
    11931298      addVariable(id); 
    11941299   } 
     1300   CATCH_DUMP_ATTR 
    11951301 
    11961302   /*! 
     
    11991305   */ 
    12001306   void CFile::recvAddVariableGroup(CEventServer& event) 
     1307   TRY 
    12011308   { 
    12021309 
     
    12061313      get(id)->recvAddVariableGroup(*buffer); 
    12071314   } 
     1315   CATCH 
    12081316 
    12091317   /*! 
     
    12121320   */ 
    12131321   void CFile::recvAddVariableGroup(CBufferIn& buffer) 
     1322   TRY 
    12141323   { 
    12151324      string id; 
     
    12171326      addVariableGroup(id); 
    12181327   } 
     1328   CATCH_DUMP_ATTR 
    12191329 
    12201330   /*! 
     
    12261336   */ 
    12271337   void CFile::sendEnabledFields(CContextClient* client) 
     1338   TRY 
    12281339   { 
    12291340     size_t size = this->enabledFields.size(); 
     
    12371348     } 
    12381349   } 
    1239  
     1350   CATCH_DUMP_ATTR 
    12401351 
    12411352   /*! 
     
    12471358   */ 
    12481359   bool CFile::dispatchEvent(CEventServer& event) 
     1360   TRY 
    12491361   { 
    12501362      if (SuperClass::dispatchEvent(event)) return true; 
     
    12781390      } 
    12791391   } 
    1280  
    1281  
    1282  
     1392   CATCH 
     1393 
     1394   ///-------------------------------------------------------------- 
     1395   /*! 
     1396   */ 
     1397   StdString CFile::dumpClassAttributes(void) 
     1398   { 
     1399     StdString str; 
     1400     CContext* context = CContext::getCurrent(); 
     1401     str.append("context=\""); 
     1402     str.append(context->getId()); 
     1403     str.append("\""); 
     1404     str.append(" enabled fields=\""); 
     1405     int size = this->enabledFields.size(); 
     1406     for (int i = 0; i < size; ++i) 
     1407     { 
     1408       str.append(this->enabledFields[i]->getId()); 
     1409       str.append(" "); 
     1410     } 
     1411     str.append("\""); 
     1412     return str; 
     1413   } 
    12831414 
    12841415   ///--------------------------------------------------------------- 
  • XIOS/dev/dev_olga/src/node/file.hpp

    r1542 r1612  
    8181                                                int default_level = 1, 
    8282                                                bool default_enabled = true); 
     83 
     84         StdString dumpClassAttributes(void); 
    8385 
    8486      public : 
  • XIOS/dev/dev_olga/src/node/grid.cpp

    r1594 r1612  
    8282 
    8383   StdSize CGrid::getDimension(void) 
     84   TRY 
    8485   { 
    8586      return getGlobalDimension().size(); 
    8687   } 
     88   CATCH_DUMP_ATTR 
    8789 
    8890   //--------------------------------------------------------------- 
    8991 
    9092   StdSize CGrid::getDataSize(void) const 
     93   TRY 
    9194   { 
    9295     StdSize retvalue = 1; 
     
    98101     return retvalue; 
    99102   } 
     103   CATCH 
    100104 
    101105   /*! 
     
    106110    */ 
    107111   std::map<int, StdSize> CGrid::getAttributesBufferSize(CContextClient* client, bool bufferForWriting) 
     112   TRY 
    108113   { 
    109114     std::map<int, StdSize> attributesSizes = getMinimumBufferSizeForAttributes(client); 
     
    147152     return attributesSizes; 
    148153  } 
     154   CATCH_DUMP_ATTR 
    149155 
    150156   /*! 
     
    156162    */ 
    157163   std::map<int, StdSize> CGrid::getDataBufferSize(CContextClient* client, const std::string& id /*= ""*/, bool bufferForWriting /*= "false"*/) 
     164   TRY 
    158165   {      
    159166     // The record index is sometimes sent along with the data but we always 
     
    180187     return dataSizes; 
    181188   } 
     189   CATCH_DUMP_ATTR 
    182190 
    183191   size_t CGrid::getGlobalWrittenSize(void) 
     192   TRY 
    184193   { 
    185194         std::vector<CDomain*> domainP = this->getDomains(); 
     
    191200     return globalGridSize ; 
    192201   } 
    193     
     202   CATCH_DUMP_ATTR 
    194203    
    195204   void CGrid::checkAttributesAfterTransformation() 
     205   TRY 
    196206   { 
    197207      setAxisList(); 
     
    228238      } 
    229239   } 
     240   CATCH_DUMP_ATTR 
    230241 
    231242   //--------------------------------------------------------------- 
     
    237248    */ 
    238249   bool CGrid::isCompressible(void) const 
     250   TRY 
    239251   { 
    240252      return isCompressible_; 
    241253   } 
     254   CATCH 
    242255 
    243256   //--------------------------------------------------------------- 
    244257 
    245258   void CGrid::addRelFileCompressed(const StdString& filename) 
     259   TRY 
    246260   { 
    247261      this->relFilesCompressed.insert(filename); 
    248262   } 
     263   CATCH_DUMP_ATTR 
    249264 
    250265   bool CGrid::isWrittenCompressed(const StdString& filename) const 
     266   TRY 
    251267   { 
    252268      return (this->relFilesCompressed.find(filename) != this->relFilesCompressed.end()); 
    253269   } 
     270   CATCH 
    254271 
    255272   //--------------------------------------------------------------- 
     
    258275   */ 
    259276   void CGrid::solveDomainAxisRef(bool areAttributesChecked) 
     277   TRY 
    260278   { 
    261279     if (this->isDomainAxisChecked) return; 
     
    266284     this->isDomainAxisChecked = areAttributesChecked; 
    267285   } 
     286   CATCH_DUMP_ATTR 
    268287 
    269288   /* 
     
    272291   */ 
    273292   void CGrid::solveDomainAxisBaseRef() 
     293   TRY 
    274294   { 
    275295     if (this->hasDomainAxisBaseRef_) return; 
     
    297317     this->hasDomainAxisBaseRef_ = true; 
    298318   } 
     319   CATCH_DUMP_ATTR 
    299320 
    300321   void CGrid::checkEligibilityForCompressedOutput() 
     322   TRY 
    301323   { 
    302324     // We don't check if the mask is valid here, just if a mask has been defined at this point. 
    303325     isCompressible_ = !mask_1d.isEmpty() || !mask_2d.isEmpty() || !mask_3d.isEmpty(); 
    304326   } 
     327   CATCH_DUMP_ATTR 
    305328 
    306329   void CGrid::checkMaskIndex(bool doSendingIndex) 
     330   TRY 
    307331   { 
    308332     CContext* context = CContext::getCurrent(); 
     
    339363      this->isChecked = true; 
    340364   } 
    341  
     365   CATCH_DUMP_ATTR 
    342366   bool CGrid::hasMask() const 
     367   TRY 
    343368   { 
    344369     return (!mask_1d.isEmpty() || !mask_2d.isEmpty() || !mask_3d.isEmpty() || 
    345370             !mask_4d.isEmpty() || !mask_5d.isEmpty() || !mask_6d.isEmpty() || !mask_7d.isEmpty()); 
    346371   } 
     372   CATCH 
    347373 
    348374   /* 
     
    350376   */ 
    351377   void CGrid::createMask(void) 
     378   TRY 
    352379   { 
    353380      using namespace std; 
     
    387414      } 
    388415   } 
     416   CATCH_DUMP_ATTR 
    389417 
    390418   /* 
     
    392420   */ 
    393421   void CGrid::checkMask(void) 
     422   TRY 
    394423   { 
    395424      using namespace std; 
     
    429458      } 
    430459   } 
    431        
     460   CATCH_DUMP_ATTR 
     461 
    432462   /* 
    433463     Modify value of mask in a certain index 
     
    437467   */ 
    438468   void CGrid::modifyMask(const CArray<int,1>& indexToModify, bool modifyValue) 
     469   TRY 
    439470   { 
    440471      using namespace std; 
     
    472503      } 
    473504   } 
     505   CATCH_DUMP_ATTR 
    474506 
    475507   /* 
     
    479511   */ 
    480512   void CGrid::modifyMaskSize(const std::vector<int>& newDimensionSize, bool newValue) 
     513   TRY 
    481514   {       
    482515      std::vector<CDomain*> domainP = this->getDomains(); 
     
    513546      } 
    514547   } 
     548   CATCH_DUMP_ATTR 
    515549 
    516550   //--------------------------------------------------------------- 
    517551 
    518552   void CGrid::solveDomainRef(bool sendAtt) 
     553   TRY 
    519554   { 
    520555      setDomainList(); 
     
    529564      } 
    530565   } 
     566   CATCH_DUMP_ATTR 
    531567 
    532568   //--------------------------------------------------------------- 
    533569 
    534570   void CGrid::solveAxisRef(bool sendAtt) 
     571   TRY 
    535572   { 
    536573      setAxisList(); 
     
    560597      } 
    561598   } 
     599   CATCH_DUMP_ATTR 
    562600 
    563601   //--------------------------------------------------------------- 
    564602 
    565603   void CGrid::solveScalarRef(bool sendAtt) 
     604   TRY 
    566605   { 
    567606      setScalarList(); 
     
    577616      } 
    578617   } 
     618   CATCH_DUMP_ATTR 
    579619 
    580620   /*! 
     
    582622   */ 
    583623   void CGrid::computeWrittenIndex() 
     624   TRY 
    584625   {       
    585626      if (computedWrittenIndex_) return; 
     
    641682      } 
    642683   } 
     684   CATCH_DUMP_ATTR 
    643685 
    644686   //--------------------------------------------------------------- 
     
    651693   */ 
    652694   void CGrid::computeClientIndex() 
     695   TRY 
    653696   { 
    654697     CContext* context = CContext::getCurrent(); 
     
    711754      } 
    712755   } 
     756   CATCH_DUMP_ATTR 
    713757 
    714758   /*! 
     
    716760   */ 
    717761   void CGrid::computeConnectedClients() 
     762   TRY 
    718763   { 
    719764     CContext* context = CContext::getCurrent(); 
     
    833878     } 
    834879   } 
     880   CATCH_DUMP_ATTR 
    835881 
    836882   /*! 
     
    842888   */ 
    843889   void CGrid::computeIndex(void) 
     890   TRY 
    844891   { 
    845892     CContext* context = CContext::getCurrent(); 
     
    868915     } 
    869916   } 
     917   CATCH_DUMP_ATTR 
    870918 
    871919   /*! 
     
    881929                                     const CContextClient* client, 
    882930                                     CClientServerMapping::GlobalIndexMap& globalIndexOnServer) 
     931   TRY 
    883932   { 
    884933     int serverSize = client->serverSize; 
     
    10471096    } 
    10481097   } 
    1049    //---------------------------------------------------------------- 
     1098   CATCH_DUMP_ATTR 
     1099//---------------------------------------------------------------- 
    10501100 
    10511101   CGrid* CGrid::createGrid(CDomain* domain) 
     1102   TRY 
    10521103   { 
    10531104      std::vector<CDomain*> vecDom(1, domain); 
     
    10561107      return createGrid(vecDom, vecAxis); 
    10571108   } 
     1109   CATCH 
    10581110 
    10591111   CGrid* CGrid::createGrid(CDomain* domain, CAxis* axis) 
    1060    { 
     1112   TRY 
     1113  { 
    10611114      std::vector<CDomain*> vecDom(1, domain); 
    10621115      std::vector<CAxis*> vecAxis(1, axis); 
     
    10641117      return createGrid(vecDom, vecAxis); 
    10651118   } 
     1119   CATCH 
    10661120 
    10671121   CGrid* CGrid::createGrid(const std::vector<CDomain*>& domains, const std::vector<CAxis*>& axis, 
    10681122                            const CArray<int,1>& axisDomainOrder) 
     1123   TRY 
    10691124   { 
    10701125     std::vector<CScalar*> vecScalar; 
    10711126     return createGrid(generateId(domains, axis, vecScalar, axisDomainOrder), domains, axis, vecScalar, axisDomainOrder); 
    10721127   } 
     1128   CATCH 
    10731129 
    10741130   CGrid* CGrid::createGrid(const std::vector<CDomain*>& domains, const std::vector<CAxis*>& axis, 
    10751131                            const std::vector<CScalar*>& scalars, const CArray<int,1>& axisDomainOrder) 
     1132   TRY 
    10761133   { 
    10771134     return createGrid(generateId(domains, axis, scalars, axisDomainOrder), domains, axis, scalars, axisDomainOrder); 
    10781135   } 
     1136   CATCH 
    10791137 
    10801138   CGrid* CGrid::createGrid(StdString id, const std::vector<CDomain*>& domains, const std::vector<CAxis*>& axis, 
    10811139                            const std::vector<CScalar*>& scalars, const CArray<int,1>& axisDomainOrder) 
     1140   TRY 
    10821141   { 
    10831142      if (axisDomainOrder.numElements() > 0 && axisDomainOrder.numElements() != (domains.size() + axis.size() + scalars.size())) 
     
    11211180      return grid; 
    11221181   } 
     1182   CATCH 
    11231183 
    11241184   CGrid* CGrid::cloneGrid(const StdString& idNewGrid, CGrid* gridSrc) 
     1185   TRY 
    11251186   { 
    11261187     std::vector<CDomain*> domainSrcTmp = gridSrc->getDomains(), domainSrc; 
     
    11621223      return grid; 
    11631224   } 
     1225   CATCH 
    11641226 
    11651227   StdString CGrid::generateId(const std::vector<CDomain*>& domains, const std::vector<CAxis*>& axis, 
    11661228                               const std::vector<CScalar*>& scalars, const CArray<int,1>& axisDomainOrder) 
     1229   TRY 
    11671230   { 
    11681231      if (axisDomainOrder.numElements() > 0 && axisDomainOrder.numElements() != (domains.size() + axis.size() + scalars.size())) 
     
    12051268      return id.str(); 
    12061269   } 
     1270   CATCH 
    12071271 
    12081272   StdString CGrid::generateId(const CGrid* gridSrc, const CGrid* gridDest) 
     1273   TRY 
    12091274   { 
    12101275     StdString idSrc  = gridSrc->getId(); 
     
    12161281     return id.str(); 
    12171282   } 
     1283   CATCH 
    12181284 
    12191285   //---------------------------------------------------------------- 
    12201286 
    12211287   CDomainGroup* CGrid::getVirtualDomainGroup() const 
     1288   TRY 
    12221289   { 
    12231290     return this->vDomainGroup_; 
    12241291   } 
     1292   CATCH 
    12251293 
    12261294   CAxisGroup* CGrid::getVirtualAxisGroup() const 
     1295   TRY 
    12271296   { 
    12281297     return this->vAxisGroup_; 
    12291298   } 
     1299   CATCH 
    12301300 
    12311301   CScalarGroup* CGrid::getVirtualScalarGroup() const 
     1302   TRY 
    12321303   { 
    12331304     return this->vScalarGroup_; 
    12341305   } 
     1306   CATCH 
    12351307 
    12361308/* 
     
    12681340 
    12691341   void CGrid::storeField_arr(const double* const data, CArray<double, 1>& stored) const 
     1342   TRY 
    12701343   { 
    12711344      const StdSize size = storeIndex_client.numElements(); 
     
    12741347      for(StdSize i = 0; i < size; i++) stored(i) = data[storeIndex_client(i)]; 
    12751348   } 
     1349   CATCH 
    12761350 
    12771351   void CGrid::restoreField_arr(const CArray<double, 1>& stored, double* const data) const 
     1352   TRY 
    12781353   { 
    12791354      const StdSize size = storeIndex_client.numElements(); 
     
    12811356      for(StdSize i = 0; i < size; i++) data[storeIndex_client(i)] = stored(i); 
    12821357   } 
     1358   CATCH 
    12831359 
    12841360   void CGrid::maskField_arr(const double* const data, CArray<double, 1>& stored) const 
     
    12951371 
    12961372   void CGrid::uncompressField_arr(const double* const data, CArray<double, 1>& out) const 
     1373   TRY 
    12971374   { 
    12981375      const std::vector<int>& localMaskedDataIndex = clientDistribution_->getLocalMaskedDataIndexOnClient(); 
     
    13001377      for(int i = 0; i < size; ++i) out(localMaskedDataIndex[i]) = data[i]; 
    13011378   } 
    1302  
     1379   CATCH 
    13031380 
    13041381  void CGrid::computeClientIndexScalarGrid() 
     1382  TRY 
    13051383  { 
    13061384    CContext* context = CContext::getCurrent();     
     
    13361414    } 
    13371415  } 
     1416  CATCH_DUMP_ATTR 
    13381417 
    13391418  void CGrid::computeConnectedClientsScalarGrid() 
     1419  TRY 
    13401420  { 
    13411421    CContext* context = CContext::getCurrent();     
     
    13821462    } 
    13831463  } 
     1464  CATCH_DUMP_ATTR 
    13841465 
    13851466  void CGrid::sendIndexScalarGrid() 
     1467  TRY 
    13861468  { 
    13871469    CContext* context = CContext::getCurrent(); 
     
    14471529    } 
    14481530  } 
     1531  CATCH_DUMP_ATTR 
    14491532 
    14501533  void CGrid::sendIndex(void) 
     1534  TRY 
    14511535  { 
    14521536    CContext* context = CContext::getCurrent(); 
     
    15681652    } 
    15691653  } 
     1654  CATCH_DUMP_ATTR 
    15701655 
    15711656  void CGrid::recvIndex(CEventServer& event) 
     1657  TRY 
    15721658  { 
    15731659    string gridId; 
     
    15851671    get(gridId)->recvIndex(ranks, buffers); 
    15861672  } 
     1673  CATCH 
    15871674 
    15881675  void CGrid::recvIndex(vector<int> ranks, vector<CBufferIn*> buffers) 
     1676  TRY 
    15891677  { 
    15901678    CContext* context = CContext::getCurrent(); 
     
    17561844    } 
    17571845  } 
     1846  CATCH_DUMP_ATTR 
    17581847 
    17591848  /* 
     
    17711860                                        const std::vector<CScalar*> scalars, 
    17721861                                        const CArray<int,1>& axisDomainOrder) 
    1773   { 
     1862  TRY 
     1863 { 
    17741864 //   globalDim.resize(domains.size()*2+axis.size()+scalars.size()); 
    17751865    globalDim.resize(domains.size()*2+axis.size()); 
     
    18111901    return positionDimensionDistributed; 
    18121902  } 
     1903  CATCH_DUMP_ATTR 
    18131904 
    18141905  // Retrieve the global dimension of grid 
    18151906  std::vector<int> CGrid::getGlobalDimension() 
     1907  TRY 
    18161908  { 
    18171909    std::vector<int> globalDim; 
     
    18201912    return globalDim; 
    18211913  } 
     1914  CATCH_DUMP_ATTR 
    18221915 
    18231916  // Retrieve dimension on which we do distribution (Very often, it should be 2nd dimension) 
    18241917  int CGrid::getDistributedDimension() 
     1918  TRY 
    18251919  { 
    18261920    std::vector<int> globalDim; 
    18271921    return computeGridGlobalDimension(globalDim, getDomains(), getAxis(), getScalars(), axis_domain_order);     
    18281922  } 
     1923  CATCH_DUMP_ATTR 
    18291924 
    18301925  bool CGrid::isScalarGrid() const 
     1926  TRY 
    18311927  { 
    18321928    return (axisList_.empty() && domList_.empty()); 
    18331929  } 
     1930  CATCH 
    18341931 
    18351932  /*! 
     
    18391936  */ 
    18401937  bool CGrid::doGridHaveDataToWrite() 
     1938  TRY 
    18411939  { 
    18421940     return (0 != writtenDataSize_); 
    18431941  } 
     1942  CATCH_DUMP_ATTR 
    18441943 
    18451944  /*! 
     
    18501949  */ 
    18511950  size_t CGrid::getWrittenDataSize() const 
     1951  TRY 
    18521952  { 
    18531953    return writtenDataSize_; 
    18541954  } 
     1955  CATCH 
    18551956 
    18561957  /*! 
     
    18591960  */ 
    18601961  int CGrid::getNumberWrittenIndexes() const 
     1962  TRY 
    18611963  { 
    18621964    return numberWrittenIndexes_; 
    18631965  } 
     1966  CATCH 
    18641967 
    18651968  /*! 
     
    18681971  */ 
    18691972  int CGrid::getTotalNumberWrittenIndexes() const 
     1973  TRY 
    18701974  { 
    18711975    return totalNumberWrittenIndexes_; 
    18721976  } 
     1977  CATCH 
    18731978 
    18741979  /*! 
     
    18771982  */ 
    18781983  int CGrid::getOffsetWrittenIndexes() const 
     1984  TRY 
    18791985  { 
    18801986    return offsetWrittenIndexes_; 
    18811987  } 
     1988  CATCH 
    18821989 
    18831990  CDistributionServer* CGrid::getDistributionServer() 
     1991  TRY 
    18841992  { 
    18851993    return serverDistribution_; 
    18861994  } 
     1995  CATCH_DUMP_ATTR 
    18871996 
    18881997  CDistributionClient* CGrid::getDistributionClient() 
     1998  TRY 
    18891999  { 
    18902000    return clientDistribution_; 
    18912001  } 
     2002  CATCH_DUMP_ATTR 
    18922003 
    18932004  bool CGrid::doGridHaveDataDistributed(CContextClient* client) 
     2005  TRY 
    18942006  { 
    18952007    if (isScalarGrid()) return false; 
     
    19012013      return isDataDistributed_;     
    19022014  } 
     2015  CATCH_DUMP_ATTR 
    19032016 
    19042017   /*! 
     
    19102023   */ 
    19112024  bool CGrid::dispatchEvent(CEventServer& event) 
     2025  TRY 
    19122026  { 
    19132027 
     
    19432057    } 
    19442058  } 
     2059  CATCH 
    19452060 
    19462061   ///--------------------------------------------------------------- 
    19472062 
    19482063   CDomain* CGrid::addDomain(const std::string& id) 
     2064   TRY 
    19492065   { 
    19502066     order_.push_back(2); 
     
    19532069     return vDomainGroup_->createChild(id); 
    19542070   } 
     2071   CATCH_DUMP_ATTR 
    19552072 
    19562073   CAxis* CGrid::addAxis(const std::string& id) 
     2074   TRY 
    19572075   { 
    19582076     order_.push_back(1); 
     
    19612079     return vAxisGroup_->createChild(id); 
    19622080   } 
     2081   CATCH_DUMP_ATTR 
    19632082 
    19642083   CScalar* CGrid::addScalar(const std::string& id) 
     2084   TRY 
    19652085   { 
    19662086     order_.push_back(0); 
     
    19692089     return vScalarGroup_->createChild(id); 
    19702090   } 
     2091   CATCH_DUMP_ATTR 
    19712092 
    19722093   //! Change virtual field group to a new one 
    19732094   void CGrid::setVirtualDomainGroup(CDomainGroup* newVDomainGroup) 
     2095   TRY 
    19742096   { 
    19752097      this->vDomainGroup_ = newVDomainGroup; 
    19762098   } 
     2099   CATCH_DUMP_ATTR 
    19772100 
    19782101   //! Change virtual variable group to new one 
    19792102   void CGrid::setVirtualAxisGroup(CAxisGroup* newVAxisGroup) 
     2103   TRY 
    19802104   { 
    19812105      this->vAxisGroup_ = newVAxisGroup; 
    19822106   } 
     2107   CATCH_DUMP_ATTR 
    19832108 
    19842109   //! Change virtual variable group to new one 
    19852110   void CGrid::setVirtualScalarGroup(CScalarGroup* newVScalarGroup) 
     2111   TRY 
    19862112   { 
    19872113      this->vScalarGroup_ = newVScalarGroup; 
    19882114   } 
     2115   CATCH_DUMP_ATTR 
    19892116 
    19902117   /*! 
     
    19932120   */ 
    19942121   void CGrid::sendAddDomain(const string& id) 
    1995    { 
     2122   TRY 
     2123  { 
    19962124      sendAddItem(id, (int)EVENT_ID_ADD_DOMAIN); 
    19972125   } 
     2126   CATCH_DUMP_ATTR 
    19982127 
    19992128   /*! 
     
    20022131   */ 
    20032132   void CGrid::sendAddAxis(const string& id) 
     2133   TRY 
    20042134   { 
    20052135      sendAddItem(id, (int)EVENT_ID_ADD_AXIS); 
    20062136   } 
     2137   CATCH_DUMP_ATTR 
    20072138 
    20082139   /*! 
     
    20112142   */ 
    20122143   void CGrid::sendAddScalar(const string& id) 
     2144   TRY 
    20132145   { 
    20142146      sendAddItem(id, (int)EVENT_ID_ADD_SCALAR); 
    20152147   } 
     2148   CATCH_DUMP_ATTR 
    20162149 
    20172150   /*! 
     
    20202153   */ 
    20212154   void CGrid::recvAddDomain(CEventServer& event) 
     2155   TRY 
    20222156   { 
    20232157 
     
    20272161      get(id)->recvAddDomain(*buffer); 
    20282162   } 
     2163   CATCH 
    20292164 
    20302165   /*! 
     
    20332168   */ 
    20342169   void CGrid::recvAddDomain(CBufferIn& buffer) 
     2170   TRY 
    20352171   { 
    20362172      string id; 
     
    20382174      addDomain(id); 
    20392175   } 
     2176   CATCH_DUMP_ATTR 
    20402177 
    20412178   /*! 
     
    20442181   */ 
    20452182   void CGrid::recvAddAxis(CEventServer& event) 
     2183   TRY 
    20462184   { 
    20472185 
     
    20512189      get(id)->recvAddAxis(*buffer); 
    20522190   } 
     2191   CATCH 
    20532192 
    20542193   /*! 
     
    20572196   */ 
    20582197   void CGrid::recvAddAxis(CBufferIn& buffer) 
     2198   TRY 
    20592199   { 
    20602200      string id; 
     
    20622202      addAxis(id); 
    20632203   } 
     2204   CATCH_DUMP_ATTR 
    20642205 
    20652206   /*! 
     
    20682209   */ 
    20692210   void CGrid::recvAddScalar(CEventServer& event) 
     2211   TRY 
    20702212   { 
    20712213 
     
    20752217      get(id)->recvAddScalar(*buffer); 
    20762218   } 
     2219   CATCH 
    20772220 
    20782221   /*! 
     
    20812224   */ 
    20822225   void CGrid::recvAddScalar(CBufferIn& buffer) 
     2226   TRY 
    20832227   { 
    20842228      string id; 
     
    20862230      addScalar(id); 
    20872231   } 
     2232   CATCH_DUMP_ATTR 
    20882233 
    20892234  /*! 
     
    20942239  */ 
    20952240  void CGrid::solveDomainAxisRefInheritance(bool apply) 
     2241  TRY 
    20962242  { 
    20972243    CContext* context = CContext::getCurrent(); 
     
    21342280    } 
    21352281  } 
     2282  CATCH_DUMP_ATTR 
    21362283 
    21372284  bool CGrid::isTransformed() 
     2285  TRY 
    21382286  { 
    21392287    return isTransformed_; 
    21402288  } 
     2289  CATCH_DUMP_ATTR 
    21412290 
    21422291  void CGrid::setTransformed() 
     2292  TRY 
    21432293  { 
    21442294    isTransformed_ = true; 
    21452295  } 
     2296  CATCH_DUMP_ATTR 
    21462297 
    21472298  CGridTransformation* CGrid::getTransformations() 
     2299  TRY 
    21482300  { 
    21492301    return transformations_; 
    21502302  } 
     2303  CATCH_DUMP_ATTR 
    21512304 
    21522305  void CGrid::addTransGridSource(CGrid* gridSrc) 
     2306  TRY 
    21532307  { 
    21542308    if (gridSrc_.end() == gridSrc_.find(gridSrc)) 
    21552309      gridSrc_.insert(make_pair(gridSrc,make_pair(false,""))); 
    21562310  } 
     2311  CATCH_DUMP_ATTR 
    21572312 
    21582313  std::map<CGrid*,std::pair<bool,StdString> >& CGrid::getTransGridSource() 
     2314  TRY 
    21592315  { 
    21602316    return gridSrc_; 
    21612317  } 
     2318  CATCH_DUMP_ATTR 
    21622319 
    21632320  /*! 
     
    21662323  */ 
    21672324  void CGrid::completeGrid(CGrid* transformGridSrc) 
     2325  TRY 
    21682326  { 
    21692327    if (0 != transformGridSrc) 
     
    21842342    gridGenerate.completeGrid(); 
    21852343  } 
     2344  CATCH_DUMP_ATTR 
    21862345 
    21872346  bool CGrid::isGenerated() 
     2347  TRY 
    21882348  { 
    21892349    return isGenerated_; 
    21902350  } 
     2351  CATCH 
    21912352 
    21922353  void CGrid::setGenerated() 
     2354  TRY 
    21932355  { 
    21942356    isGenerated_ = true; 
    21952357  } 
     2358  CATCH_DUMP_ATTR 
    21962359 
    21972360  void CGrid::transformGrid(CGrid* transformGridSrc) 
     2361  TRY 
    21982362  { 
    21992363    if (!transformGridSrc) 
     
    22212385    transformGridSrc->checkMaskIndex(false); 
    22222386  } 
     2387  CATCH_DUMP_ATTR 
    22232388 
    22242389  bool CGrid::hasTransform() 
     2390  TRY 
    22252391  { 
    22262392    if (hasTransform_) return hasTransform_; 
     
    22362402    return hasTransform_; 
    22372403  } 
     2404  CATCH_DUMP_ATTR 
    22382405 
    22392406  /*! 
     
    22422409  */ 
    22432410  std::vector<CDomain*> CGrid::getDomains() 
     2411  TRY 
    22442412  { 
    22452413    std::vector<CDomain*> domList; 
     
    22502418    return domList; 
    22512419  } 
     2420  CATCH_DUMP_ATTR 
    22522421 
    22532422  /*! 
     
    22562425  */ 
    22572426  std::vector<CAxis*> CGrid::getAxis() 
     2427  TRY 
    22582428  { 
    22592429    std::vector<CAxis*> aList; 
     
    22632433    return aList; 
    22642434  } 
     2435  CATCH_DUMP_ATTR 
    22652436 
    22662437  /*! 
     
    22692440  */ 
    22702441  std::vector<CScalar*> CGrid::getScalars() 
     2442  TRY 
    22712443  { 
    22722444    std::vector<CScalar*> sList; 
     
    22762448    return sList; 
    22772449  } 
     2450  CATCH_DUMP_ATTR 
    22782451 
    22792452  /*! 
     
    22822455  */ 
    22832456  CDomain* CGrid::getDomain(int domainIndex) 
     2457  TRY 
    22842458  { 
    22852459    std::vector<CDomain*> domainListP = this->getDomains(); 
     
    22992473    return domainListP[domainIndex]; 
    23002474  } 
     2475  CATCH_DUMP_ATTR 
    23012476 
    23022477  /*! 
     
    23052480  */ 
    23062481  CAxis* CGrid::getAxis(int axisIndex) 
     2482  TRY 
    23072483  { 
    23082484    std::vector<CAxis*> axisListP = this->getAxis(); 
     
    23222498    return axisListP[axisIndex]; 
    23232499  } 
     2500  CATCH_DUMP_ATTR 
    23242501 
    23252502  /*! 
     
    23282505  */ 
    23292506  CScalar* CGrid::getScalar(int scalarIndex) 
     2507  TRY 
    23302508  { 
    23312509    std::vector<CScalar*> scalarListP = this->getScalars(); 
     
    23452523    return scalarListP[scalarIndex]; 
    23462524  } 
     2525  CATCH_DUMP_ATTR 
    23472526 
    23482527  /*! 
     
    23512530  */ 
    23522531  void CGrid::setDomainList(const std::vector<CDomain*> domains) 
     2532  TRY 
    23532533  { 
    23542534    if (isDomListSet) return; 
     
    23712551      isDomListSet = true; 
    23722552    } 
    2373  
    2374   } 
     2553  } 
     2554  CATCH_DUMP_ATTR 
    23752555 
    23762556  /*! 
     
    23792559  */ 
    23802560  void CGrid::setAxisList(const std::vector<CAxis*> axis) 
     2561  TRY 
    23812562  { 
    23822563    if (isAxisListSet) return; 
     
    24002581    } 
    24012582  } 
     2583  CATCH_DUMP_ATTR 
    24022584 
    24032585  /*! 
     
    24062588  */ 
    24072589  void CGrid::setScalarList(const std::vector<CScalar*> scalars) 
     2590  TRY 
    24082591  { 
    24092592    if (isScalarListSet) return; 
     
    24272610    } 
    24282611  } 
     2612  CATCH_DUMP_ATTR 
    24292613 
    24302614  /*! 
     
    24332617  */ 
    24342618  std::vector<StdString> CGrid::getDomainList() 
     2619  TRY 
    24352620  { 
    24362621    setDomainList(); 
    24372622    return domList_; 
    24382623  } 
     2624  CATCH 
    24392625 
    24402626  /*! 
     
    24432629  */ 
    24442630  std::vector<StdString> CGrid::getAxisList() 
     2631  TRY 
    24452632  { 
    24462633    setAxisList(); 
    24472634    return axisList_; 
    24482635  } 
     2636  CATCH 
    24492637 
    24502638  /*! 
     
    24532641  */ 
    24542642  std::vector<StdString> CGrid::getScalarList() 
     2643  TRY 
    24552644  { 
    24562645    setScalarList(); 
    24572646    return scalarList_; 
    24582647  } 
     2648  CATCH 
    24592649 
    24602650  /*! 
     
    24622652  */ 
    24632653  void CGrid::sendAllDomains() 
     2654  TRY 
    24642655  { 
    24652656    std::vector<CDomain*> domList = this->getVirtualDomainGroup()->getAllChildren(); 
     
    24712662    } 
    24722663  } 
     2664  CATCH_DUMP_ATTR 
    24732665 
    24742666  /*! 
     
    24762668  */ 
    24772669  void CGrid::sendAllAxis() 
     2670  TRY 
    24782671  { 
    24792672    std::vector<CAxis*> aList = this->getVirtualAxisGroup()->getAllChildren(); 
     
    24862679    } 
    24872680  } 
     2681  CATCH_DUMP_ATTR 
    24882682 
    24892683  /*! 
     
    24912685  */ 
    24922686  void CGrid::sendAllScalars() 
     2687  TRY 
    24932688  { 
    24942689    std::vector<CScalar*> sList = this->getVirtualScalarGroup()->getAllChildren(); 
     
    25012696    } 
    25022697  } 
     2698  CATCH_DUMP_ATTR 
    25032699 
    25042700  void CGrid::setContextClient(CContextClient* contextClient) 
     2701  TRY 
    25052702  { 
    25062703    if (clientsSet.find(contextClient)==clientsSet.end()) 
     
    25142711        this->getAxis()[i]->setContextClient(contextClient); 
    25152712  } 
     2713  CATCH_DUMP_ATTR 
    25162714 
    25172715  /*! 
     
    25192717  */ 
    25202718  void CGrid::parse(xml::CXMLNode& node) 
     2719  TRY 
    25212720  { 
    25222721    SuperClass::parse(node); 
     
    25592758    setScalarList(); 
    25602759   } 
     2760  CATCH_DUMP_ATTR 
     2761 
    25612762} // namespace xios 
Note: See TracChangeset for help on using the changeset viewer.