Changeset 720 for XIOS/trunk/src/client_server_mapping_distributed.cpp
- Timestamp:
- 10/06/15 17:17:10 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/client_server_mapping_distributed.cpp
r630 r720 12 12 #include <boost/functional/hash.hpp> 13 13 #include "utils.hpp" 14 #include "client_client_dht.hpp" 15 #include "mpi_tag.hpp" 14 16 15 17 namespace xios … … 19 21 const MPI_Comm& clientIntraComm, bool isDataDistributed) 20 22 : CClientServerMapping(), indexClientHash_(), countIndexGlobal_(0), countIndexServer_(0), 21 indexGlobalBuffBegin_(), indexServerBuffBegin_(), requestRecvIndexServer_(), isDataDistributed_(isDataDistributed) 23 indexGlobalBuffBegin_(), indexServerBuffBegin_(), requestRecvIndexServer_(), isDataDistributed_(isDataDistributed), 24 ccDHT_(0) 22 25 { 23 26 clientIntraComm_ = clientIntraComm; … … 25 28 MPI_Comm_rank(clientIntraComm,&clientRank_); 26 29 computeHashIndex(); 27 computeDistributedServerIndex(globalIndexOfServer, clientIntraComm); 30 31 ccDHT_ = new CClientClientDHT(globalIndexOfServer, 32 clientIntraComm, 33 isDataDistributed); 34 // const boost::unordered_map<size_t,int>& globalIndexToServerMappingTmp = clientDht.getGlobalIndexServerMapping(); 35 // globalIndexToServerMapping_ = clientDht.getGlobalIndexServerMapping(); 36 37 38 39 // computeDistributedServerIndex(globalIndexOfServer, clientIntraComm); 28 40 } 29 41 30 42 CClientServerMappingDistributed::~CClientServerMappingDistributed() 31 43 { 44 if (0 != ccDHT_) delete ccDHT_; 32 45 } 33 46 … … 38 51 void CClientServerMappingDistributed::computeServerIndexMapping(const CArray<size_t,1>& globalIndexOnClient) 39 52 { 53 ccDHT_->computeServerIndexMapping(globalIndexOnClient); 54 indexGlobalOnServer_ = ccDHT_->getGlobalIndexOnServer(); 55 56 /* 40 57 size_t ssize = globalIndexOnClient.numElements(), hashedIndex; 41 58 … … 177 194 delete [] sendBuff; 178 195 delete [] recvBuff; 196 */ 179 197 } 180 198 … … 348 366 349 367 // Probing for global index 350 MPI_Iprobe(MPI_ANY_SOURCE, 15, clientIntraComm_, &flagIndexGlobal, &statusIndexGlobal);368 MPI_Iprobe(MPI_ANY_SOURCE, MPI_DHT_INDEX_0, clientIntraComm_, &flagIndexGlobal, &statusIndexGlobal); 351 369 if ((true == flagIndexGlobal) && (countIndexGlobal_ < recvNbIndexCount)) 352 370 { … … 354 372 indexGlobalBuffBegin_.insert(std::make_pair<int, unsigned long*>(statusIndexGlobal.MPI_SOURCE, recvIndexGlobalBuff+countIndexGlobal_)); 355 373 MPI_Irecv(recvIndexGlobalBuff+countIndexGlobal_, count, MPI_UNSIGNED_LONG, 356 statusIndexGlobal.MPI_SOURCE, 15, clientIntraComm_,374 statusIndexGlobal.MPI_SOURCE, MPI_DHT_INDEX_0, clientIntraComm_, 357 375 &requestRecvIndexGlobal_[statusIndexGlobal.MPI_SOURCE]); 358 376 countIndexGlobal_ += count; … … 373 391 374 392 // Probing for server index 375 MPI_Iprobe(MPI_ANY_SOURCE, 12, clientIntraComm_, &flagIndexServer, &statusIndexServer);393 MPI_Iprobe(MPI_ANY_SOURCE, MPI_DHT_INFO_0, clientIntraComm_, &flagIndexServer, &statusIndexServer); 376 394 if ((true == flagIndexServer) && (countIndexServer_ < recvNbIndexCount)) 377 395 { … … 379 397 indexServerBuffBegin_.insert(std::make_pair<int, int*>(statusIndexServer.MPI_SOURCE, recvIndexServerBuff+countIndexServer_)); 380 398 MPI_Irecv(recvIndexServerBuff+countIndexServer_, count, MPI_INT, 381 statusIndexServer.MPI_SOURCE, 12, clientIntraComm_,399 statusIndexServer.MPI_SOURCE, MPI_DHT_INFO_0, clientIntraComm_, 382 400 &requestRecvIndexServer_[statusIndexServer.MPI_SOURCE]); 383 401 … … 400 418 requestSendIndexGlobal.push_back(request); 401 419 MPI_Isend(&(indexGlobal)[0], (indexGlobal).size(), MPI_UNSIGNED_LONG, 402 clientDestRank, 15, clientIntraComm, &(requestSendIndexGlobal.back()));420 clientDestRank, MPI_DHT_INDEX_0, clientIntraComm, &(requestSendIndexGlobal.back())); 403 421 } 404 422 … … 417 435 requestSendIndexServer.push_back(request); 418 436 MPI_Isend(&(indexServer)[0], (indexServer).size(), MPI_INT, 419 clientDestRank, 12, clientIntraComm, &(requestSendIndexServer.back()));437 clientDestRank, MPI_DHT_INFO_0, clientIntraComm, &(requestSendIndexServer.back())); 420 438 } 421 439
Note: See TracChangeset
for help on using the changeset viewer.