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

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

File:
1 edited

Legend:

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

    r1562 r1646  
    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 
     366   bool CGrid::hasMask() const 
     367   TRY 
     368   { 
     369     return (!mask_1d.isEmpty() || !mask_2d.isEmpty() || !mask_3d.isEmpty() || 
     370             !mask_4d.isEmpty() || !mask_5d.isEmpty() || !mask_6d.isEmpty() || !mask_7d.isEmpty()); 
     371   } 
     372   CATCH 
    341373 
    342374   /* 
     
    344376   */ 
    345377   void CGrid::createMask(void) 
     378   TRY 
    346379   { 
    347380      using namespace std; 
     
    381414      } 
    382415   } 
     416   CATCH_DUMP_ATTR 
    383417 
    384418   /* 
     
    386420   */ 
    387421   void CGrid::checkMask(void) 
     422   TRY 
    388423   { 
    389424      using namespace std; 
     
    423458      } 
    424459   } 
    425  
    426  
    427 /*! 
    428   A grid can have multiple dimension, so can its mask in the form of multi-dimension array. 
    429 It's not a good idea to store all multi-dimension arrays corresponding to each mask. 
    430 One of the ways is to convert this array into 1-dimension one and every process is taken place on it. 
    431   \param [in] multi-dimension array grid mask 
    432 */ 
    433  
    434   void CGrid::getLocalMask(CArray<bool,1>& localMask) 
    435   { 
    436       std::vector<CDomain*> domainP = this->getDomains(); 
    437       std::vector<CAxis*> axisP = this->getAxis(); 
    438       int dim = domainP.size() * 2 + axisP.size(); 
    439  
    440       switch (dim) 
    441       { 
    442         case 0: 
    443           getLocalMask(mask_0d, localMask); 
    444           break; 
    445         case 1: 
    446           getLocalMask(mask_1d, localMask); 
    447           break; 
    448         case 2: 
    449           getLocalMask(mask_2d, localMask); 
    450           break; 
    451         case 3: 
    452           getLocalMask(mask_3d, localMask); 
    453           break; 
    454         case 4: 
    455           getLocalMask(mask_4d, localMask); 
    456           break; 
    457         case 5: 
    458           getLocalMask(mask_5d, localMask); 
    459           break; 
    460         case 6: 
    461           getLocalMask(mask_6d, localMask); 
    462           break; 
    463         case 7: 
    464           getLocalMask(mask_7d, localMask); 
    465           break; 
    466         default: 
    467           break; 
    468       } 
    469   } 
    470        
     460   CATCH_DUMP_ATTR 
     461 
    471462   /* 
    472463     Modify value of mask in a certain index 
     
    476467   */ 
    477468   void CGrid::modifyMask(const CArray<int,1>& indexToModify, bool modifyValue) 
     469   TRY 
    478470   { 
    479471      using namespace std; 
     
    511503      } 
    512504   } 
     505   CATCH_DUMP_ATTR 
    513506 
    514507   /* 
     
    518511   */ 
    519512   void CGrid::modifyMaskSize(const std::vector<int>& newDimensionSize, bool newValue) 
     513   TRY 
    520514   {       
    521515      std::vector<CDomain*> domainP = this->getDomains(); 
     
    552546      } 
    553547   } 
     548   CATCH_DUMP_ATTR 
    554549 
    555550   //--------------------------------------------------------------- 
    556551 
    557552   void CGrid::solveDomainRef(bool sendAtt) 
     553   TRY 
    558554   { 
    559555      setDomainList(); 
     
    568564      } 
    569565   } 
     566   CATCH_DUMP_ATTR 
    570567 
    571568   //--------------------------------------------------------------- 
    572569 
    573570   void CGrid::solveAxisRef(bool sendAtt) 
     571   TRY 
    574572   { 
    575573      setAxisList(); 
     
    599597      } 
    600598   } 
     599   CATCH_DUMP_ATTR 
    601600 
    602601   //--------------------------------------------------------------- 
    603602 
    604603   void CGrid::solveScalarRef(bool sendAtt) 
     604   TRY 
    605605   { 
    606606      setScalarList(); 
     
    616616      } 
    617617   } 
     618   CATCH_DUMP_ATTR 
    618619 
    619620   /*! 
     
    621622   */ 
    622623   void CGrid::computeWrittenIndex() 
     624   TRY 
    623625   {       
    624626      if (computedWrittenIndex_) return; 
     
    680682      } 
    681683   } 
     684   CATCH_DUMP_ATTR 
    682685 
    683686   //--------------------------------------------------------------- 
     
    690693   */ 
    691694   void CGrid::computeClientIndex() 
     695   TRY 
    692696   { 
    693697     CContext* context = CContext::getCurrent(); 
     
    698702     clientDistribution_ = new CDistributionClient(rank, this); 
    699703     // Get local data index on client 
    700      storeIndex_client.resize(clientDistribution_->getLocalDataIndexOnClient().size()); 
    701      int nbStoreIndex = storeIndex_client.numElements(); 
     704     int nbStoreIndex = clientDistribution_->getLocalDataIndexOnClient().size(); 
     705     int nbStoreGridMask = clientDistribution_->getLocalMaskIndexOnClient().size(); 
     706     // nbStoreGridMask = nbStoreIndex if grid mask is defined, and 0 otherwise 
     707     storeIndex_client.resize(nbStoreIndex); 
     708     storeMask_client.resize(nbStoreGridMask); 
    702709     for (int idx = 0; idx < nbStoreIndex; ++idx) storeIndex_client(idx) = (clientDistribution_->getLocalDataIndexOnClient())[idx]; 
     710     for (int idx = 0; idx < nbStoreGridMask; ++idx) storeMask_client(idx) = (clientDistribution_->getLocalMaskIndexOnClient())[idx]; 
    703711 
    704712     if (0 == serverDistribution_) isDataDistributed_= clientDistribution_->isDataDistributed(); 
     
    746754      } 
    747755   } 
     756   CATCH_DUMP_ATTR 
    748757 
    749758   /*! 
     
    751760   */ 
    752761   void CGrid::computeConnectedClients() 
     762   TRY 
    753763   { 
    754764     CContext* context = CContext::getCurrent(); 
     
    840850          connectedServerRank_[receiverSize].push_back(client->clientRank % client->serverSize); 
    841851 
     852         // Now check if all servers have data to receive. If not, master client will send empty data. 
     853         // This ensures that all servers will participate in collective calls upon receiving even if they have no date to receive. 
     854         std::vector<int> counts (client->clientSize); 
     855         std::vector<int> displs (client->clientSize); 
     856         displs[0] = 0; 
     857         int localCount = connectedServerRank_[receiverSize].size() ; 
     858         ep_lib::MPI_Gather(&localCount, 1, MPI_INT, &counts[0], 1, MPI_INT, 0, client->intraComm) ; 
     859          
     860         for (int i = 0; i < client->clientSize-1; ++i) 
     861         { 
     862           displs[i+1] = displs[i] + counts[i]; 
     863         } 
     864         std::vector<int> allConnectedServers(displs[client->clientSize-1]+counts[client->clientSize-1]); 
     865 
     866         ep_lib::MPI_Gatherv(&(connectedServerRank_[receiverSize])[0], localCount, MPI_INT, &allConnectedServers[0], &counts[0], &displs[0], MPI_INT, 0, client->intraComm); 
     867 
     868 
     869         if ((allConnectedServers.size() != receiverSize) && (client->clientRank == 0)) 
     870         { 
     871           std::vector<bool> isSrvConnected (receiverSize, false); 
     872           for (int i = 0; i < allConnectedServers.size(); ++i) isSrvConnected[allConnectedServers[i]] = true; 
     873           for (int i = 0; i < receiverSize; ++i) 
     874           { 
     875             if (!isSrvConnected[i]) connectedServerRank_[receiverSize].push_back(i); 
     876           } 
     877         } 
     878 
    842879         nbSenders[receiverSize] = clientServerMap_->computeConnectedClients(receiverSize, client->clientSize, client->intraComm, connectedServerRank_[receiverSize]); 
    843880       } 
    844881     } 
    845882   } 
     883   CATCH_DUMP_ATTR 
    846884 
    847885   /*! 
     
    853891   */ 
    854892   void CGrid::computeIndex(void) 
     893   TRY 
    855894   { 
    856895     CContext* context = CContext::getCurrent(); 
     
    879918     } 
    880919   } 
     920   CATCH_DUMP_ATTR 
    881921 
    882922   /*! 
     
    892932                                     const CContextClient* client, 
    893933                                     CClientServerMapping::GlobalIndexMap& globalIndexOnServer) 
     934   TRY 
    894935   { 
    895936     int serverSize = client->serverSize; 
     
    10581099    } 
    10591100   } 
    1060    //---------------------------------------------------------------- 
     1101   CATCH_DUMP_ATTR 
     1102//---------------------------------------------------------------- 
    10611103 
    10621104   CGrid* CGrid::createGrid(CDomain* domain) 
     1105   TRY 
    10631106   { 
    10641107      std::vector<CDomain*> vecDom(1, domain); 
     
    10671110      return createGrid(vecDom, vecAxis); 
    10681111   } 
     1112   CATCH 
    10691113 
    10701114   CGrid* CGrid::createGrid(CDomain* domain, CAxis* axis) 
    1071    { 
     1115   TRY 
     1116  { 
    10721117      std::vector<CDomain*> vecDom(1, domain); 
    10731118      std::vector<CAxis*> vecAxis(1, axis); 
     
    10751120      return createGrid(vecDom, vecAxis); 
    10761121   } 
     1122   CATCH 
    10771123 
    10781124   CGrid* CGrid::createGrid(const std::vector<CDomain*>& domains, const std::vector<CAxis*>& axis, 
    10791125                            const CArray<int,1>& axisDomainOrder) 
     1126   TRY 
    10801127   { 
    10811128     std::vector<CScalar*> vecScalar; 
    10821129     return createGrid(generateId(domains, axis, vecScalar, axisDomainOrder), domains, axis, vecScalar, axisDomainOrder); 
    10831130   } 
     1131   CATCH 
    10841132 
    10851133   CGrid* CGrid::createGrid(const std::vector<CDomain*>& domains, const std::vector<CAxis*>& axis, 
    10861134                            const std::vector<CScalar*>& scalars, const CArray<int,1>& axisDomainOrder) 
     1135   TRY 
    10871136   { 
    10881137     return createGrid(generateId(domains, axis, scalars, axisDomainOrder), domains, axis, scalars, axisDomainOrder); 
    10891138   } 
     1139   CATCH 
    10901140 
    10911141   CGrid* CGrid::createGrid(StdString id, const std::vector<CDomain*>& domains, const std::vector<CAxis*>& axis, 
    10921142                            const std::vector<CScalar*>& scalars, const CArray<int,1>& axisDomainOrder) 
     1143   TRY 
    10931144   { 
    10941145      if (axisDomainOrder.numElements() > 0 && axisDomainOrder.numElements() != (domains.size() + axis.size() + scalars.size())) 
     
    11321183      return grid; 
    11331184   } 
     1185   CATCH 
    11341186 
    11351187   CGrid* CGrid::cloneGrid(const StdString& idNewGrid, CGrid* gridSrc) 
     1188   TRY 
    11361189   { 
    11371190     std::vector<CDomain*> domainSrcTmp = gridSrc->getDomains(), domainSrc; 
     
    11731226      return grid; 
    11741227   } 
     1228   CATCH 
    11751229 
    11761230   StdString CGrid::generateId(const std::vector<CDomain*>& domains, const std::vector<CAxis*>& axis, 
    11771231                               const std::vector<CScalar*>& scalars, const CArray<int,1>& axisDomainOrder) 
     1232   TRY 
    11781233   { 
    11791234      if (axisDomainOrder.numElements() > 0 && axisDomainOrder.numElements() != (domains.size() + axis.size() + scalars.size())) 
     
    12161271      return id.str(); 
    12171272   } 
     1273   CATCH 
    12181274 
    12191275   StdString CGrid::generateId(const CGrid* gridSrc, const CGrid* gridDest) 
     1276   TRY 
    12201277   { 
    12211278     StdString idSrc  = gridSrc->getId(); 
     
    12271284     return id.str(); 
    12281285   } 
     1286   CATCH 
    12291287 
    12301288   //---------------------------------------------------------------- 
    12311289 
    12321290   CDomainGroup* CGrid::getVirtualDomainGroup() const 
     1291   TRY 
    12331292   { 
    12341293     return this->vDomainGroup_; 
    12351294   } 
     1295   CATCH 
    12361296 
    12371297   CAxisGroup* CGrid::getVirtualAxisGroup() const 
     1298   TRY 
    12381299   { 
    12391300     return this->vAxisGroup_; 
    12401301   } 
     1302   CATCH 
    12411303 
    12421304   CScalarGroup* CGrid::getVirtualScalarGroup() const 
     1305   TRY 
    12431306   { 
    12441307     return this->vScalarGroup_; 
    12451308   } 
     1309   CATCH 
    12461310 
    12471311/* 
     
    12791343 
    12801344   void CGrid::storeField_arr(const double* const data, CArray<double, 1>& stored) const 
     1345   TRY 
    12811346   { 
    12821347      const StdSize size = storeIndex_client.numElements(); 
     
    12851350      for(StdSize i = 0; i < size; i++) stored(i) = data[storeIndex_client(i)]; 
    12861351   } 
     1352   CATCH 
    12871353 
    12881354   void CGrid::restoreField_arr(const CArray<double, 1>& stored, double* const data) const 
     1355   TRY 
    12891356   { 
    12901357      const StdSize size = storeIndex_client.numElements(); 
     
    12921359      for(StdSize i = 0; i < size; i++) data[storeIndex_client(i)] = stored(i); 
    12931360   } 
     1361   CATCH 
     1362 
     1363   void CGrid::maskField_arr(const double* const data, CArray<double, 1>& stored) const 
     1364   { 
     1365      const StdSize size = storeIndex_client.numElements(); 
     1366      stored.resize(size); 
     1367      const double nanValue = std::numeric_limits<double>::quiet_NaN(); 
     1368 
     1369      if (storeMask_client.numElements() != 0) 
     1370        for(StdSize i = 0; i < size; i++) stored(i) = (storeMask_client(i)) ? data[storeIndex_client(i)] : nanValue; 
     1371      else 
     1372        for(StdSize i = 0; i < size; i++) stored(i) = data[storeIndex_client(i)]; 
     1373   } 
    12941374 
    12951375   void CGrid::uncompressField_arr(const double* const data, CArray<double, 1>& out) const 
     1376   TRY 
    12961377   { 
    12971378      const std::vector<int>& localMaskedDataIndex = clientDistribution_->getLocalMaskedDataIndexOnClient(); 
     
    12991380      for(int i = 0; i < size; ++i) out(localMaskedDataIndex[i]) = data[i]; 
    13001381   } 
    1301  
     1382   CATCH 
    13021383 
    13031384  void CGrid::computeClientIndexScalarGrid() 
     1385  TRY 
    13041386  { 
    13051387    CContext* context = CContext::getCurrent();     
     
    13351417    } 
    13361418  } 
     1419  CATCH_DUMP_ATTR 
    13371420 
    13381421  void CGrid::computeConnectedClientsScalarGrid() 
     1422  TRY 
    13391423  { 
    13401424    CContext* context = CContext::getCurrent();     
     
    13811465    } 
    13821466  } 
     1467  CATCH_DUMP_ATTR 
    13831468 
    13841469  void CGrid::sendIndexScalarGrid() 
     1470  TRY 
    13851471  { 
    13861472    CContext* context = CContext::getCurrent(); 
     
    14461532    } 
    14471533  } 
     1534  CATCH_DUMP_ATTR 
    14481535 
    14491536  void CGrid::sendIndex(void) 
     1537  TRY 
    14501538  { 
    14511539    CContext* context = CContext::getCurrent(); 
     
    15671655    } 
    15681656  } 
     1657  CATCH_DUMP_ATTR 
    15691658 
    15701659  void CGrid::recvIndex(CEventServer& event) 
     1660  TRY 
    15711661  { 
    15721662    string gridId; 
     
    15841674    get(gridId)->recvIndex(ranks, buffers); 
    15851675  } 
     1676  CATCH 
    15861677 
    15871678  void CGrid::recvIndex(vector<int> ranks, vector<CBufferIn*> buffers) 
     1679  TRY 
    15881680  { 
    15891681    CContext* context = CContext::getCurrent(); 
     
    17481840          nGlob.push_back(1);   
    17491841        } 
    1750  
    1751         modifyMaskSize(nSize, false); 
    1752  
    1753         // These below codes are reserved for future 
    1754         CDistributionServer srvDist(server->intraCommRank, nBegin, nSize, nBeginGlobal, nGlob);  
    1755         map<int, CArray<size_t, 1> >::iterator itb = outGlobalIndexFromClient.begin(), 
    1756                                                ite = outGlobalIndexFromClient.end(), it;   
    1757         const CDistributionServer::GlobalLocalMap&  globalLocalMask = srvDist.getGlobalLocalIndex(); 
    1758         CDistributionServer::GlobalLocalMap::const_iterator itSrv; 
    1759         size_t nb = 0; 
    1760         for (it = itb; it != ite; ++it) 
    1761         { 
    1762           CArray<size_t,1>& globalInd = it->second; 
    1763           for (size_t idx = 0; idx < globalInd.numElements(); ++idx) 
    1764           { 
    1765             if (globalLocalMask.end() != globalLocalMask.find(globalInd(idx))) ++nb; 
    1766           } 
    1767         } 
    1768          
    1769         CArray<int,1> indexToModify(nb); 
    1770         nb = 0;     
    1771         for (it = itb; it != ite; ++it) 
    1772         { 
    1773           CArray<size_t,1>& globalInd = it->second; 
    1774           for (size_t idx = 0; idx < globalInd.numElements(); ++idx) 
    1775           { 
    1776             itSrv = globalLocalMask.find(globalInd(idx)); 
    1777             if (globalLocalMask.end() != itSrv)  
    1778             { 
    1779               indexToModify(nb) = itSrv->second; 
    1780               ++nb; 
    1781             } 
    1782           } 
    1783         } 
    1784  
    1785         modifyMask(indexToModify, true); 
    17861842      } 
    17871843 
     
    17911847    } 
    17921848  } 
     1849  CATCH_DUMP_ATTR 
    17931850 
    17941851  /* 
     
    18061863                                        const std::vector<CScalar*> scalars, 
    18071864                                        const CArray<int,1>& axisDomainOrder) 
    1808   { 
     1865  TRY 
     1866 { 
    18091867 //   globalDim.resize(domains.size()*2+axis.size()+scalars.size()); 
    18101868    globalDim.resize(domains.size()*2+axis.size()); 
     
    18461904    return positionDimensionDistributed; 
    18471905  } 
     1906  CATCH_DUMP_ATTR 
    18481907 
    18491908  // Retrieve the global dimension of grid 
    18501909  std::vector<int> CGrid::getGlobalDimension() 
     1910  TRY 
    18511911  { 
    18521912    std::vector<int> globalDim; 
     
    18551915    return globalDim; 
    18561916  } 
     1917  CATCH_DUMP_ATTR 
    18571918 
    18581919  // Retrieve dimension on which we do distribution (Very often, it should be 2nd dimension) 
    18591920  int CGrid::getDistributedDimension() 
     1921  TRY 
    18601922  { 
    18611923    std::vector<int> globalDim; 
    18621924    return computeGridGlobalDimension(globalDim, getDomains(), getAxis(), getScalars(), axis_domain_order);     
    18631925  } 
     1926  CATCH_DUMP_ATTR 
    18641927 
    18651928  bool CGrid::isScalarGrid() const 
     1929  TRY 
    18661930  { 
    18671931    return (axisList_.empty() && domList_.empty()); 
    18681932  } 
     1933  CATCH 
    18691934 
    18701935  /*! 
     
    18741939  */ 
    18751940  bool CGrid::doGridHaveDataToWrite() 
     1941  TRY 
    18761942  { 
    18771943     return (0 != writtenDataSize_); 
    18781944  } 
     1945  CATCH_DUMP_ATTR 
    18791946 
    18801947  /*! 
     
    18851952  */ 
    18861953  size_t CGrid::getWrittenDataSize() const 
     1954  TRY 
    18871955  { 
    18881956    return writtenDataSize_; 
    18891957  } 
     1958  CATCH 
    18901959 
    18911960  /*! 
     
    18941963  */ 
    18951964  int CGrid::getNumberWrittenIndexes() const 
     1965  TRY 
    18961966  { 
    18971967    return numberWrittenIndexes_; 
    18981968  } 
     1969  CATCH 
    18991970 
    19001971  /*! 
     
    19031974  */ 
    19041975  int CGrid::getTotalNumberWrittenIndexes() const 
     1976  TRY 
    19051977  { 
    19061978    return totalNumberWrittenIndexes_; 
    19071979  } 
     1980  CATCH 
    19081981 
    19091982  /*! 
     
    19121985  */ 
    19131986  int CGrid::getOffsetWrittenIndexes() const 
     1987  TRY 
    19141988  { 
    19151989    return offsetWrittenIndexes_; 
    19161990  } 
     1991  CATCH 
    19171992 
    19181993  CDistributionServer* CGrid::getDistributionServer() 
     1994  TRY 
    19191995  { 
    19201996    return serverDistribution_; 
    19211997  } 
     1998  CATCH_DUMP_ATTR 
    19221999 
    19232000  CDistributionClient* CGrid::getDistributionClient() 
     2001  TRY 
    19242002  { 
    19252003    return clientDistribution_; 
    19262004  } 
     2005  CATCH_DUMP_ATTR 
    19272006 
    19282007  bool CGrid::doGridHaveDataDistributed(CContextClient* client) 
     2008  TRY 
    19292009  { 
    19302010    if (isScalarGrid()) return false; 
     
    19362016      return isDataDistributed_;     
    19372017  } 
     2018  CATCH_DUMP_ATTR 
    19382019 
    19392020   /*! 
     
    19452026   */ 
    19462027  bool CGrid::dispatchEvent(CEventServer& event) 
     2028  TRY 
    19472029  { 
    19482030 
     
    19782060    } 
    19792061  } 
     2062  CATCH 
    19802063 
    19812064   ///--------------------------------------------------------------- 
    19822065 
    19832066   CDomain* CGrid::addDomain(const std::string& id) 
     2067   TRY 
    19842068   { 
    19852069     order_.push_back(2); 
     
    19882072     return vDomainGroup_->createChild(id); 
    19892073   } 
     2074   CATCH_DUMP_ATTR 
    19902075 
    19912076   CAxis* CGrid::addAxis(const std::string& id) 
     2077   TRY 
    19922078   { 
    19932079     order_.push_back(1); 
     
    19962082     return vAxisGroup_->createChild(id); 
    19972083   } 
     2084   CATCH_DUMP_ATTR 
    19982085 
    19992086   CScalar* CGrid::addScalar(const std::string& id) 
     2087   TRY 
    20002088   { 
    20012089     order_.push_back(0); 
     
    20042092     return vScalarGroup_->createChild(id); 
    20052093   } 
     2094   CATCH_DUMP_ATTR 
    20062095 
    20072096   //! Change virtual field group to a new one 
    20082097   void CGrid::setVirtualDomainGroup(CDomainGroup* newVDomainGroup) 
     2098   TRY 
    20092099   { 
    20102100      this->vDomainGroup_ = newVDomainGroup; 
    20112101   } 
     2102   CATCH_DUMP_ATTR 
    20122103 
    20132104   //! Change virtual variable group to new one 
    20142105   void CGrid::setVirtualAxisGroup(CAxisGroup* newVAxisGroup) 
     2106   TRY 
    20152107   { 
    20162108      this->vAxisGroup_ = newVAxisGroup; 
    20172109   } 
     2110   CATCH_DUMP_ATTR 
    20182111 
    20192112   //! Change virtual variable group to new one 
    20202113   void CGrid::setVirtualScalarGroup(CScalarGroup* newVScalarGroup) 
     2114   TRY 
    20212115   { 
    20222116      this->vScalarGroup_ = newVScalarGroup; 
    20232117   } 
     2118   CATCH_DUMP_ATTR 
    20242119 
    20252120   /*! 
     
    20282123   */ 
    20292124   void CGrid::sendAddDomain(const string& id) 
    2030    { 
     2125   TRY 
     2126  { 
    20312127      sendAddItem(id, (int)EVENT_ID_ADD_DOMAIN); 
    20322128   } 
     2129   CATCH_DUMP_ATTR 
    20332130 
    20342131   /*! 
     
    20372134   */ 
    20382135   void CGrid::sendAddAxis(const string& id) 
     2136   TRY 
    20392137   { 
    20402138      sendAddItem(id, (int)EVENT_ID_ADD_AXIS); 
    20412139   } 
     2140   CATCH_DUMP_ATTR 
    20422141 
    20432142   /*! 
     
    20462145   */ 
    20472146   void CGrid::sendAddScalar(const string& id) 
     2147   TRY 
    20482148   { 
    20492149      sendAddItem(id, (int)EVENT_ID_ADD_SCALAR); 
    20502150   } 
     2151   CATCH_DUMP_ATTR 
    20512152 
    20522153   /*! 
     
    20552156   */ 
    20562157   void CGrid::recvAddDomain(CEventServer& event) 
     2158   TRY 
    20572159   { 
    20582160 
     
    20622164      get(id)->recvAddDomain(*buffer); 
    20632165   } 
     2166   CATCH 
    20642167 
    20652168   /*! 
     
    20682171   */ 
    20692172   void CGrid::recvAddDomain(CBufferIn& buffer) 
     2173   TRY 
    20702174   { 
    20712175      string id; 
     
    20732177      addDomain(id); 
    20742178   } 
     2179   CATCH_DUMP_ATTR 
    20752180 
    20762181   /*! 
     
    20792184   */ 
    20802185   void CGrid::recvAddAxis(CEventServer& event) 
     2186   TRY 
    20812187   { 
    20822188 
     
    20862192      get(id)->recvAddAxis(*buffer); 
    20872193   } 
     2194   CATCH 
    20882195 
    20892196   /*! 
     
    20922199   */ 
    20932200   void CGrid::recvAddAxis(CBufferIn& buffer) 
     2201   TRY 
    20942202   { 
    20952203      string id; 
     
    20972205      addAxis(id); 
    20982206   } 
     2207   CATCH_DUMP_ATTR 
    20992208 
    21002209   /*! 
     
    21032212   */ 
    21042213   void CGrid::recvAddScalar(CEventServer& event) 
     2214   TRY 
    21052215   { 
    21062216 
     
    21102220      get(id)->recvAddScalar(*buffer); 
    21112221   } 
     2222   CATCH 
    21122223 
    21132224   /*! 
     
    21162227   */ 
    21172228   void CGrid::recvAddScalar(CBufferIn& buffer) 
     2229   TRY 
    21182230   { 
    21192231      string id; 
     
    21212233      addScalar(id); 
    21222234   } 
     2235   CATCH_DUMP_ATTR 
    21232236 
    21242237  /*! 
     
    21292242  */ 
    21302243  void CGrid::solveDomainAxisRefInheritance(bool apply) 
     2244  TRY 
    21312245  { 
    21322246    CContext* context = CContext::getCurrent(); 
     
    21692283    } 
    21702284  } 
     2285  CATCH_DUMP_ATTR 
    21712286 
    21722287  bool CGrid::isTransformed() 
     2288  TRY 
    21732289  { 
    21742290    return isTransformed_; 
    21752291  } 
     2292  CATCH_DUMP_ATTR 
    21762293 
    21772294  void CGrid::setTransformed() 
     2295  TRY 
    21782296  { 
    21792297    isTransformed_ = true; 
    21802298  } 
     2299  CATCH_DUMP_ATTR 
    21812300 
    21822301  CGridTransformation* CGrid::getTransformations() 
     2302  TRY 
    21832303  { 
    21842304    return transformations_; 
    21852305  } 
     2306  CATCH_DUMP_ATTR 
    21862307 
    21872308  void CGrid::addTransGridSource(CGrid* gridSrc) 
     2309  TRY 
    21882310  { 
    21892311    if (gridSrc_.end() == gridSrc_.find(gridSrc)) 
    21902312      gridSrc_.insert(make_pair(gridSrc,make_pair(false,""))); 
    21912313  } 
     2314  CATCH_DUMP_ATTR 
    21922315 
    21932316  std::map<CGrid*,std::pair<bool,StdString> >& CGrid::getTransGridSource() 
     2317  TRY 
    21942318  { 
    21952319    return gridSrc_; 
    21962320  } 
     2321  CATCH_DUMP_ATTR 
    21972322 
    21982323  /*! 
     
    22012326  */ 
    22022327  void CGrid::completeGrid(CGrid* transformGridSrc) 
     2328  TRY 
    22032329  { 
    22042330    if (0 != transformGridSrc) 
     
    22192345    gridGenerate.completeGrid(); 
    22202346  } 
     2347  CATCH_DUMP_ATTR 
    22212348 
    22222349  bool CGrid::isGenerated() 
     2350  TRY 
    22232351  { 
    22242352    return isGenerated_; 
    22252353  } 
     2354  CATCH 
    22262355 
    22272356  void CGrid::setGenerated() 
     2357  TRY 
    22282358  { 
    22292359    isGenerated_ = true; 
    22302360  } 
     2361  CATCH_DUMP_ATTR 
    22312362 
    22322363  void CGrid::transformGrid(CGrid* transformGridSrc) 
     2364  TRY 
    22332365  { 
    22342366    if (!transformGridSrc) 
     
    22562388    transformGridSrc->checkMaskIndex(false); 
    22572389  } 
     2390  CATCH_DUMP_ATTR 
    22582391 
    22592392  bool CGrid::hasTransform() 
     2393  TRY 
    22602394  { 
    22612395    if (hasTransform_) return hasTransform_; 
     
    22712405    return hasTransform_; 
    22722406  } 
     2407  CATCH_DUMP_ATTR 
    22732408 
    22742409  /*! 
     
    22772412  */ 
    22782413  std::vector<CDomain*> CGrid::getDomains() 
     2414  TRY 
    22792415  { 
    22802416    std::vector<CDomain*> domList; 
     
    22852421    return domList; 
    22862422  } 
     2423  CATCH_DUMP_ATTR 
    22872424 
    22882425  /*! 
     
    22912428  */ 
    22922429  std::vector<CAxis*> CGrid::getAxis() 
     2430  TRY 
    22932431  { 
    22942432    std::vector<CAxis*> aList; 
     
    22982436    return aList; 
    22992437  } 
     2438  CATCH_DUMP_ATTR 
    23002439 
    23012440  /*! 
     
    23042443  */ 
    23052444  std::vector<CScalar*> CGrid::getScalars() 
     2445  TRY 
    23062446  { 
    23072447    std::vector<CScalar*> sList; 
     
    23112451    return sList; 
    23122452  } 
     2453  CATCH_DUMP_ATTR 
    23132454 
    23142455  /*! 
     
    23172458  */ 
    23182459  CDomain* CGrid::getDomain(int domainIndex) 
     2460  TRY 
    23192461  { 
    23202462    std::vector<CDomain*> domainListP = this->getDomains(); 
     
    23342476    return domainListP[domainIndex]; 
    23352477  } 
     2478  CATCH_DUMP_ATTR 
    23362479 
    23372480  /*! 
     
    23402483  */ 
    23412484  CAxis* CGrid::getAxis(int axisIndex) 
     2485  TRY 
    23422486  { 
    23432487    std::vector<CAxis*> axisListP = this->getAxis(); 
     
    23572501    return axisListP[axisIndex]; 
    23582502  } 
     2503  CATCH_DUMP_ATTR 
    23592504 
    23602505  /*! 
     
    23632508  */ 
    23642509  CScalar* CGrid::getScalar(int scalarIndex) 
     2510  TRY 
    23652511  { 
    23662512    std::vector<CScalar*> scalarListP = this->getScalars(); 
     
    23802526    return scalarListP[scalarIndex]; 
    23812527  } 
     2528  CATCH_DUMP_ATTR 
    23822529 
    23832530  /*! 
     
    23862533  */ 
    23872534  void CGrid::setDomainList(const std::vector<CDomain*> domains) 
     2535  TRY 
    23882536  { 
    23892537    if (isDomListSet) return; 
     
    24062554      isDomListSet = true; 
    24072555    } 
    2408  
    2409   } 
     2556  } 
     2557  CATCH_DUMP_ATTR 
    24102558 
    24112559  /*! 
     
    24142562  */ 
    24152563  void CGrid::setAxisList(const std::vector<CAxis*> axis) 
     2564  TRY 
    24162565  { 
    24172566    if (isAxisListSet) return; 
     
    24352584    } 
    24362585  } 
     2586  CATCH_DUMP_ATTR 
    24372587 
    24382588  /*! 
     
    24412591  */ 
    24422592  void CGrid::setScalarList(const std::vector<CScalar*> scalars) 
     2593  TRY 
    24432594  { 
    24442595    if (isScalarListSet) return; 
     
    24622613    } 
    24632614  } 
     2615  CATCH_DUMP_ATTR 
    24642616 
    24652617  /*! 
     
    24682620  */ 
    24692621  std::vector<StdString> CGrid::getDomainList() 
     2622  TRY 
    24702623  { 
    24712624    setDomainList(); 
    24722625    return domList_; 
    24732626  } 
     2627  CATCH 
    24742628 
    24752629  /*! 
     
    24782632  */ 
    24792633  std::vector<StdString> CGrid::getAxisList() 
     2634  TRY 
    24802635  { 
    24812636    setAxisList(); 
    24822637    return axisList_; 
    24832638  } 
     2639  CATCH 
    24842640 
    24852641  /*! 
     
    24882644  */ 
    24892645  std::vector<StdString> CGrid::getScalarList() 
     2646  TRY 
    24902647  { 
    24912648    setScalarList(); 
    24922649    return scalarList_; 
    24932650  } 
     2651  CATCH 
    24942652 
    24952653  /*! 
     
    24972655  */ 
    24982656  void CGrid::sendAllDomains() 
     2657  TRY 
    24992658  { 
    25002659    std::vector<CDomain*> domList = this->getVirtualDomainGroup()->getAllChildren(); 
     
    25062665    } 
    25072666  } 
     2667  CATCH_DUMP_ATTR 
    25082668 
    25092669  /*! 
     
    25112671  */ 
    25122672  void CGrid::sendAllAxis() 
     2673  TRY 
    25132674  { 
    25142675    std::vector<CAxis*> aList = this->getVirtualAxisGroup()->getAllChildren(); 
     
    25212682    } 
    25222683  } 
     2684  CATCH_DUMP_ATTR 
    25232685 
    25242686  /*! 
     
    25262688  */ 
    25272689  void CGrid::sendAllScalars() 
     2690  TRY 
    25282691  { 
    25292692    std::vector<CScalar*> sList = this->getVirtualScalarGroup()->getAllChildren(); 
     
    25362699    } 
    25372700  } 
     2701  CATCH_DUMP_ATTR 
    25382702 
    25392703  void CGrid::setContextClient(CContextClient* contextClient) 
     2704  TRY 
    25402705  { 
    25412706    if (clientsSet.find(contextClient)==clientsSet.end()) 
     
    25492714        this->getAxis()[i]->setContextClient(contextClient); 
    25502715  } 
     2716  CATCH_DUMP_ATTR 
    25512717 
    25522718  /*! 
     
    25542720  */ 
    25552721  void CGrid::parse(xml::CXMLNode& node) 
     2722  TRY 
    25562723  { 
    25572724    SuperClass::parse(node); 
     
    25942761    setScalarList(); 
    25952762   } 
     2763  CATCH_DUMP_ATTR 
     2764 
    25962765} // namespace xios 
Note: See TracChangeset for help on using the changeset viewer.