Changeset 874
 Timestamp:
 06/14/16 16:28:11 (5 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

XIOS/trunk/src/distribution_client.cpp
r870 r874 441 441 innerLoopSize = dataNIndex_[0]; 442 442 int countLocalData = 0; 443 std::vector<int> correct OuterIndex(numElement_,0);443 std::vector<int> correctIndexOfElement(numElement_,0); 444 444 bool isOuterIndexCorrect = true; 445 445 while (idx < ssize) … … 450 450 { 451 451 idxLoop[i] = 0; 452 correct OuterIndex[i] = 0;452 correctIndexOfElement[i] = 0; 453 453 ++idxLoop[i+1]; 454 if (isOuterIndexCorrect) ++correct OuterIndex[i+1];454 if (isOuterIndexCorrect) ++correctIndexOfElement[i+1]; 455 455 } 456 456 } … … 463 463 if (elementIndexData_[i](idxLoop[i])) 464 464 { 465 currentIndex[i] = elementLocalIndex_[i](correct OuterIndex[i]);466 currentGlobalIndex[i] = elementGlobalIndex_[i](correct OuterIndex[i]);465 currentIndex[i] = elementLocalIndex_[i](correctIndexOfElement[i]); 466 currentGlobalIndex[i] = elementGlobalIndex_[i](correctIndexOfElement[i]); 467 467 isIndexElementDataCorrect &= true; 468 468 } … … 472 472 isOuterIndexCorrect = isIndexElementDataCorrect; 473 473 474 // Inner most index 475 int correctIndexElement = 0; 476 for (int i = 0; i < innerLoopSize; ++i) 477 { 478 bool isCurrentIndexDataCorrect = isOuterIndexCorrect; 479 if (elementIndexData_[0](i)) 480 { 481 currentIndex[0] = elementLocalIndex_[0](correctIndexElement); 482 currentGlobalIndex[0] = elementGlobalIndex_[0](correctIndexElement); 483 isCurrentIndexDataCorrect &= true; 484 ++correctIndexElement; 485 } 486 else isCurrentIndexDataCorrect = false; 487 488 if (isCurrentIndexDataCorrect) 489 { 490 int gridMaskIndex = 0; 491 for (int k = 0; k < this>numElement_; ++k) 492 { 493 gridMaskIndex += (currentIndex[k])*elementNLocal_[k]; 494 } 495 496 if (gridMask_(gridMaskIndex)) 497 { 498 localDataIndex_[indexLocalDataOnClientCount] = countLocalData; 499 bool isIndexOnServer = true; 500 for (int idxElement = 0; idxElement < this>numElement_; ++idxElement) 474 if (isOuterIndexCorrect) 475 { 476 // Inner most index 477 int correctIndexInnerElement = 0; 478 for (int i = 0; i < innerLoopSize; ++i) 479 { 480 bool isCurrentIndexDataCorrect = isOuterIndexCorrect; 481 if (elementIndexData_[0](i)) 482 { 483 currentIndex[0] = elementLocalIndex_[0](correctIndexInnerElement); 484 currentGlobalIndex[0] = elementGlobalIndex_[0](correctIndexInnerElement); 485 isCurrentIndexDataCorrect &= true; 486 ++correctIndexInnerElement; 487 } 488 else isCurrentIndexDataCorrect = false; 489 490 if (isCurrentIndexDataCorrect) 491 { 492 int gridMaskIndex = 0; 493 for (int k = 0; k < this>numElement_; ++k) 501 494 { 502 isIndexOnServer = isIndexOnServer && elementZoomMask_[idxElement](idxLoop[idxElement]);495 gridMaskIndex += (currentIndex[k])*elementNLocal_[k]; 503 496 } 504 497 505 if ( isIndexOnServer)498 if (gridMask_(gridMaskIndex)) 506 499 { 507 size_t globalIndex = 0; 508 for (int k = 0; k < numElement_; ++k) 500 localDataIndex_[indexLocalDataOnClientCount] = countLocalData; 501 bool isIndexOnServer = true; 502 for (int idxElement = 0; idxElement < this>numElement_; ++idxElement) 509 503 { 510 globalIndex += (currentGlobalIndex[k])*elementNGlobal_[k];504 isIndexOnServer = isIndexOnServer && elementZoomMask_[idxElement](correctIndexOfElement[idxElement]); 511 505 } 512 globalLocalDataSendToServerMap_[globalIndex] = indexLocalDataOnClientCount; 513 localMaskIndex_[indexSend2ServerCount] = gridMaskIndex; 514 ++indexSend2ServerCount; 506 507 if (isIndexOnServer) 508 { 509 size_t globalIndex = 0; 510 for (int k = 0; k < numElement_; ++k) 511 { 512 globalIndex += (currentGlobalIndex[k])*elementNGlobal_[k]; 513 } 514 globalLocalDataSendToServerMap_[globalIndex] = indexLocalDataOnClientCount; 515 localMaskIndex_[indexSend2ServerCount] = gridMaskIndex; 516 ++indexSend2ServerCount; 517 } 518 ++indexLocalDataOnClientCount; 515 519 } 516 ++indexLocalDataOnClientCount;517 }518 }519 ++countLocalData;520 } 521 ++countLocalData; 522 correctIndexOfElement[0] = correctIndexInnerElement;; 523 } 520 524 } 521 525 idxLoop[0] += innerLoopSize;
Note: See TracChangeset
for help on using the changeset viewer.