Changeset 1571 for XIOS/dev/dev_olga/src/node
- Timestamp:
- 09/06/18 18:55:44 (6 years ago)
- Location:
- XIOS/dev/dev_olga/src/node
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_olga/src/node/axis.cpp
r1570 r1571 245 245 void CAxis::checkAttributes(void) 246 246 { 247 if (this->n_glo.isEmpty()) 247 CContext* context=CContext::getCurrent(); 248 249 if (this->n_glo.isEmpty()) 248 250 ERROR("CAxis::checkAttributes(void)", 249 251 << "[ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] " … … 287 289 if (!this->value.isEmpty()) 288 290 { 289 StdSize true_size = value.numElements(); 290 if (this->n.getValue() != true_size) 291 ERROR("CAxis::checkAttributes(void)", 291 // Avoid this check at writing because it fails in case of a hole 292 if (context->hasClient) 293 { 294 StdSize true_size = value.numElements(); 295 if (this->n.getValue() != true_size) 296 ERROR("CAxis::checkAttributes(void)", 292 297 << "[ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] " 293 << "The axis is wrongly defined, attribute 'value' has a different size (" << true_size << ") than the one defined by the \'size\' attribute (" << n.getValue() << ")."); 298 << "The axis is wrongly defined, attribute 'value' has a different size (" << true_size 299 << ") than the one defined by the \'size\' attribute (" << n.getValue() << ")."); 300 } 294 301 this->hasValue = true; 295 302 } … … 297 304 this->checkBounds(); 298 305 299 CContext* context=CContext::getCurrent();300 306 if (context->hasClient) 301 307 { … … 651 657 // Even if a client has no index, it must connect to at least one server and 652 658 // send an "empty" data to this server 653 if (connectedServerRank_[nbServer].empty()) 654 connectedServerRank_[nbServer].push_back(client->clientRank % client->serverSize); 659 // if (connectedServerRank_[nbServer].empty()) 660 // connectedServerRank_[nbServer].push_back(client->clientRank % client->serverSize); 661 // Send empty data to all servers 662 if (connectedServerRank_[nbServer].empty()) 663 for (int i=0; i<nbServer; ++i) 664 connectedServerRank_[nbServer].push_back(i); 665 655 666 656 667 nbSenders[nbServer] = CClientServerMapping::computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerRank_[nbServer]); … … 690 701 CArray<size_t,1>::const_iterator itSrvb = writtenGlobalIndex.begin(), 691 702 itSrve = writtenGlobalIndex.end(), itSrv; 703 // for (itSrv = itSrvb; itSrv != itSrve; ++itSrv) 704 // { 705 // indGlo = *itSrv; 706 // if (ite != globalLocalIndexMap_.find(indGlo)) 707 // { 708 // ++nbWritten; 709 // } 710 // } 711 712 localIndexToWriteOnServer.resize(writtenGlobalIndex.numElements()); 713 // localIndexToWriteOnServer.resize(nbWritten); 714 715 nbWritten = 0; 692 716 for (itSrv = itSrvb; itSrv != itSrve; ++itSrv) 693 717 { … … 695 719 if (ite != globalLocalIndexMap_.find(indGlo)) 696 720 { 697 ++nbWritten;698 }699 }700 701 localIndexToWriteOnServer.resize(writtenGlobalIndex.numElements());702 // localIndexToWriteOnServer.resize(nbWritten);703 704 nbWritten = 0;705 for (itSrv = itSrvb; itSrv != itSrve; ++itSrv)706 {707 indGlo = *itSrv;708 if (ite != globalLocalIndexMap_.find(indGlo))709 {710 721 localIndexToWriteOnServer(nbWritten) = globalLocalIndexMap_[indGlo]; 711 ++nbWritten; 712 } 713 } 722 } 723 else 724 { 725 localIndexToWriteOnServer(nbWritten) = -1; 726 } 727 ++nbWritten; 728 } 729 714 730 } 715 731 … … 1194 1210 if (0 == globalLocalIndexMap_.count(gloInd)) 1195 1211 { 1196 index(nbIndLoc) = gloInd % n_glo; 1197 globalLocalIndexMap_[gloInd] = nbIndLoc; 1212 // index(nbIndLoc) = gloInd % n_glo; 1213 // globalLocalIndexMap_[gloInd] = nbIndLoc; 1214 // ++nbIndexGlob; 1215 index(nbIndexGlob) = gloInd % n_glo; 1216 globalLocalIndexMap_[gloInd] = nbIndexGlob; 1198 1217 ++nbIndexGlob; 1199 1218 } … … 1271 1290 } 1272 1291 1273 1274 1292 /*! 1275 1293 Compare two axis objects. -
XIOS/dev/dev_olga/src/node/axis.hpp
r1568 r1571 114 114 void computeWrittenIndex(); 115 115 void computeWrittenCompressedIndex(MPI_Comm); 116 117 template <class T> void outputAxis(CArray<T,1>& valueIn, CArray<T,1>& valueOut); 118 116 119 bool hasTransformation(); 117 120 void solveInheritanceTransformation(); … … 126 129 bool hasLabel; 127 130 128 CArray<size_t,1> localIndexToWriteOnServer; 131 // CArray<size_t,1> localIndexToWriteOnServer; 132 CArray<int,1> localIndexToWriteOnServer; 133 CArray<size_t,1> localIndexToWriteOnClient; 129 134 130 135 private: … … 185 190 ///-------------------------------------------------------------- 186 191 192 template <class T> void CAxis::outputAxis(CArray<T,1>& valueIn, CArray<T,1>& valueOut) 193 { 194 int sizeServer = localIndexToWriteOnServer.numElements(); 195 int sizeClient = localIndexToWriteOnClient.numElements(); 196 valueOut.resize(sizeClient); 197 198 if (sizeServer == sizeClient) 199 { 200 valueOut = valueIn; 201 } 202 else 203 // a hole 204 { 205 valueOut = valueIn; 206 //valueOut = -1; initialize here to some value ???? 207 } 208 // CArray<size_t,1>& outIndexClient = grid->localIndexToWriteOnClient; 209 // CArray<size_t,1>& outIndexServer = grid->localIndexToWriteOnServer; 210 // for (size_t idx = 0; idx < outIndexServer.numElements(); ++idx) 211 // { 212 // fieldOut(outIndexServer(idx)) = recvDataSrv(outIndexClient(idx)); 213 // } 214 } 215 187 216 // Declare/Define CAxisGroup and CAxisDefinition 188 217 DECLARE_GROUP(CAxis); -
XIOS/dev/dev_olga/src/node/domain.cpp
r1570 r1571 1848 1848 // Even if a client has no index, it must connect to at least one server and 1849 1849 // send an "empty" data to this server 1850 // if (connectedServerRank_[nbServer].empty()) 1851 // connectedServerRank_[nbServer].push_back(client->clientRank % client->serverSize); 1852 1853 // Trying instead: send empty data to all servers 1850 1854 if (connectedServerRank_[nbServer].empty()) 1851 connectedServerRank_[nbServer].push_back(client->clientRank % client->serverSize); 1855 for (int i = 0; i < client->serverSize; ++i) 1856 connectedServerRank_[nbServer].push_back(i); 1857 1852 1858 1853 1859 nbSenders[nbServer] = clientServerMap->computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerRank_[nbServer]); … … 1904 1910 { 1905 1911 localIndexToWriteOnServer(nbWritten) = globalLocalIndexMap_[indGlo]; 1906 ++nbWritten;1907 1912 } 1908 1913 else 1909 1914 { 1910 localIndexToWriteOnServer(nbWritten) = 0;1911 ++nbWritten;1912 }1915 localIndexToWriteOnServer(nbWritten) = -1; 1916 } 1917 ++nbWritten; 1913 1918 } 1914 1919 … … 2512 2517 nbIndLoc = iIndex + ni * jIndex; 2513 2518 // if (nbIndLoc < nbIndexGlobMax) // THIS CONDITION IMPEDES THE CASE OF A HOLE 2514 {2515 i_index(nbIndLoc) = index % ni_glo;2516 j_index(nbIndLoc) = index / ni_glo;2517 globalLocalIndexMap_[index] = nbIndLoc; 2518 ++nbIndGlob;2519 }2520 //i_index(nbIndGlob) = index % ni_glo;2521 //j_index(nbIndGlob) = index / ni_glo;2522 // globalLocalIndexMap_[index] = nbIndGlob;2523 //++nbIndGlob;2519 // { 2520 // i_index(nbIndLoc) = index % ni_glo; 2521 // j_index(nbIndLoc) = index / ni_glo; 2522 // globalLocalIndexMap_[index] = nbIndLoc; 2523 // ++nbIndGlob; 2524 // } 2525 i_index(nbIndGlob) = index % ni_glo; 2526 j_index(nbIndGlob) = index / ni_glo; 2527 globalLocalIndexMap_[index] = nbIndGlob; 2528 ++nbIndGlob; 2524 2529 } 2525 2530 } -
XIOS/dev/dev_olga/src/node/domain.hpp
r1553 r1571 142 142 CArray<double, 1> areavalue; 143 143 144 CArray< size_t,1> localIndexToWriteOnServer;144 CArray<int,1> localIndexToWriteOnServer; 145 145 146 146 CArray<bool, 1> domainMask; // mask_1d, mask_2d -> domainMask -
XIOS/dev/dev_olga/src/node/grid.cpp
r1570 r1571 841 841 // Even if a client has no index, it must connect to at least one server and 842 842 // send an "empty" data to this server 843 // if (connectedServerRank_[receiverSize].empty()) 844 // connectedServerRank_[receiverSize].push_back(client->clientRank % client->serverSize); 845 846 // Trying instead: send empty data to all servers 843 847 if (connectedServerRank_[receiverSize].empty()) 844 connectedServerRank_[receiverSize].push_back(client->clientRank % client->serverSize); 848 for (int i = 0; i < client->serverSize; ++i) 849 connectedServerRank_[receiverSize].push_back(i); 845 850 846 851 nbSenders[receiverSize] = clientServerMap_->computeConnectedClients(receiverSize, client->clientSize, client->intraComm, connectedServerRank_[receiverSize]);
Note: See TracChangeset
for help on using the changeset viewer.