Changeset 1622 for XIOS/trunk/src/node


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

Exception handling on trunk.

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

Location:
XIOS/trunk/src/node
Files:
10 edited

Legend:

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

    r1566 r1622  
    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      if (this->n_glo.isEmpty()) 
     
    285314      } 
    286315 
    287       // Remove this check because it doen't make sense in case of a hole or overlapping axes 
     316      // Remove this check because it doesn't make sense in case of a hole or overlapping axes 
    288317      if (!this->value.isEmpty()) 
    289318      { 
     
    306335      } 
    307336   } 
     337   CATCH_DUMP_ATTR 
    308338 
    309339   /*! 
     
    311341   */ 
    312342   void CAxis::checkData() 
     343   TRY 
    313344   { 
    314345      if (data_begin.isEmpty()) data_begin.setValue(0); 
     
    331362      } 
    332363   } 
     364   CATCH_DUMP_ATTR 
    333365 
    334366    size_t CAxis::getGlobalWrittenSize(void) 
     
    341373   */ 
    342374   void CAxis::checkMask() 
     375   TRY 
    343376   { 
    344377      if (!mask.isEmpty()) 
     
    360393      } 
    361394   } 
     395   CATCH_DUMP_ATTR 
    362396 
    363397   /*! 
     
    365399   */ 
    366400   void CAxis::checkBounds() 
     401   TRY 
    367402   { 
    368403     if (!bounds.isEmpty()) 
     
    377412     else hasBounds = false; 
    378413   } 
     414   CATCH_DUMP_ATTR 
    379415 
    380416  void CAxis::checkLabel() 
     417  TRY 
    381418  { 
    382419    if (!label.isEmpty()) 
     
    391428    else hasLabel = false; 
    392429  } 
     430  CATCH_DUMP_ATTR 
    393431 
    394432  /*! 
     
    396434  */ 
    397435  void CAxis::checkEligibilityForCompressedOutput() 
     436  TRY 
    398437  { 
    399438    // We don't check if the mask is valid here, just if a mask has been defined at this point. 
    400439    isCompressible_ = !mask.isEmpty(); 
    401440  } 
     441  CATCH_DUMP_ATTR 
    402442 
    403443  /*! 
     
    405445  */ 
    406446  bool CAxis::dispatchEvent(CEventServer& event) 
     447  TRY 
    407448  { 
    408449     if (SuperClass::dispatchEvent(event)) return true; 
     
    430471     } 
    431472  } 
     473  CATCH 
    432474 
    433475   /*! 
     
    435477   */ 
    436478   void CAxis::checkAttributesOnClient() 
     479   TRY 
    437480   { 
    438481     if (this->areClientAttributesChecked_) return; 
     
    443486     this->areClientAttributesChecked_ = true; 
    444487   } 
     488   CATCH_DUMP_ATTR 
    445489 
    446490   /* 
     
    450494   void CAxis::checkAttributesOnClientAfterTransformation(const std::vector<int>& globalDim, int orderPositionInGrid, 
    451495                                                          CServerDistributionDescription::ServerDistributionType distType) 
     496   TRY 
    452497   { 
    453498     CContext* context=CContext::getCurrent() ; 
     
    463508     this->isClientAfterTransformationChecked = true; 
    464509   } 
     510   CATCH_DUMP_ATTR 
    465511 
    466512   /* 
     
    473519   void CAxis::sendCheckedAttributes(const std::vector<int>& globalDim, int orderPositionInGrid, 
    474520                                     CServerDistributionDescription::ServerDistributionType distType) 
     521   TRY 
    475522   { 
    476523     if (!this->areClientAttributesChecked_) checkAttributesOnClient(); 
     
    483530     this->isChecked = true; 
    484531   } 
     532   CATCH_DUMP_ATTR 
    485533 
    486534  /*! 
     
    491539  void CAxis::sendAttributes(const std::vector<int>& globalDim, int orderPositionInGrid, 
    492540                             CServerDistributionDescription::ServerDistributionType distType) 
     541  TRY 
    493542  { 
    494543     sendDistributionAttribute(globalDim, orderPositionInGrid, distType); 
     
    505554     }      
    506555  } 
     556  CATCH_DUMP_ATTR 
    507557 
    508558  /* 
     
    516566  void CAxis::computeConnectedClients(const std::vector<int>& globalDim, int orderPositionInGrid, 
    517567                                     CServerDistributionDescription::ServerDistributionType distType) 
     568  TRY 
    518569  { 
    519570    CContext* context = CContext::getCurrent(); 
     
    635686    } 
    636687  } 
     688  CATCH_DUMP_ATTR 
    637689 
    638690  /* 
     
    642694  */ 
    643695  void CAxis::computeWrittenIndex() 
     696  TRY 
    644697  {   
    645698    if (computedWrittenIndex_) return; 
     
    688741    } 
    689742  } 
     743  CATCH_DUMP_ATTR 
    690744 
    691745  void CAxis::computeWrittenCompressedIndex(MPI_Comm writtenComm) 
     746  TRY 
    692747  { 
    693748    int writtenCommSize; 
     
    758813    } 
    759814  } 
     815  CATCH_DUMP_ATTR 
    760816 
    761817  /*! 
     
    768824  void CAxis::sendDistributionAttribute(const std::vector<int>& globalDim, int orderPositionInGrid, 
    769825                                        CServerDistributionDescription::ServerDistributionType distType) 
     826  TRY 
    770827  { 
    771828    std::list<CContextClient*>::iterator it; 
     
    806863    } 
    807864  } 
     865  CATCH_DUMP_ATTR 
    808866 
    809867  /* 
     
    812870  */ 
    813871  void CAxis::recvDistributionAttribute(CEventServer& event) 
     872  TRY 
    814873  { 
    815874    CBufferIn* buffer = event.subEvents.begin()->buffer; 
     
    818877    get(axisId)->recvDistributionAttribute(*buffer); 
    819878  } 
     879  CATCH 
    820880 
    821881  /* 
     
    824884  */ 
    825885  void CAxis::recvDistributionAttribute(CBufferIn& buffer) 
     886  TRY 
    826887  { 
    827888    int ni_srv, begin_srv; 
     
    833894    begin.setValue(begin_srv); 
    834895  } 
     896  CATCH_DUMP_ATTR 
    835897 
    836898  /* 
     
    840902  */ 
    841903  void CAxis::sendNonDistributedAttributes() 
     904  TRY 
    842905  { 
    843906    std::list<CContextClient*>::iterator it; 
     
    893956    } 
    894957  } 
     958  CATCH_DUMP_ATTR 
    895959 
    896960  /* 
     
    899963  */ 
    900964  void CAxis::recvNonDistributedAttributes(CEventServer& event) 
     965  TRY 
    901966  { 
    902967    list<CEventServer::SSubEvent>::iterator it; 
     
    909974    } 
    910975  } 
     976  CATCH 
    911977 
    912978  /* 
     
    916982  */ 
    917983  void CAxis::recvNonDistributedAttributes(int rank, CBufferIn& buffer) 
     984  TRY 
    918985  {  
    919986    CArray<int,1> tmp_index, tmp_data_index; 
     
    9571024    for (int idx = 0; idx < index.numElements(); ++idx) globalLocalIndexMap_[index(idx)] = idx; 
    9581025  } 
     1026  CATCH_DUMP_ATTR 
    9591027 
    9601028  /* 
     
    9641032  */ 
    9651033  void CAxis::sendDistributedAttributes(void) 
     1034  TRY 
    9661035  { 
    9671036    int ns, n, i, j, ind, nv, idx; 
     
    10691138    } 
    10701139  } 
     1140  CATCH_DUMP_ATTR 
    10711141 
    10721142  /* 
     
    10751145  */ 
    10761146  void CAxis::recvDistributedAttributes(CEventServer& event) 
     1147  TRY 
    10771148  { 
    10781149    string axisId; 
     
    10901161    get(axisId)->recvDistributedAttributes(ranks, buffers); 
    10911162  } 
     1163  CATCH 
    10921164 
    10931165  /* 
     
    10971169  */ 
    10981170  void CAxis::recvDistributedAttributes(vector<int>& ranks, vector<CBufferIn*> buffers) 
     1171  TRY 
    10991172  { 
    11001173    int nbReceived = ranks.size(), idx, ind, gloInd, locInd; 
     
    12191292    data_begin.setValue(0); 
    12201293  } 
    1221  
     1294  CATCH_DUMP_ATTR 
    12221295 
    12231296  /*! 
     
    12291302  */ 
    12301303  bool CAxis::isEqual(CAxis* obj) 
     1304  TRY 
    12311305  { 
    12321306    vector<StdString> excludedAttr; 
     
    12521326    return objEqual; 
    12531327  } 
     1328  CATCH_DUMP_ATTR 
    12541329 
    12551330  /* 
     
    12591334  */ 
    12601335  CTransformation<CAxis>* CAxis::addTransformation(ETranformationType transType, const StdString& id) 
     1336  TRY 
    12611337  { 
    12621338    transformationMap_.push_back(std::make_pair(transType, CTransformation<CAxis>::createTransformation(transType,id))); 
    12631339    return transformationMap_.back().second; 
    12641340  } 
     1341  CATCH_DUMP_ATTR 
    12651342 
    12661343  /* 
     
    12681345  */ 
    12691346  bool CAxis::hasTransformation() 
     1347  TRY 
    12701348  { 
    12711349    return (!transformationMap_.empty()); 
    12721350  } 
     1351  CATCH_DUMP_ATTR 
    12731352 
    12741353  /* 
     
    12771356  */ 
    12781357  void CAxis::setTransformations(const TransMapTypes& axisTrans) 
     1358  TRY 
    12791359  { 
    12801360    transformationMap_ = axisTrans; 
    12811361  } 
     1362  CATCH_DUMP_ATTR 
    12821363 
    12831364  /* 
     
    12861367  */ 
    12871368  CAxis::TransMapTypes CAxis::getAllTransformations(void) 
     1369  TRY 
    12881370  { 
    12891371    return transformationMap_; 
    12901372  } 
     1373  CATCH_DUMP_ATTR 
    12911374 
    12921375  /* 
     
    12951378  */ 
    12961379  void CAxis::duplicateTransformation(CAxis* src) 
     1380  TRY 
    12971381  { 
    12981382    if (src->hasTransformation()) 
     
    13011385    } 
    13021386  } 
     1387  CATCH_DUMP_ATTR 
    13031388 
    13041389  /*! 
     
    13061391   */ 
    13071392  void CAxis::solveInheritanceTransformation() 
     1393  TRY 
    13081394  { 
    13091395    if (hasTransformation() || !hasDirectAxisReference()) 
     
    13221408        refAxis[i]->setTransformations(axis->getAllTransformations()); 
    13231409  } 
     1410  CATCH_DUMP_ATTR 
    13241411 
    13251412  void CAxis::setContextClient(CContextClient* contextClient) 
     1413  TRY 
    13261414  { 
    13271415    if (clientsSet.find(contextClient)==clientsSet.end()) 
     
    13301418      clientsSet.insert(contextClient); 
    13311419    } 
    1332 } 
     1420  } 
     1421  CATCH_DUMP_ATTR 
    13331422 
    13341423  void CAxis::parse(xml::CXMLNode & node) 
     1424  TRY 
    13351425  { 
    13361426    SuperClass::parse(node); 
     
    13631453    } 
    13641454  } 
     1455  CATCH_DUMP_ATTR 
    13651456 
    13661457  DEFINE_REF_FUNC(Axis,axis) 
  • XIOS/trunk/src/node/context.cpp

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

    r1542 r1622  
    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/trunk/src/node/domain.cpp

    r1578 r1622  
    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 
     
    182198     return attributesSizes; 
    183199   } 
     200   CATCH_DUMP_ATTR 
    184201 
    185202   //---------------------------------------------------------------- 
    186203 
    187204   bool CDomain::isEmpty(void) const 
     205   TRY 
    188206   { 
    189207     return ((this->i_index.isEmpty()) || (0 == this->i_index.numElements())); 
    190208   } 
     209   CATCH 
    191210 
    192211   //---------------------------------------------------------------- 
    193212 
    194213   bool CDomain::IsWritten(const StdString & filename) const 
     214   TRY 
    195215   { 
    196216      return (this->relFiles.find(filename) != this->relFiles.end()); 
    197217   } 
     218   CATCH 
    198219 
    199220   bool CDomain::isWrittenCompressed(const StdString& filename) const 
     221   TRY 
    200222   { 
    201223      return (this->relFilesCompressed.find(filename) != this->relFilesCompressed.end()); 
    202224   } 
     225   CATCH 
    203226 
    204227   //---------------------------------------------------------------- 
    205228 
    206229   bool CDomain::isDistributed(void) const 
     230   TRY 
    207231   { 
    208232      bool distributed =  !((!ni.isEmpty() && (ni == ni_glo) && !nj.isEmpty() && (nj == nj_glo)) || 
     
    212236      return distributed; 
    213237   } 
     238   CATCH 
    214239 
    215240   //---------------------------------------------------------------- 
     
    221246    */ 
    222247   bool CDomain::isCompressible(void) const 
     248   TRY 
    223249   { 
    224250      return isCompressible_; 
    225251   } 
     252   CATCH 
    226253 
    227254   void CDomain::addRelFile(const StdString & filename) 
     255   TRY 
    228256   { 
    229257      this->relFiles.insert(filename); 
    230258   } 
     259   CATCH_DUMP_ATTR 
    231260 
    232261   void CDomain::addRelFileCompressed(const StdString& filename) 
     262   TRY 
    233263   { 
    234264      this->relFilesCompressed.insert(filename); 
    235265   } 
     266   CATCH_DUMP_ATTR 
    236267 
    237268   StdString CDomain::GetName(void)   { return (StdString("domain")); } 
     
    246277   */ 
    247278   bool CDomain::distributionAttributesHaveValue() const 
     279   TRY 
    248280   { 
    249281      bool hasValues = true; 
     
    257289      return hasValues; 
    258290   } 
     291   CATCH 
    259292 
    260293   /*! 
     
    266299   */ 
    267300   void CDomain::redistribute(int nbLocalDomain) 
     301   TRY 
    268302   { 
    269303     if (this->isRedistributed_) return; 
     
    428462     checkDomain(); 
    429463   } 
     464   CATCH_DUMP_ATTR 
    430465 
    431466   /*! 
     
    433468   */ 
    434469   void CDomain::fillInLonLat() 
     470   TRY 
    435471   { 
    436472     switch (type) 
     
    450486     } 
    451487     completeLonLatClient() ; 
    452  
    453    } 
     488   } 
     489   CATCH_DUMP_ATTR 
    454490 
    455491   /*! 
     
    459495   */ 
    460496   void CDomain::fillInRectilinearLonLat() 
     497   TRY 
    461498   { 
    462499     if (!lonvalue_rectilinear_read_from_file.isEmpty() && lonvalue_2d.isEmpty() && lonvalue_1d.isEmpty()) 
     
    527564     } 
    528565   } 
     566   CATCH_DUMP_ATTR 
    529567 
    530568    /* 
     
    533571    */ 
    534572   void CDomain::fillInCurvilinearLonLat() 
     573   TRY 
    535574   { 
    536575     if (!lonvalue_curvilinear_read_from_file.isEmpty() && lonvalue_2d.isEmpty() && lonvalue_1d.isEmpty()) 
     
    575614       bounds_latvalue_curvilinear_read_from_file.free(); 
    576615     } 
    577  
    578    } 
     616   } 
     617   CATCH_DUMP_ATTR 
    579618 
    580619    /* 
     
    583622    */ 
    584623   void CDomain::fillInUnstructuredLonLat() 
     624   TRY 
    585625   { 
    586626     if (i_index.isEmpty()) 
     
    634674     } 
    635675   } 
     676   CATCH_DUMP_ATTR 
    636677 
    637678  /* 
     
    639680  */ 
    640681   void CDomain::AllgatherRectilinearLonLat(CArray<double,1>& lon, CArray<double,1>& lat, CArray<double,1>& lon_g, CArray<double,1>& lat_g) 
     682   TRY 
    641683   { 
    642684     CContext* context = CContext::getCurrent(); 
     
    670712      delete[] nj_g ; 
    671713   } 
     714   CATCH_DUMP_ATTR 
    672715 
    673716   void CDomain::fillInRectilinearBoundLonLat(CArray<double,1>& lon, CArray<double,1>& lat, 
    674717                                              CArray<double,2>& boundsLon, CArray<double,2>& boundsLat) 
    675    { 
     718   TRY 
     719  { 
    676720     int i,j,k; 
    677721 
     
    772816      } 
    773817   } 
     818   CATCH_DUMP_ATTR 
    774819 
    775820   /* 
     
    777822   */ 
    778823   void CDomain::checkDomain(void) 
     824   TRY 
    779825   { 
    780826     if (type.isEmpty()) 
     
    868914     } 
    869915   } 
     916   CATCH_DUMP_ATTR 
    870917 
    871918   size_t CDomain::getGlobalWrittenSize(void) 
     
    877924   // Check validity of local domain on using the combination of 3 parameters: ibegin, ni and i_index 
    878925   void CDomain::checkLocalIDomain(void) 
     926   TRY 
    879927   { 
    880928      // If ibegin and ni are provided then we use them to check the validity of local domain 
     
    935983      } 
    936984   } 
     985   CATCH_DUMP_ATTR 
    937986 
    938987   // Check validity of local domain on using the combination of 3 parameters: jbegin, nj and j_index 
    939988   void CDomain::checkLocalJDomain(void) 
     989   TRY 
    940990   { 
    941991    // If jbegin and nj are provided then we use them to check the validity of local domain 
     
    9861036     } 
    9871037   } 
     1038   CATCH_DUMP_ATTR 
    9881039 
    9891040   //---------------------------------------------------------------- 
    9901041 
    9911042   void CDomain::checkMask(void) 
     1043   TRY 
    9921044   { 
    9931045      if (!mask_1d.isEmpty() && !mask_2d.isEmpty()) 
     
    10351087     } 
    10361088   } 
     1089   CATCH_DUMP_ATTR 
    10371090 
    10381091   //---------------------------------------------------------------- 
    10391092 
    10401093   void CDomain::checkDomainData(void) 
     1094   TRY 
    10411095   { 
    10421096      if (data_dim.isEmpty()) 
     
    10781132      } 
    10791133   } 
     1134   CATCH_DUMP_ATTR 
    10801135 
    10811136   //---------------------------------------------------------------- 
    10821137 
    10831138   void CDomain::checkCompression(void) 
     1139   TRY 
    10841140   { 
    10851141      if (!data_i_index.isEmpty()) 
     
    11481204      } 
    11491205   } 
     1206   CATCH_DUMP_ATTR 
    11501207 
    11511208   //---------------------------------------------------------------- 
    11521209   void CDomain::computeLocalMask(void) 
     1210   TRY 
    11531211   { 
    11541212     localMask.resize(i_index.numElements()) ; 
     
    11821240     } 
    11831241   } 
     1242   CATCH_DUMP_ATTR 
    11841243 
    11851244   void CDomain::checkEligibilityForCompressedOutput(void) 
     1245   TRY 
    11861246   { 
    11871247     // We don't check if the mask or the indexes are valid here, just if they have been defined at this point. 
    11881248     isCompressible_ = !mask_1d.isEmpty() || !mask_2d.isEmpty() || !data_i_index.isEmpty(); 
    11891249   } 
     1250   CATCH_DUMP_ATTR 
    11901251 
    11911252   //---------------------------------------------------------------- 
     
    11961257   */ 
    11971258   void CDomain::completeLonLatClient(void) 
     1259   TRY 
    11981260   { 
    11991261     bool lonlatValueExisted = (0 != lonvalue.numElements()) || (0 != latvalue.numElements()); 
     
    13091371     } 
    13101372   } 
     1373   CATCH_DUMP_ATTR 
    13111374 
    13121375   /* 
     
    13141377   */ 
    13151378   void CDomain::convertLonLatValue(void) 
     1379   TRY 
    13161380   { 
    13171381     bool lonlatValueExisted = (0 != lonvalue.numElements()) || (0 != latvalue.numElements()); 
     
    14111475     } 
    14121476   } 
    1413  
     1477   CATCH_DUMP_ATTR 
    14141478 
    14151479   void CDomain::checkBounds(void) 
     1480   TRY 
    14161481   { 
    14171482     bool hasBoundValues = (0 != bounds_lonvalue.numElements()) || (0 != bounds_latvalue.numElements()); 
     
    15051570     } 
    15061571   } 
     1572   CATCH_DUMP_ATTR 
    15071573 
    15081574   void CDomain::checkArea(void) 
     1575   TRY 
    15091576   { 
    15101577     bool hasAreaValue = (!areavalue.isEmpty() && 0 != areavalue.numElements()); 
     
    15341601     } 
    15351602   } 
     1603   CATCH_DUMP_ATTR 
    15361604 
    15371605   void CDomain::checkLonLat() 
     1606   TRY 
    15381607   { 
    15391608     if (!hasLonLat) hasLonLat = (!latvalue_1d.isEmpty() && !lonvalue_1d.isEmpty()) || 
     
    15951664     } 
    15961665   } 
     1666   CATCH_DUMP_ATTR 
    15971667 
    15981668   void CDomain::checkAttributesOnClientAfterTransformation() 
     1669   TRY 
    15991670   { 
    16001671     CContext* context=CContext::getCurrent() ; 
     
    16111682     this->isClientAfterTransformationChecked = true; 
    16121683   } 
     1684   CATCH_DUMP_ATTR 
    16131685 
    16141686   //---------------------------------------------------------------- 
     
    16161688   // This function only checks all attributes of current domain 
    16171689   void CDomain::checkAttributesOnClient() 
     1690   TRY 
    16181691   { 
    16191692     if (this->isClientChecked) return; 
     
    16411714      this->isClientChecked = true; 
    16421715   } 
     1716   CATCH_DUMP_ATTR 
    16431717 
    16441718   // Send all checked attributes to server 
    16451719   void CDomain::sendCheckedAttributes() 
     1720   TRY 
    16461721   { 
    16471722     if (!this->isClientChecked) checkAttributesOnClient(); 
     
    16561731     this->isChecked = true; 
    16571732   } 
     1733   CATCH_DUMP_ATTR 
    16581734 
    16591735   void CDomain::checkAttributes(void) 
     1736   TRY 
    16601737   { 
    16611738      if (this->isChecked) return; 
     
    16871764      this->isChecked = true; 
    16881765   } 
     1766   CATCH_DUMP_ATTR 
    16891767 
    16901768  /*! 
     
    16951773  */ 
    16961774  void CDomain::computeConnectedClients() 
     1775  TRY 
    16971776  { 
    16981777    CContext* context=CContext::getCurrent() ; 
     
    17991878    } 
    18001879  } 
     1880  CATCH_DUMP_ATTR 
    18011881 
    18021882   /*! 
     
    18061886   */ 
    18071887   void CDomain::computeWrittenIndex() 
     1888   TRY 
    18081889   {   
    18091890      if (computedWrittenIndex_) return; 
     
    19001981      // }       
    19011982   } 
     1983   CATCH_DUMP_ATTR 
    19021984 
    19031985  void CDomain::computeWrittenCompressedIndex(MPI_Comm writtenComm) 
     1986  TRY 
    19041987  { 
    19051988    int writtenCommSize; 
     
    19692052      } 
    19702053  } 
     2054  CATCH_DUMP_ATTR 
    19712055 
    19722056  /*! 
     
    19752059  */ 
    19762060  void CDomain::sendAttributes() 
     2061  TRY 
    19772062  { 
    19782063    sendDistributionAttributes(); 
     
    19832068    sendDataIndex(); 
    19842069  } 
    1985  
     2070  CATCH 
    19862071  /*! 
    19872072    Send global index from client to connected client(s) 
    19882073  */ 
    19892074  void CDomain::sendIndex() 
     2075  TRY 
    19902076  { 
    19912077    int ns, n, i, j, ind, nv, idx; 
     
    20302116    } 
    20312117  } 
     2118  CATCH_DUMP_ATTR 
    20322119 
    20332120  /*! 
     
    20372124  */ 
    20382125  void CDomain::sendDistributionAttributes(void) 
     2126  TRY 
    20392127  { 
    20402128    std::list<CContextClient*>::iterator it; 
     
    20832171    } 
    20842172  } 
     2173  CATCH_DUMP_ATTR 
    20852174 
    20862175  /*! 
     
    20882177  */ 
    20892178  void CDomain::sendMask() 
     2179  TRY 
    20902180  { 
    20912181    int ns, n, i, j, ind, nv, idx; 
     
    21272217    } 
    21282218  } 
     2219  CATCH_DUMP_ATTR 
    21292220 
    21302221  /*! 
     
    21322223  */ 
    21332224  void CDomain::sendArea() 
     2225  TRY 
    21342226  { 
    21352227    if (!hasArea) return; 
     
    21752267    } 
    21762268  } 
     2269  CATCH_DUMP_ATTR 
    21772270 
    21782271  /*! 
     
    21822275  */ 
    21832276  void CDomain::sendLonLat() 
     2277  TRY 
    21842278  { 
    21852279    if (!hasLonLat) return; 
     
    22702364    } 
    22712365  } 
     2366  CATCH_DUMP_ATTR 
    22722367 
    22732368  /*! 
     
    22782373  */ 
    22792374  void CDomain::sendDataIndex() 
     2375  TRY 
    22802376  { 
    22812377    int ns, n, i, j, ind, nv, idx; 
     
    23462442    } 
    23472443  } 
     2444  CATCH 
    23482445   
    23492446  bool CDomain::dispatchEvent(CEventServer& event) 
     2447  TRY 
    23502448  { 
    23512449    if (SuperClass::dispatchEvent(event)) return true; 
     
    23892487    } 
    23902488  } 
     2489  CATCH 
    23912490 
    23922491  /*! 
     
    23952494  */ 
    23962495  void CDomain::recvIndex(CEventServer& event) 
     2496  TRY 
    23972497  { 
    23982498    string domainId; 
     
    24082508    get(domainId)->recvIndex(rankBuffers); 
    24092509  } 
     2510  CATCH 
    24102511 
    24112512  /*! 
     
    24152516  */ 
    24162517  void CDomain::recvIndex(std::map<int, CBufferIn*>& rankBuffers) 
     2518  TRY 
    24172519  { 
    24182520    int nbReceived = rankBuffers.size(), i, ind, index, type_int, iIndex, jIndex; 
     
    24792581    } 
    24802582  } 
     2583  CATCH 
    24812584 
    24822585  /*! 
     
    24852588  */ 
    24862589  void CDomain::recvDistributionAttributes(CEventServer& event) 
     2590  TRY 
    24872591  { 
    24882592    CBufferIn* buffer=event.subEvents.begin()->buffer; 
     
    24912595    get(domainId)->recvDistributionAttributes(*buffer); 
    24922596  } 
     2597  CATCH 
    24932598 
    24942599  /*! 
     
    24982603  */ 
    24992604  void CDomain::recvDistributionAttributes(CBufferIn& buffer) 
     2605  TRY 
    25002606  { 
    25012607    int ni_tmp, ibegin_tmp, nj_tmp, jbegin_tmp; 
     
    25132619 
    25142620  } 
     2621  CATCH_DUMP_ATTR 
    25152622 
    25162623  /*! 
     
    25192626  */ 
    25202627  void CDomain::recvMask(CEventServer& event) 
     2628  TRY 
    25212629  { 
    25222630    string domainId; 
     
    25322640    get(domainId)->recvMask(rankBuffers); 
    25332641  } 
    2534  
     2642  CATCH 
    25352643 
    25362644  /*! 
     
    25392647  */ 
    25402648  void CDomain::recvMask(std::map<int, CBufferIn*>& rankBuffers) 
     2649  TRY 
    25412650  { 
    25422651    int nbReceived = rankBuffers.size(), i, ind, index, lInd; 
     
    25822691    domainMask=mask_1d ; 
    25832692  } 
     2693  CATCH_DUMP_ATTR 
    25842694 
    25852695  /*! 
     
    25882698  */ 
    25892699  void CDomain::recvLon(CEventServer& event) 
     2700  TRY 
    25902701  { 
    25912702    string domainId; 
     
    26012712    get(domainId)->recvLon(rankBuffers); 
    26022713  } 
     2714  CATCH 
    26032715 
    26042716  /*! 
     
    26072719  */ 
    26082720  void CDomain::recvLon(std::map<int, CBufferIn*>& rankBuffers) 
     2721  TRY 
    26092722  { 
    26102723    int nbReceived = rankBuffers.size(), i, ind, index, iindex, jindex, lInd; 
     
    26662779    } 
    26672780  } 
     2781  CATCH_DUMP_ATTR 
    26682782 
    26692783  /*! 
     
    26722786  */ 
    26732787  void CDomain::recvLat(CEventServer& event) 
     2788  TRY 
    26742789  { 
    26752790    string domainId; 
     
    26852800    get(domainId)->recvLat(rankBuffers); 
    26862801  } 
     2802  CATCH 
    26872803 
    26882804  /*! 
     
    26912807  */ 
    26922808  void CDomain::recvLat(std::map<int, CBufferIn*>& rankBuffers) 
     2809  TRY 
    26932810  { 
    26942811    int nbReceived = rankBuffers.size(), i, ind, index, iindex, jindex, lInd; 
     
    27522869    } 
    27532870  } 
     2871  CATCH_DUMP_ATTR 
    27542872 
    27552873  /*! 
     
    27582876  */ 
    27592877  void CDomain::recvArea(CEventServer& event) 
     2878  TRY 
    27602879  { 
    27612880    string domainId; 
     
    27712890    get(domainId)->recvArea(rankBuffers); 
    27722891  } 
     2892  CATCH 
    27732893 
    27742894  /*! 
     
    27772897  */ 
    27782898  void CDomain::recvArea(std::map<int, CBufferIn*>& rankBuffers) 
     2899  TRY 
    27792900  { 
    27802901    int nbReceived = rankBuffers.size(), i, ind, index, lInd; 
     
    28222943    } 
    28232944  } 
     2945  CATCH_DUMP_ATTR 
    28242946 
    28252947  /*! 
     
    28312953  */ 
    28322954  bool CDomain::isEqual(CDomain* obj) 
     2955  TRY 
    28332956  { 
    28342957    vector<StdString> excludedAttr; 
     
    28532976    return objEqual; 
    28542977  } 
     2978  CATCH_DUMP_ATTR 
    28552979 
    28562980  /*! 
     
    28592983  */ 
    28602984  void CDomain::recvDataIndex(CEventServer& event) 
     2985  TRY 
    28612986  { 
    28622987    string domainId; 
     
    28722997    get(domainId)->recvDataIndex(rankBuffers); 
    28732998  } 
     2999  CATCH 
    28743000 
    28753001  /*! 
     
    28833009  */ 
    28843010  void CDomain::recvDataIndex(std::map<int, CBufferIn*>& rankBuffers) 
     3011  TRY 
    28853012  { 
    28863013    int nbReceived = rankBuffers.size(), i, ind, index, indexI, indexJ, type_int, lInd;     
     
    29543081    data_jbegin.setValue(0); 
    29553082  } 
     3083  CATCH_DUMP_ATTR 
    29563084 
    29573085  CTransformation<CDomain>* CDomain::addTransformation(ETranformationType transType, const StdString& id) 
     3086  TRY 
    29583087  { 
    29593088    transformationMap_.push_back(std::make_pair(transType, CTransformation<CDomain>::createTransformation(transType,id))); 
    29603089    return transformationMap_.back().second; 
    29613090  } 
     3091  CATCH_DUMP_ATTR 
    29623092 
    29633093  /*! 
     
    29663096  */ 
    29673097  bool CDomain::hasTransformation() 
     3098  TRY 
    29683099  { 
    29693100    return (!transformationMap_.empty()); 
    29703101  } 
     3102  CATCH_DUMP_ATTR 
    29713103 
    29723104  /*! 
     
    29753107  */ 
    29763108  void CDomain::setTransformations(const TransMapTypes& domTrans) 
     3109  TRY 
    29773110  { 
    29783111    transformationMap_ = domTrans; 
    29793112  } 
     3113  CATCH_DUMP_ATTR 
    29803114 
    29813115  /*! 
     
    29843118  */ 
    29853119  CDomain::TransMapTypes CDomain::getAllTransformations(void) 
     3120  TRY 
    29863121  { 
    29873122    return transformationMap_; 
    29883123  } 
     3124  CATCH_DUMP_ATTR 
    29893125 
    29903126  void CDomain::duplicateTransformation(CDomain* src) 
     3127  TRY 
    29913128  { 
    29923129    if (src->hasTransformation()) 
     
    29953132    } 
    29963133  } 
     3134  CATCH_DUMP_ATTR 
    29973135 
    29983136  /*! 
     
    30003138   */ 
    30013139  void CDomain::solveInheritanceTransformation() 
     3140  TRY 
    30023141  { 
    30033142    if (hasTransformation() || !hasDirectDomainReference()) 
     
    30163155        refDomains[i]->setTransformations(domain->getAllTransformations()); 
    30173156  } 
     3157  CATCH_DUMP_ATTR 
    30183158 
    30193159  void CDomain::setContextClient(CContextClient* contextClient) 
     3160  TRY 
    30203161  { 
    30213162    if (clientsSet.find(contextClient)==clientsSet.end()) 
     
    30253166    } 
    30263167  } 
     3168  CATCH_DUMP_ATTR 
    30273169 
    30283170  /*! 
     
    30323174  */ 
    30333175  void CDomain::parse(xml::CXMLNode & node) 
     3176  TRY 
    30343177  { 
    30353178    SuperClass::parse(node); 
     
    30623205    } 
    30633206  } 
     3207  CATCH_DUMP_ATTR 
    30643208   //---------------------------------------------------------------- 
    30653209 
  • XIOS/trunk/src/node/field.cpp

    r1574 r1622  
    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   } 
    1728  
     1887   CATCH 
    17291888 
    17301889   DEFINE_REF_FUNC(Field,field) 
  • XIOS/trunk/src/node/field_impl.hpp

    r1201 r1622  
    1717  template <int N> 
    1818  void CField::setData(const CArray<double, N>& _data) 
     19  TRY 
    1920  { 
    2021    if (clientSourceFilter) 
     
    2728            << "Impossible to receive data from the model for a field [ id = " << getId() << " ] with a reference or an arithmetic operation."); 
    2829  } 
     30  CATCH_DUMP_ATTR 
    2931 
    3032  template <int N> 
    3133  void CField::getData(CArray<double, N>& _data) const 
     34  TRY 
    3235  { 
    3336    if (storeFilter) 
     
    4548    } 
    4649  } 
     50  CATCH 
    4751} // namespace xios 
    4852 
  • XIOS/trunk/src/node/file.cpp

    r1542 r1622  
    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/trunk/src/node/file.hpp

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

    r1562 r1622  
    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   } 
     365   CATCH_DUMP_ATTR 
    341366 
    342367   /* 
     
    344369   */ 
    345370   void CGrid::createMask(void) 
     371   TRY 
    346372   { 
    347373      using namespace std; 
     
    381407      } 
    382408   } 
     409   CATCH_DUMP_ATTR 
    383410 
    384411   /* 
     
    386413   */ 
    387414   void CGrid::checkMask(void) 
     415   TRY 
    388416   { 
    389417      using namespace std; 
     
    423451      } 
    424452   } 
    425  
     453   CATCH_DUMP_ATTR 
    426454 
    427455/*! 
     
    433461 
    434462  void CGrid::getLocalMask(CArray<bool,1>& localMask) 
     463  TRY 
    435464  { 
    436465      std::vector<CDomain*> domainP = this->getDomains(); 
     
    468497      } 
    469498  } 
     499  CATCH_DUMP_ATTR 
    470500       
    471501   /* 
     
    476506   */ 
    477507   void CGrid::modifyMask(const CArray<int,1>& indexToModify, bool modifyValue) 
     508   TRY 
    478509   { 
    479510      using namespace std; 
     
    511542      } 
    512543   } 
     544   CATCH_DUMP_ATTR 
    513545 
    514546   /* 
     
    518550   */ 
    519551   void CGrid::modifyMaskSize(const std::vector<int>& newDimensionSize, bool newValue) 
     552   TRY 
    520553   {       
    521554      std::vector<CDomain*> domainP = this->getDomains(); 
     
    552585      } 
    553586   } 
     587   CATCH_DUMP_ATTR 
    554588 
    555589   //--------------------------------------------------------------- 
    556590 
    557591   void CGrid::solveDomainRef(bool sendAtt) 
     592   TRY 
    558593   { 
    559594      setDomainList(); 
     
    568603      } 
    569604   } 
     605   CATCH_DUMP_ATTR 
    570606 
    571607   //--------------------------------------------------------------- 
    572608 
    573609   void CGrid::solveAxisRef(bool sendAtt) 
     610   TRY 
    574611   { 
    575612      setAxisList(); 
     
    599636      } 
    600637   } 
     638   CATCH_DUMP_ATTR 
    601639 
    602640   //--------------------------------------------------------------- 
    603641 
    604642   void CGrid::solveScalarRef(bool sendAtt) 
     643   TRY 
    605644   { 
    606645      setScalarList(); 
     
    616655      } 
    617656   } 
     657   CATCH_DUMP_ATTR 
    618658 
    619659   /*! 
     
    621661   */ 
    622662   void CGrid::computeWrittenIndex() 
     663   TRY 
    623664   {       
    624665      if (computedWrittenIndex_) return; 
     
    680721      } 
    681722   } 
     723   CATCH_DUMP_ATTR 
    682724 
    683725   //--------------------------------------------------------------- 
     
    690732   */ 
    691733   void CGrid::computeClientIndex() 
     734   TRY 
    692735   { 
    693736     CContext* context = CContext::getCurrent(); 
     
    746789      } 
    747790   } 
     791   CATCH_DUMP_ATTR 
    748792 
    749793   /*! 
     
    751795   */ 
    752796   void CGrid::computeConnectedClients() 
     797   TRY 
    753798   { 
    754799     CContext* context = CContext::getCurrent(); 
     
    844889     } 
    845890   } 
     891   CATCH_DUMP_ATTR 
    846892 
    847893   /*! 
     
    853899   */ 
    854900   void CGrid::computeIndex(void) 
     901   TRY 
    855902   { 
    856903     CContext* context = CContext::getCurrent(); 
     
    879926     } 
    880927   } 
     928   CATCH_DUMP_ATTR 
    881929 
    882930   /*! 
     
    892940                                     const CContextClient* client, 
    893941                                     CClientServerMapping::GlobalIndexMap& globalIndexOnServer) 
     942   TRY 
    894943   { 
    895944     int serverSize = client->serverSize; 
     
    10581107    } 
    10591108   } 
    1060    //---------------------------------------------------------------- 
     1109   CATCH_DUMP_ATTR 
     1110//---------------------------------------------------------------- 
    10611111 
    10621112   CGrid* CGrid::createGrid(CDomain* domain) 
     1113   TRY 
    10631114   { 
    10641115      std::vector<CDomain*> vecDom(1, domain); 
     
    10671118      return createGrid(vecDom, vecAxis); 
    10681119   } 
     1120   CATCH 
    10691121 
    10701122   CGrid* CGrid::createGrid(CDomain* domain, CAxis* axis) 
    1071    { 
     1123   TRY 
     1124  { 
    10721125      std::vector<CDomain*> vecDom(1, domain); 
    10731126      std::vector<CAxis*> vecAxis(1, axis); 
     
    10751128      return createGrid(vecDom, vecAxis); 
    10761129   } 
     1130   CATCH 
    10771131 
    10781132   CGrid* CGrid::createGrid(const std::vector<CDomain*>& domains, const std::vector<CAxis*>& axis, 
    10791133                            const CArray<int,1>& axisDomainOrder) 
     1134   TRY 
    10801135   { 
    10811136     std::vector<CScalar*> vecScalar; 
    10821137     return createGrid(generateId(domains, axis, vecScalar, axisDomainOrder), domains, axis, vecScalar, axisDomainOrder); 
    10831138   } 
     1139   CATCH 
    10841140 
    10851141   CGrid* CGrid::createGrid(const std::vector<CDomain*>& domains, const std::vector<CAxis*>& axis, 
    10861142                            const std::vector<CScalar*>& scalars, const CArray<int,1>& axisDomainOrder) 
     1143   TRY 
    10871144   { 
    10881145     return createGrid(generateId(domains, axis, scalars, axisDomainOrder), domains, axis, scalars, axisDomainOrder); 
    10891146   } 
     1147   CATCH 
    10901148 
    10911149   CGrid* CGrid::createGrid(StdString id, const std::vector<CDomain*>& domains, const std::vector<CAxis*>& axis, 
    10921150                            const std::vector<CScalar*>& scalars, const CArray<int,1>& axisDomainOrder) 
     1151   TRY 
    10931152   { 
    10941153      if (axisDomainOrder.numElements() > 0 && axisDomainOrder.numElements() != (domains.size() + axis.size() + scalars.size())) 
     
    11321191      return grid; 
    11331192   } 
     1193   CATCH 
    11341194 
    11351195   CGrid* CGrid::cloneGrid(const StdString& idNewGrid, CGrid* gridSrc) 
     1196   TRY 
    11361197   { 
    11371198     std::vector<CDomain*> domainSrcTmp = gridSrc->getDomains(), domainSrc; 
     
    11731234      return grid; 
    11741235   } 
     1236   CATCH 
    11751237 
    11761238   StdString CGrid::generateId(const std::vector<CDomain*>& domains, const std::vector<CAxis*>& axis, 
    11771239                               const std::vector<CScalar*>& scalars, const CArray<int,1>& axisDomainOrder) 
     1240   TRY 
    11781241   { 
    11791242      if (axisDomainOrder.numElements() > 0 && axisDomainOrder.numElements() != (domains.size() + axis.size() + scalars.size())) 
     
    12161279      return id.str(); 
    12171280   } 
     1281   CATCH 
    12181282 
    12191283   StdString CGrid::generateId(const CGrid* gridSrc, const CGrid* gridDest) 
     1284   TRY 
    12201285   { 
    12211286     StdString idSrc  = gridSrc->getId(); 
     
    12271292     return id.str(); 
    12281293   } 
     1294   CATCH 
    12291295 
    12301296   //---------------------------------------------------------------- 
    12311297 
    12321298   CDomainGroup* CGrid::getVirtualDomainGroup() const 
     1299   TRY 
    12331300   { 
    12341301     return this->vDomainGroup_; 
    12351302   } 
     1303   CATCH 
    12361304 
    12371305   CAxisGroup* CGrid::getVirtualAxisGroup() const 
     1306   TRY 
    12381307   { 
    12391308     return this->vAxisGroup_; 
    12401309   } 
     1310   CATCH 
    12411311 
    12421312   CScalarGroup* CGrid::getVirtualScalarGroup() const 
     1313   TRY 
    12431314   { 
    12441315     return this->vScalarGroup_; 
    12451316   } 
     1317   CATCH 
    12461318 
    12471319/* 
     
    12791351 
    12801352   void CGrid::storeField_arr(const double* const data, CArray<double, 1>& stored) const 
     1353   TRY 
    12811354   { 
    12821355      const StdSize size = storeIndex_client.numElements(); 
     
    12851358      for(StdSize i = 0; i < size; i++) stored(i) = data[storeIndex_client(i)]; 
    12861359   } 
     1360   CATCH 
    12871361 
    12881362   void CGrid::restoreField_arr(const CArray<double, 1>& stored, double* const data) const 
     1363   TRY 
    12891364   { 
    12901365      const StdSize size = storeIndex_client.numElements(); 
     
    12921367      for(StdSize i = 0; i < size; i++) data[storeIndex_client(i)] = stored(i); 
    12931368   } 
     1369   CATCH 
    12941370 
    12951371   void CGrid::uncompressField_arr(const double* const data, CArray<double, 1>& out) const 
     1372   TRY 
    12961373   { 
    12971374      const std::vector<int>& localMaskedDataIndex = clientDistribution_->getLocalMaskedDataIndexOnClient(); 
     
    12991376      for(int i = 0; i < size; ++i) out(localMaskedDataIndex[i]) = data[i]; 
    13001377   } 
    1301  
     1378   CATCH 
    13021379 
    13031380  void CGrid::computeClientIndexScalarGrid() 
     1381  TRY 
    13041382  { 
    13051383    CContext* context = CContext::getCurrent();     
     
    13351413    } 
    13361414  } 
     1415  CATCH_DUMP_ATTR 
    13371416 
    13381417  void CGrid::computeConnectedClientsScalarGrid() 
     1418  TRY 
    13391419  { 
    13401420    CContext* context = CContext::getCurrent();     
     
    13811461    } 
    13821462  } 
     1463  CATCH_DUMP_ATTR 
    13831464 
    13841465  void CGrid::sendIndexScalarGrid() 
     1466  TRY 
    13851467  { 
    13861468    CContext* context = CContext::getCurrent(); 
     
    14461528    } 
    14471529  } 
     1530  CATCH_DUMP_ATTR 
    14481531 
    14491532  void CGrid::sendIndex(void) 
     1533  TRY 
    14501534  { 
    14511535    CContext* context = CContext::getCurrent(); 
     
    15671651    } 
    15681652  } 
     1653  CATCH_DUMP_ATTR 
    15691654 
    15701655  void CGrid::recvIndex(CEventServer& event) 
     1656  TRY 
    15711657  { 
    15721658    string gridId; 
     
    15841670    get(gridId)->recvIndex(ranks, buffers); 
    15851671  } 
     1672  CATCH 
    15861673 
    15871674  void CGrid::recvIndex(vector<int> ranks, vector<CBufferIn*> buffers) 
     1675  TRY 
    15881676  { 
    15891677    CContext* context = CContext::getCurrent(); 
     
    17911879    } 
    17921880  } 
     1881  CATCH_DUMP_ATTR 
    17931882 
    17941883  /* 
     
    18061895                                        const std::vector<CScalar*> scalars, 
    18071896                                        const CArray<int,1>& axisDomainOrder) 
    1808   { 
     1897  TRY 
     1898 { 
    18091899 //   globalDim.resize(domains.size()*2+axis.size()+scalars.size()); 
    18101900    globalDim.resize(domains.size()*2+axis.size()); 
     
    18461936    return positionDimensionDistributed; 
    18471937  } 
     1938  CATCH_DUMP_ATTR 
    18481939 
    18491940  // Retrieve the global dimension of grid 
    18501941  std::vector<int> CGrid::getGlobalDimension() 
     1942  TRY 
    18511943  { 
    18521944    std::vector<int> globalDim; 
     
    18551947    return globalDim; 
    18561948  } 
     1949  CATCH_DUMP_ATTR 
    18571950 
    18581951  // Retrieve dimension on which we do distribution (Very often, it should be 2nd dimension) 
    18591952  int CGrid::getDistributedDimension() 
     1953  TRY 
    18601954  { 
    18611955    std::vector<int> globalDim; 
    18621956    return computeGridGlobalDimension(globalDim, getDomains(), getAxis(), getScalars(), axis_domain_order);     
    18631957  } 
     1958  CATCH_DUMP_ATTR 
    18641959 
    18651960  bool CGrid::isScalarGrid() const 
     1961  TRY 
    18661962  { 
    18671963    return (axisList_.empty() && domList_.empty()); 
    18681964  } 
     1965  CATCH 
    18691966 
    18701967  /*! 
     
    18741971  */ 
    18751972  bool CGrid::doGridHaveDataToWrite() 
     1973  TRY 
    18761974  { 
    18771975     return (0 != writtenDataSize_); 
    18781976  } 
     1977  CATCH_DUMP_ATTR 
    18791978 
    18801979  /*! 
     
    18851984  */ 
    18861985  size_t CGrid::getWrittenDataSize() const 
     1986  TRY 
    18871987  { 
    18881988    return writtenDataSize_; 
    18891989  } 
     1990  CATCH 
    18901991 
    18911992  /*! 
     
    18941995  */ 
    18951996  int CGrid::getNumberWrittenIndexes() const 
     1997  TRY 
    18961998  { 
    18971999    return numberWrittenIndexes_; 
    18982000  } 
     2001  CATCH 
    18992002 
    19002003  /*! 
     
    19032006  */ 
    19042007  int CGrid::getTotalNumberWrittenIndexes() const 
     2008  TRY 
    19052009  { 
    19062010    return totalNumberWrittenIndexes_; 
    19072011  } 
     2012  CATCH 
    19082013 
    19092014  /*! 
     
    19122017  */ 
    19132018  int CGrid::getOffsetWrittenIndexes() const 
     2019  TRY 
    19142020  { 
    19152021    return offsetWrittenIndexes_; 
    19162022  } 
     2023  CATCH 
    19172024 
    19182025  CDistributionServer* CGrid::getDistributionServer() 
     2026  TRY 
    19192027  { 
    19202028    return serverDistribution_; 
    19212029  } 
     2030  CATCH_DUMP_ATTR 
    19222031 
    19232032  CDistributionClient* CGrid::getDistributionClient() 
     2033  TRY 
    19242034  { 
    19252035    return clientDistribution_; 
    19262036  } 
     2037  CATCH_DUMP_ATTR 
    19272038 
    19282039  bool CGrid::doGridHaveDataDistributed(CContextClient* client) 
     2040  TRY 
    19292041  { 
    19302042    if (isScalarGrid()) return false; 
     
    19362048      return isDataDistributed_;     
    19372049  } 
     2050  CATCH_DUMP_ATTR 
    19382051 
    19392052   /*! 
     
    19452058   */ 
    19462059  bool CGrid::dispatchEvent(CEventServer& event) 
     2060  TRY 
    19472061  { 
    19482062 
     
    19782092    } 
    19792093  } 
     2094  CATCH 
    19802095 
    19812096   ///--------------------------------------------------------------- 
    19822097 
    19832098   CDomain* CGrid::addDomain(const std::string& id) 
     2099   TRY 
    19842100   { 
    19852101     order_.push_back(2); 
     
    19882104     return vDomainGroup_->createChild(id); 
    19892105   } 
     2106   CATCH_DUMP_ATTR 
    19902107 
    19912108   CAxis* CGrid::addAxis(const std::string& id) 
     2109   TRY 
    19922110   { 
    19932111     order_.push_back(1); 
     
    19962114     return vAxisGroup_->createChild(id); 
    19972115   } 
     2116   CATCH_DUMP_ATTR 
    19982117 
    19992118   CScalar* CGrid::addScalar(const std::string& id) 
     2119   TRY 
    20002120   { 
    20012121     order_.push_back(0); 
     
    20042124     return vScalarGroup_->createChild(id); 
    20052125   } 
     2126   CATCH_DUMP_ATTR 
    20062127 
    20072128   //! Change virtual field group to a new one 
    20082129   void CGrid::setVirtualDomainGroup(CDomainGroup* newVDomainGroup) 
     2130   TRY 
    20092131   { 
    20102132      this->vDomainGroup_ = newVDomainGroup; 
    20112133   } 
     2134   CATCH_DUMP_ATTR 
    20122135 
    20132136   //! Change virtual variable group to new one 
    20142137   void CGrid::setVirtualAxisGroup(CAxisGroup* newVAxisGroup) 
     2138   TRY 
    20152139   { 
    20162140      this->vAxisGroup_ = newVAxisGroup; 
    20172141   } 
     2142   CATCH_DUMP_ATTR 
    20182143 
    20192144   //! Change virtual variable group to new one 
    20202145   void CGrid::setVirtualScalarGroup(CScalarGroup* newVScalarGroup) 
     2146   TRY 
    20212147   { 
    20222148      this->vScalarGroup_ = newVScalarGroup; 
    20232149   } 
     2150   CATCH_DUMP_ATTR 
    20242151 
    20252152   /*! 
     
    20282155   */ 
    20292156   void CGrid::sendAddDomain(const string& id) 
    2030    { 
     2157   TRY 
     2158  { 
    20312159      sendAddItem(id, (int)EVENT_ID_ADD_DOMAIN); 
    20322160   } 
     2161   CATCH_DUMP_ATTR 
    20332162 
    20342163   /*! 
     
    20372166   */ 
    20382167   void CGrid::sendAddAxis(const string& id) 
     2168   TRY 
    20392169   { 
    20402170      sendAddItem(id, (int)EVENT_ID_ADD_AXIS); 
    20412171   } 
     2172   CATCH_DUMP_ATTR 
    20422173 
    20432174   /*! 
     
    20462177   */ 
    20472178   void CGrid::sendAddScalar(const string& id) 
     2179   TRY 
    20482180   { 
    20492181      sendAddItem(id, (int)EVENT_ID_ADD_SCALAR); 
    20502182   } 
     2183   CATCH_DUMP_ATTR 
    20512184 
    20522185   /*! 
     
    20552188   */ 
    20562189   void CGrid::recvAddDomain(CEventServer& event) 
     2190   TRY 
    20572191   { 
    20582192 
     
    20622196      get(id)->recvAddDomain(*buffer); 
    20632197   } 
     2198   CATCH 
    20642199 
    20652200   /*! 
     
    20682203   */ 
    20692204   void CGrid::recvAddDomain(CBufferIn& buffer) 
     2205   TRY 
    20702206   { 
    20712207      string id; 
     
    20732209      addDomain(id); 
    20742210   } 
     2211   CATCH_DUMP_ATTR 
    20752212 
    20762213   /*! 
     
    20792216   */ 
    20802217   void CGrid::recvAddAxis(CEventServer& event) 
     2218   TRY 
    20812219   { 
    20822220 
     
    20862224      get(id)->recvAddAxis(*buffer); 
    20872225   } 
     2226   CATCH 
    20882227 
    20892228   /*! 
     
    20922231   */ 
    20932232   void CGrid::recvAddAxis(CBufferIn& buffer) 
     2233   TRY 
    20942234   { 
    20952235      string id; 
     
    20972237      addAxis(id); 
    20982238   } 
     2239   CATCH_DUMP_ATTR 
    20992240 
    21002241   /*! 
     
    21032244   */ 
    21042245   void CGrid::recvAddScalar(CEventServer& event) 
     2246   TRY 
    21052247   { 
    21062248 
     
    21102252      get(id)->recvAddScalar(*buffer); 
    21112253   } 
     2254   CATCH 
    21122255 
    21132256   /*! 
     
    21162259   */ 
    21172260   void CGrid::recvAddScalar(CBufferIn& buffer) 
     2261   TRY 
    21182262   { 
    21192263      string id; 
     
    21212265      addScalar(id); 
    21222266   } 
     2267   CATCH_DUMP_ATTR 
    21232268 
    21242269  /*! 
     
    21292274  */ 
    21302275  void CGrid::solveDomainAxisRefInheritance(bool apply) 
     2276  TRY 
    21312277  { 
    21322278    CContext* context = CContext::getCurrent(); 
     
    21692315    } 
    21702316  } 
     2317  CATCH_DUMP_ATTR 
    21712318 
    21722319  bool CGrid::isTransformed() 
     2320  TRY 
    21732321  { 
    21742322    return isTransformed_; 
    21752323  } 
     2324  CATCH_DUMP_ATTR 
    21762325 
    21772326  void CGrid::setTransformed() 
     2327  TRY 
    21782328  { 
    21792329    isTransformed_ = true; 
    21802330  } 
     2331  CATCH_DUMP_ATTR 
    21812332 
    21822333  CGridTransformation* CGrid::getTransformations() 
     2334  TRY 
    21832335  { 
    21842336    return transformations_; 
    21852337  } 
     2338  CATCH_DUMP_ATTR 
    21862339 
    21872340  void CGrid::addTransGridSource(CGrid* gridSrc) 
     2341  TRY 
    21882342  { 
    21892343    if (gridSrc_.end() == gridSrc_.find(gridSrc)) 
    21902344      gridSrc_.insert(make_pair(gridSrc,make_pair(false,""))); 
    21912345  } 
     2346  CATCH_DUMP_ATTR 
    21922347 
    21932348  std::map<CGrid*,std::pair<bool,StdString> >& CGrid::getTransGridSource() 
     2349  TRY 
    21942350  { 
    21952351    return gridSrc_; 
    21962352  } 
     2353  CATCH_DUMP_ATTR 
    21972354 
    21982355  /*! 
     
    22012358  */ 
    22022359  void CGrid::completeGrid(CGrid* transformGridSrc) 
     2360  TRY 
    22032361  { 
    22042362    if (0 != transformGridSrc) 
     
    22192377    gridGenerate.completeGrid(); 
    22202378  } 
     2379  CATCH_DUMP_ATTR 
    22212380 
    22222381  bool CGrid::isGenerated() 
     2382  TRY 
    22232383  { 
    22242384    return isGenerated_; 
    22252385  } 
     2386  CATCH 
    22262387 
    22272388  void CGrid::setGenerated() 
     2389  TRY 
    22282390  { 
    22292391    isGenerated_ = true; 
    22302392  } 
     2393  CATCH_DUMP_ATTR 
    22312394 
    22322395  void CGrid::transformGrid(CGrid* transformGridSrc) 
     2396  TRY 
    22332397  { 
    22342398    if (!transformGridSrc) 
     
    22562420    transformGridSrc->checkMaskIndex(false); 
    22572421  } 
     2422  CATCH_DUMP_ATTR 
    22582423 
    22592424  bool CGrid::hasTransform() 
     2425  TRY 
    22602426  { 
    22612427    if (hasTransform_) return hasTransform_; 
     
    22712437    return hasTransform_; 
    22722438  } 
     2439  CATCH_DUMP_ATTR 
    22732440 
    22742441  /*! 
     
    22772444  */ 
    22782445  std::vector<CDomain*> CGrid::getDomains() 
     2446  TRY 
    22792447  { 
    22802448    std::vector<CDomain*> domList; 
     
    22852453    return domList; 
    22862454  } 
     2455  CATCH_DUMP_ATTR 
    22872456 
    22882457  /*! 
     
    22912460  */ 
    22922461  std::vector<CAxis*> CGrid::getAxis() 
     2462  TRY 
    22932463  { 
    22942464    std::vector<CAxis*> aList; 
     
    22982468    return aList; 
    22992469  } 
     2470  CATCH_DUMP_ATTR 
    23002471 
    23012472  /*! 
     
    23042475  */ 
    23052476  std::vector<CScalar*> CGrid::getScalars() 
     2477  TRY 
    23062478  { 
    23072479    std::vector<CScalar*> sList; 
     
    23112483    return sList; 
    23122484  } 
     2485  CATCH_DUMP_ATTR 
    23132486 
    23142487  /*! 
     
    23172490  */ 
    23182491  CDomain* CGrid::getDomain(int domainIndex) 
     2492  TRY 
    23192493  { 
    23202494    std::vector<CDomain*> domainListP = this->getDomains(); 
     
    23342508    return domainListP[domainIndex]; 
    23352509  } 
     2510  CATCH_DUMP_ATTR 
    23362511 
    23372512  /*! 
     
    23402515  */ 
    23412516  CAxis* CGrid::getAxis(int axisIndex) 
     2517  TRY 
    23422518  { 
    23432519    std::vector<CAxis*> axisListP = this->getAxis(); 
     
    23572533    return axisListP[axisIndex]; 
    23582534  } 
     2535  CATCH_DUMP_ATTR 
    23592536 
    23602537  /*! 
     
    23632540  */ 
    23642541  CScalar* CGrid::getScalar(int scalarIndex) 
     2542  TRY 
    23652543  { 
    23662544    std::vector<CScalar*> scalarListP = this->getScalars(); 
     
    23802558    return scalarListP[scalarIndex]; 
    23812559  } 
     2560  CATCH_DUMP_ATTR 
    23822561 
    23832562  /*! 
     
    23862565  */ 
    23872566  void CGrid::setDomainList(const std::vector<CDomain*> domains) 
     2567  TRY 
    23882568  { 
    23892569    if (isDomListSet) return; 
     
    24062586      isDomListSet = true; 
    24072587    } 
    2408  
    2409   } 
     2588  } 
     2589  CATCH_DUMP_ATTR 
    24102590 
    24112591  /*! 
     
    24142594  */ 
    24152595  void CGrid::setAxisList(const std::vector<CAxis*> axis) 
     2596  TRY 
    24162597  { 
    24172598    if (isAxisListSet) return; 
     
    24352616    } 
    24362617  } 
     2618  CATCH_DUMP_ATTR 
    24372619 
    24382620  /*! 
     
    24412623  */ 
    24422624  void CGrid::setScalarList(const std::vector<CScalar*> scalars) 
     2625  TRY 
    24432626  { 
    24442627    if (isScalarListSet) return; 
     
    24622645    } 
    24632646  } 
     2647  CATCH_DUMP_ATTR 
    24642648 
    24652649  /*! 
     
    24682652  */ 
    24692653  std::vector<StdString> CGrid::getDomainList() 
     2654  TRY 
    24702655  { 
    24712656    setDomainList(); 
    24722657    return domList_; 
    24732658  } 
     2659  CATCH 
    24742660 
    24752661  /*! 
     
    24782664  */ 
    24792665  std::vector<StdString> CGrid::getAxisList() 
     2666  TRY 
    24802667  { 
    24812668    setAxisList(); 
    24822669    return axisList_; 
    24832670  } 
     2671  CATCH 
    24842672 
    24852673  /*! 
     
    24882676  */ 
    24892677  std::vector<StdString> CGrid::getScalarList() 
     2678  TRY 
    24902679  { 
    24912680    setScalarList(); 
    24922681    return scalarList_; 
    24932682  } 
     2683  CATCH 
    24942684 
    24952685  /*! 
     
    24972687  */ 
    24982688  void CGrid::sendAllDomains() 
     2689  TRY 
    24992690  { 
    25002691    std::vector<CDomain*> domList = this->getVirtualDomainGroup()->getAllChildren(); 
     
    25062697    } 
    25072698  } 
     2699  CATCH_DUMP_ATTR 
    25082700 
    25092701  /*! 
     
    25112703  */ 
    25122704  void CGrid::sendAllAxis() 
     2705  TRY 
    25132706  { 
    25142707    std::vector<CAxis*> aList = this->getVirtualAxisGroup()->getAllChildren(); 
     
    25212714    } 
    25222715  } 
     2716  CATCH_DUMP_ATTR 
    25232717 
    25242718  /*! 
     
    25262720  */ 
    25272721  void CGrid::sendAllScalars() 
     2722  TRY 
    25282723  { 
    25292724    std::vector<CScalar*> sList = this->getVirtualScalarGroup()->getAllChildren(); 
     
    25362731    } 
    25372732  } 
     2733  CATCH_DUMP_ATTR 
    25382734 
    25392735  void CGrid::setContextClient(CContextClient* contextClient) 
     2736  TRY 
    25402737  { 
    25412738    if (clientsSet.find(contextClient)==clientsSet.end()) 
     
    25492746        this->getAxis()[i]->setContextClient(contextClient); 
    25502747  } 
     2748  CATCH_DUMP_ATTR 
    25512749 
    25522750  /*! 
     
    25542752  */ 
    25552753  void CGrid::parse(xml::CXMLNode& node) 
     2754  TRY 
    25562755  { 
    25572756    SuperClass::parse(node); 
     
    25942793    setScalarList(); 
    25952794   } 
     2795  CATCH_DUMP_ATTR 
     2796 
    25962797} // namespace xios 
  • XIOS/trunk/src/node/grid.hpp

    r1564 r1622  
    372372   template <int n> 
    373373   void CGrid::inputField(const CArray<double,n>& field, CArray<double,1>& stored) const 
     374   TRY 
    374375   { 
    375376//#ifdef __XIOS_DEBUG 
     
    383384      this->storeField_arr(field.dataFirst(), stored); 
    384385   } 
     386   CATCH 
    385387 
    386388   template <int n> 
    387389   void CGrid::outputField(const CArray<double,1>& stored, CArray<double,n>& field) const 
     390   TRY 
    388391   { 
    389392//#ifdef __XIOS_DEBUG 
     
    397400      this->restoreField_arr(stored, field.dataFirst()); 
    398401   } 
     402   CATCH 
    399403 
    400404   /*! 
     
    406410   template <int N> 
    407411   void CGrid::uncompressField(const CArray<double,N>& data, CArray<double,1>& outData) const 
     412   TRY 
    408413   {       
    409414     uncompressField_arr(data.dataFirst(), outData); 
    410415   } 
     416   CATCH 
    411417 
    412418   template<int N> 
     
    416422                             const CArray<int,1>& axisDomainOrder, 
    417423                             bool createMask) 
     424   TRY 
    418425   { 
    419426     if (!gridMask.isEmpty() || createMask) 
     
    515522     } 
    516523   } 
     524   CATCH_DUMP_ATTR 
    517525 
    518526   template<int N> 
     
    520528                                  const std::vector<int>& eachDimSize, 
    521529                                  bool newValue) 
     530   TRY 
    522531   { 
    523532      if (N != eachDimSize.size()) 
     
    534543      gridMask = newValue; 
    535544   } 
     545   CATCH_DUMP_ATTR 
    536546                                  
    537547 
     
    543553   template<int N> 
    544554   void CGrid::modifyGridMask(CArray<bool,N>& gridMask, const CArray<int,1>& indexToModify, bool valueToModify) 
     555   TRY 
    545556   {      
    546557     int num = indexToModify.numElements(); 
     
    550561     } 
    551562   } 
     563   CATCH_DUMP_ATTR 
     564 
    552565   ///-------------------------------------------------------------- 
    553566 
    554  
    555 /*! 
    556   A grid can have multiple dimension, so can its mask in the form of multi-dimension array. 
    557 It's not a good idea to store all multi-dimension arrays corresponding to each mask. 
    558 One of the ways is to convert this array into 1-dimension one and every process is taken place on it. 
    559   \param [in] multi-dimension array grid mask 
    560 */ 
    561 template<int N> 
    562 void CGrid::getLocalMask(const CArray<bool,N>& gridMask, CArray<bool,1>& localMask) 
    563 { 
    564   if (gridMask.isEmpty()) return ; 
    565   int dim = gridMask.dimensions(); 
    566   std::vector<int> dimensionSizes(dim); 
    567   for (int i = 0; i < dim; ++i) dimensionSizes[i] = gridMask.extent(i); 
    568  
    569   std::vector<int> idxLoop(dim,0); 
    570   int ssize = gridMask.numElements(), idx = 0; 
    571   localMask.resize(ssize); 
    572   while (idx < ssize) 
     567  /*! 
     568    A grid can have multiple dimension, so can its mask in the form of multi-dimension array. 
     569  It's not a good idea to store all multi-dimension arrays corresponding to each mask. 
     570  One of the ways is to convert this array into 1-dimension one and every process is taken place on it. 
     571    \param [in] multi-dimension array grid mask 
     572  */ 
     573  template<int N> 
     574  void CGrid::getLocalMask(const CArray<bool,N>& gridMask, CArray<bool,1>& localMask) 
     575  TRY 
    573576  { 
    574     for (int i = 0; i < dim-1; ++i) 
     577    if (gridMask.isEmpty()) return ; 
     578    int dim = gridMask.dimensions(); 
     579    std::vector<int> dimensionSizes(dim); 
     580    for (int i = 0; i < dim; ++i) dimensionSizes[i] = gridMask.extent(i); 
     581 
     582    std::vector<int> idxLoop(dim,0); 
     583    int ssize = gridMask.numElements(), idx = 0; 
     584    localMask.resize(ssize); 
     585    while (idx < ssize) 
    575586    { 
    576       if (idxLoop[i] == dimensionSizes[i]) 
     587      for (int i = 0; i < dim-1; ++i) 
    577588      { 
    578         idxLoop[i] = 0; 
    579         ++idxLoop[i+1]; 
     589        if (idxLoop[i] == dimensionSizes[i]) 
     590        { 
     591          idxLoop[i] = 0; 
     592          ++idxLoop[i+1]; 
     593        } 
    580594      } 
     595 
     596      int maskIndex = idxLoop[0]; 
     597      int mulDim = 1; 
     598      for (int k = 1; k < dim; ++k) 
     599      { 
     600        mulDim *= dimensionSizes[k-1]; 
     601        maskIndex += idxLoop[k]*mulDim; 
     602      } 
     603      localMask(maskIndex) = *(gridMask.dataFirst()+maskIndex); 
     604 
     605      ++idxLoop[0]; 
     606      ++idx; 
    581607    } 
    582  
    583     int maskIndex = idxLoop[0]; 
    584     int mulDim = 1; 
    585     for (int k = 1; k < dim; ++k) 
    586     { 
    587       mulDim *= dimensionSizes[k-1]; 
    588       maskIndex += idxLoop[k]*mulDim; 
    589     } 
    590     localMask(maskIndex) = *(gridMask.dataFirst()+maskIndex); 
    591  
    592     ++idxLoop[0]; 
    593     ++idx; 
    594608  } 
    595 } 
     609   CATCH_DUMP_ATTR 
    596610 
    597611   // Declare/Define CGridGroup and CGridDefinition 
Note: See TracChangeset for help on using the changeset viewer.