Changeset 906
- Timestamp:
- 07/28/16 10:56:52 (9 years ago)
- Location:
- XIOS/trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/client_server_mapping_distributed.cpp
r860 r906 13 13 #include "utils.hpp" 14 14 #include "mpi_tag.hpp" 15 #include "context.hpp" 16 #include "context_client.hpp" 15 17 16 18 namespace xios … … 36 38 void CClientServerMappingDistributed::computeServerIndexMapping(const CArray<size_t,1>& globalIndexOnClient) 37 39 { 40 CContext* context=CContext::getCurrent() ; 41 CContextClient* client=context->client ; 42 int nbServer=client->serverSize; 43 38 44 ccDHT_->computeIndexInfoMapping(globalIndexOnClient); 39 45 const CClientClientDHTInt::Index2VectorInfoTypeMap& infoIndexMap = (ccDHT_->getInfoIndexMap()); 40 46 CClientClientDHTInt::Index2VectorInfoTypeMap::const_iterator itb = infoIndexMap.begin(), ite = infoIndexMap.end(), it; 41 std::vector<size_t> nbInfoIndex( ccDHT_->getNbClient(),0);47 std::vector<size_t> nbInfoIndex(nbServer,0); 42 48 43 49 for (it = itb; it != ite; ++it) -
XIOS/trunk/src/node/axis.cpp
r895 r906 400 400 int nbServer = client->serverSize; 401 401 int range, clientSize = client->clientSize; 402 int rank = client->clientRank; 402 403 403 404 size_t ni = this->n.getValue(); … … 453 454 for (int i = 0; i < nGlobAxis.size(); ++i) globalSizeIndex *= nGlobAxis[i]; 454 455 indexBegin = 0; 455 for (int i = 0; i < clientSize; ++i) 456 { 457 range = globalSizeIndex / clientSize; 458 if (i < (globalSizeIndex%clientSize)) ++range; 459 if (i == client->clientRank) break; 460 indexBegin += range; 461 } 462 indexEnd = indexBegin + range - 1; 456 if (globalSizeIndex <= clientSize) 457 { 458 indexBegin = rank%globalSizeIndex; 459 indexEnd = indexBegin; 460 } 461 else 462 { 463 for (int i = 0; i < clientSize; ++i) 464 { 465 range = globalSizeIndex / clientSize; 466 if (i < (globalSizeIndex%clientSize)) ++range; 467 if (i == client->clientRank) break; 468 indexBegin += range; 469 } 470 indexEnd = indexBegin + range - 1; 471 } 463 472 464 473 CServerDistributionDescription serverDescription(nGlobAxis, nbServer); -
XIOS/trunk/src/node/domain.cpp
r899 r906 532 532 if (bounds_lon_end.isEmpty()) bounds_lon_end=180.-1e-8 ; 533 533 } 534 534 535 535 for(j=0;j<nj;++j) 536 536 for(i=0;i<ni;++i) … … 921 921 size_t zoom_jend=global_zoom_jbegin+global_zoom_nj-1 ; 922 922 923 923 924 924 size_t dn=data_i_index.numElements() ; 925 925 int i,j ; 926 926 size_t k,ind ; 927 927 928 928 for(k=0;k<dn;k++) 929 929 { … … 936 936 { 937 937 i=(data_i_index(k)+data_ibegin)%ni ; 938 j=(data_i_index(k)+data_ibegin)/ni ; 938 j=(data_i_index(k)+data_ibegin)/ni ; 939 939 } 940 940 … … 947 947 } 948 948 } 949 950 951 952 953 954 955 949 950 951 952 953 954 955 956 956 void CDomain::checkEligibilityForCompressedOutput(void) 957 957 { … … 1358 1358 CContextClient* client=context->client ; 1359 1359 int nbServer=client->serverSize; 1360 int rank = client->clientRank; 1360 1361 bool doComputeGlobalIndexServer = true; 1361 1362 … … 1445 1446 for (int i = 0; i < nGlobDomain_.size(); ++i) globalSizeIndex *= nGlobDomain_[i]; 1446 1447 indexBegin = 0; 1447 for (int i = 0; i < clientSize; ++i) 1448 { 1449 range = globalSizeIndex / clientSize; 1450 if (i < (globalSizeIndex%clientSize)) ++range; 1451 if (i == client->clientRank) break; 1452 indexBegin += range; 1453 } 1454 indexEnd = indexBegin + range - 1; 1448 if (globalSizeIndex <= clientSize) 1449 { 1450 indexBegin = rank%globalSizeIndex; 1451 indexEnd = indexBegin; 1452 } 1453 else 1454 { 1455 for (int i = 0; i < clientSize; ++i) 1456 { 1457 range = globalSizeIndex / clientSize; 1458 if (i < (globalSizeIndex%clientSize)) ++range; 1459 if (i == client->clientRank) break; 1460 indexBegin += range; 1461 } 1462 indexEnd = indexBegin + range - 1; 1463 } 1455 1464 1456 1465 CServerDistributionDescription serverDescription(nGlobDomain_, nbServer);
Note: See TracChangeset
for help on using the changeset viewer.