Changeset 870 for XIOS


Ignore:
Timestamp:
06/09/16 11:33:32 (8 years ago)
Author:
mhnguyen
Message:

Removing some unnecessary files and code lines

Location:
XIOS/trunk/src
Files:
2 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/distribution_client.cpp

    r864 r870  
    488488      if (isCurrentIndexDataCorrect) 
    489489      { 
    490         int gridMaskIndex = 0; //currentIndex[0]; 
     490        int gridMaskIndex = 0; 
    491491        for (int k = 0; k < this->numElement_; ++k) 
    492492        { 
     
    505505          if (isIndexOnServer) 
    506506          { 
    507             size_t globalIndex = 0; //currentGlobalIndex[0]; 
     507            size_t globalIndex = 0; 
    508508            for (int k = 0; k < numElement_; ++k) 
    509509            { 
     
    524524} 
    525525 
    526 ///*! 
    527 //  Create local index of domain(s). 
    528 //  A domain can have data index which even contains the "ghost" points. Very often, these 
    529 //data surround the true data. In order to send correct data to server, 
    530 //a client need to know index of the true data. 
    531 //*/ 
    532 //void CDistributionClient::createLocalDomainDataIndex() 
    533 //{ 
    534 //  int numDomain = 0; 
    535 //  for (int i = 0; i < axisDomainOrder_.numElements(); ++i) 
    536 //    if (axisDomainOrder_(i)) ++numDomain; 
    537 // 
    538 //  localDomainIndex_.resize(numDomain*2); 
    539 //  indexDomainData_.resize(numDomain); 
    540 // 
    541 //  int idxDomain = 0; 
    542 //  for (int i = 0; i < axisDomainOrder_.numElements(); ++i) 
    543 //  { 
    544 //    if (axisDomainOrder_(i)) 
    545 //    { 
    546 //      int iIdx, jIdx = 0, count = 0; 
    547 //      indexDomainData_[idxDomain].resize(dataNIndex_[i], false); 
    548 //      for (int j = 0; j < dataNIndex_[i]; ++j) 
    549 //      { 
    550 //        iIdx = getDomainIndex((*dataIndex_[indexMap_[i]])(j), (*dataIndex_[indexMap_[i]+1])(j), 
    551 //                              dataBegin_[indexMap_[i]], dataBegin_[indexMap_[i]+1], 
    552 //                              dataDims_[i], nLocal_[indexMap_[i]], jIdx); 
    553 // 
    554 //        if ((iIdx >= nBeginLocal_[indexMap_[i]]) && (iIdx < nLocal_[indexMap_[i]]) && 
    555 //           (jIdx >= nBeginLocal_[indexMap_[i]+1]) && (jIdx < nLocal_[indexMap_[i]+1]) && 
    556 //           (domainMasks_[idxDomain](iIdx + jIdx*nLocal_[indexMap_[i]]))) 
    557 //        { 
    558 //          (localDomainIndex_[idxDomain]).push_back(iIdx); 
    559 //          (localDomainIndex_[idxDomain*2+1]).push_back(jIdx); 
    560 //          indexDomainData_[idxDomain][j] = true; 
    561 //        } 
    562 //      } 
    563 //      ++idxDomain; 
    564 //    } 
    565 //  } 
    566 //} 
    567  
    568 ///*! 
    569 //  Create local index of axis. 
    570 //*/ 
    571 //void CDistributionClient::createLocalAxisDataIndex() 
    572 //{ 
    573 //  int numAxis = 0; 
    574 //  for (int i = 0; i < axisDomainOrder_.numElements(); ++i) 
    575 //    if (!axisDomainOrder_(i)) ++numAxis; 
    576 // 
    577 //  localAxisIndex_.resize(numAxis); 
    578 //  indexAxisData_.resize(numAxis); 
    579 // 
    580 //  int idxAxis = 0; 
    581 //  for (int i = 0; i < axisDomainOrder_.numElements(); ++i) 
    582 //  { 
    583 //    if (!axisDomainOrder_(i)) 
    584 //    { 
    585 //      int iIdx = 0; 
    586 //      indexAxisData_[idxAxis].resize(dataNIndex_[i], false); 
    587 //      for (int j = 0; j < dataNIndex_[i]; ++j) 
    588 //      { 
    589 //        iIdx = getAxisIndex((*dataIndex_[indexMap_[i]])(j), dataBegin_[indexMap_[i]], nLocal_[indexMap_[i]]); 
    590 //        if ((iIdx >= nBeginLocal_[indexMap_[i]]) && 
    591 //           (iIdx < nLocal_[indexMap_[i]]) && (axisMasks_[idxAxis](iIdx))) 
    592 //        { 
    593 //          localAxisIndex_[idxAxis].push_back(iIdx); 
    594 //          indexAxisData_[idxAxis][j] = true; 
    595 //        } 
    596 //      } 
    597 //      ++idxAxis; 
    598 //    } 
    599 //  } 
    600 //} 
    601  
    602526void CDistributionClient::createGlobalIndex() 
    603527{ 
     
    652576 
    653577} 
    654  
    655  
    656 ///*! 
    657 //   Create global index on client 
    658 //   In order to do the mapping between client-server, each client creates its own 
    659 //global index of sending data. This global index is then used to calculate to which server 
    660 //the client needs to send it data as well as which part of data belongs to the server. 
    661 //So as to make clients and server coherent in order of index, global index is calculated by 
    662 //take into account of C-convention, the rightmost dimension varies faster. 
    663 //*/ 
    664 //void CDistributionClient::createGlobalIndexSendToServer() 
    665 //{ 
    666 //  if (isComputed_) return; 
    667 //  isComputed_ = true; 
    668 //  createLocalDomainDataIndex(); 
    669 //  createLocalAxisDataIndex(); 
    670 // 
    671 //  int idxDomain = 0, idxAxis = 0; 
    672 //  std::vector<int> eachElementSize(numElement_); 
    673 // 
    674 //  // Precompute size of the loop 
    675 //  for (int i = 0; i < numElement_; ++i) 
    676 //  { 
    677 //    if(axisDomainOrder_(i)) 
    678 //    { 
    679 //      eachElementSize[i] = localDomainIndex_[idxDomain].size(); 
    680 //      idxDomain += 2; 
    681 //    } 
    682 //    else 
    683 //    { 
    684 //      eachElementSize[i] = localAxisIndex_[idxAxis].size(); 
    685 //      ++idxAxis; 
    686 //    } 
    687 //  } 
    688 // 
    689 //  //   Compute size of the global index on client 
    690 //  std::vector<StdSize> idxLoop(numElement_,0); 
    691 //  std::vector<StdSize> currentIndex(this->dims_,0); 
    692 //  int innerLoopSize = eachElementSize[0]; 
    693 //  size_t idx = 0, indexLocalDataOnClientCount = 0, indexSend2ServerCount = 0; 
    694 //  size_t ssize = 1; 
    695 //  for (int i = 0; i < numElement_; ++i) ssize *= eachElementSize[i]; 
    696 //  while (idx < ssize) 
    697 //  { 
    698 //    for (int i = 0; i < numElement_-1; ++i) 
    699 //    { 
    700 //      if (idxLoop[i] == eachElementSize[i]) 
    701 //      { 
    702 //        idxLoop[i] = 0; 
    703 //        ++idxLoop[i+1]; 
    704 //      } 
    705 //    } 
    706 // 
    707 //    // Find out outer index 
    708 //    // Depending the inner-most element is axis or domain, 
    709 //    // The outer loop index begins correspondingly at one (1) or zero (0) 
    710 //    idxDomain = idxAxis = 0; 
    711 //    if (axisDomainOrder_(0)) ++idxDomain; 
    712 //    else ++idxAxis; 
    713 //    for (int i = 1; i < numElement_; ++i) 
    714 //    { 
    715 //      if (axisDomainOrder_(i)) 
    716 //      { 
    717 //        currentIndex[indexMap_[i]]   = localDomainIndex_[idxDomain][idxLoop[i]]; 
    718 //        currentIndex[indexMap_[i]+1] = localDomainIndex_[idxDomain+1][idxLoop[i]]; 
    719 //        idxDomain += 2; 
    720 //      } 
    721 //      else 
    722 //      { 
    723 //        currentIndex[indexMap_[i]]   = localAxisIndex_[idxAxis][idxLoop[i]]; 
    724 //        ++idxAxis; 
    725 //      } 
    726 //    } 
    727 // 
    728 //    // Inner most index 
    729 //    idxDomain = idxAxis = 0; 
    730 //    for (int i = 0; i < innerLoopSize; ++i) 
    731 //    { 
    732 //      if (axisDomainOrder_(0)) 
    733 //      { 
    734 //        currentIndex[0] = localDomainIndex_[idxDomain][i]; 
    735 //        currentIndex[1] = localDomainIndex_[idxDomain+1][i]; 
    736 //      } 
    737 //      else currentIndex[0]   = localAxisIndex_[idxAxis][i]; 
    738 // 
    739 //      StdSize gridMaskIndex = currentIndex[0]; 
    740 //      int mulDimMask = 1; 
    741 //      for (int k = 1; k < this->dims_; ++k) 
    742 //      { 
    743 //        mulDimMask *= nLocal_[k-1]; 
    744 //        gridMaskIndex += (currentIndex[k])*mulDimMask; 
    745 //      } 
    746 // 
    747 //      if (gridMask_(gridMaskIndex)) 
    748 //      { 
    749 //        ++indexLocalDataOnClientCount; 
    750 //        bool isIndexOnServer = true; 
    751 // 
    752 //        for (int idxElement = 0; idxElement < this->numElement_; ++idxElement) 
    753 //        { 
    754 //          int actualIdx = 0; 
    755 //          if (axisDomainOrder_(idxElement)) 
    756 //          { 
    757 //            actualIdx = currentIndex[indexMap_[idxElement]]+currentIndex[indexMap_[idxElement]+1]*nLocal_[indexMap_[idxElement]]; 
    758 //            isIndexOnServer = isIndexOnServer && (((*infoIndex_[indexMap_[idxElement]])(actualIdx)) <= nZoomEnd_[indexMap_[idxElement]]) 
    759 //                                              && (nZoomBegin_[indexMap_[idxElement]] <= ((*infoIndex_[indexMap_[idxElement]])(actualIdx))) 
    760 //                                              && (((*infoIndex_[indexMap_[idxElement]+1])(actualIdx)) <= nZoomEnd_[indexMap_[idxElement]+1]) 
    761 //                                              && (nZoomBegin_[indexMap_[idxElement]+1] <= ((*infoIndex_[indexMap_[idxElement]+1])(actualIdx))); 
    762 //          } 
    763 //          else 
    764 //          { 
    765 //            isIndexOnServer = isIndexOnServer && (((*infoIndex_[indexMap_[idxElement]])(currentIndex[indexMap_[idxElement]])) <= nZoomEnd_[indexMap_[idxElement]]) 
    766 //                                              && (nZoomBegin_[indexMap_[idxElement]] <= ((*infoIndex_[indexMap_[idxElement]])(currentIndex[indexMap_[idxElement]]))); 
    767 //          } 
    768 //        } 
    769 //        if (isIndexOnServer) ++indexSend2ServerCount; 
    770 //      } 
    771 // 
    772 //    } 
    773 //    idxLoop[0] += innerLoopSize; 
    774 //    idx += innerLoopSize; 
    775 //  } 
    776 // 
    777 //  // Now allocate these arrays 
    778 //  localDataIndex_.resize(indexLocalDataOnClientCount); 
    779 //  localMaskIndex_.resize(indexSend2ServerCount); 
    780 //  globalLocalDataSendToServerMap_.rehash(std::ceil(indexSend2ServerCount/globalLocalDataSendToServerMap_.max_load_factor())); //globalLocalDataSendToServerMap_.reserve(indexSend2ServerCount); 
    781 // 
    782 //  // We need to loop with data index 
    783 //  idxLoop.assign(numElement_,0); 
    784 //  idx = indexLocalDataOnClientCount = indexSend2ServerCount = 0; 
    785 //  ssize = 1; for (int i = 0; i < numElement_; ++i) ssize *= dataNIndex_[i]; 
    786 //  innerLoopSize = dataNIndex_[0]; 
    787 //  int countLocalData = 0; 
    788 //  std::vector<int> correctOuterIndex(numElement_,0); 
    789 //  bool isOuterIndexCorrect = true; 
    790 //  while (idx < ssize) 
    791 //  { 
    792 //    for (int i = 0; i < numElement_-1; ++i) 
    793 //    { 
    794 //      if (idxLoop[i] == dataNIndex_[i]) 
    795 //      { 
    796 //        idxLoop[i] = 0; 
    797 //        correctOuterIndex[i] = 0; 
    798 //        ++idxLoop[i+1]; 
    799 //        if (isOuterIndexCorrect) ++correctOuterIndex[i+1]; 
    800 //      } 
    801 //    } 
    802 // 
    803 //    // Depending the inner-most element axis or domain, 
    804 //    // The outer loop index begins correspondingly at one (1) or zero (0) 
    805 //    idxDomain = idxAxis = 0; 
    806 //    if (axisDomainOrder_(0)) ++idxDomain; 
    807 //    else ++idxAxis; 
    808 //    bool isIndexDomainDataCorrect = true; 
    809 //    bool isIndexAxisDataCorrect = true; 
    810 // 
    811 //    for (int i = 1; i < numElement_; ++i) 
    812 //    { 
    813 //      if (axisDomainOrder_(i)) 
    814 //      { 
    815 //        if (indexDomainData_[idxDomain][idxLoop[i]]) 
    816 //        { 
    817 //          currentIndex[indexMap_[i]]   = localDomainIndex_[idxDomain][correctOuterIndex[i]]; 
    818 //          currentIndex[indexMap_[i]+1] = localDomainIndex_[idxDomain*2+1][correctOuterIndex[i]]; 
    819 //          isIndexDomainDataCorrect &= true; 
    820 //        } 
    821 //        else isIndexDomainDataCorrect = false; 
    822 //        ++idxDomain; 
    823 //      } 
    824 //      else 
    825 //      { 
    826 //        if (indexAxisData_[idxAxis][idxLoop[i]]) 
    827 //        { 
    828 //          currentIndex[indexMap_[i]]   = localAxisIndex_[idxAxis][correctOuterIndex[i]]; 
    829 //          isIndexAxisDataCorrect &= true; 
    830 //        } 
    831 //        else isIndexAxisDataCorrect = false; 
    832 //        ++idxAxis; 
    833 //      } 
    834 //    } 
    835 // 
    836 //    isOuterIndexCorrect = (isIndexAxisDataCorrect) && (isIndexDomainDataCorrect); 
    837 // 
    838 //    // Inner most index 
    839 //    idxDomain = idxAxis = 0; 
    840 //    int correctIndexDomain = 0, correctIndexAxis = 0; 
    841 //    for (int i = 0; i < innerLoopSize; ++i) 
    842 //    { 
    843 //      bool isCurrentIndexDomainDataCorrect = isIndexDomainDataCorrect; 
    844 //      bool isCurrentIndexAxisDataCorrect = isIndexAxisDataCorrect; 
    845 // 
    846 //      if (axisDomainOrder_(0)) 
    847 //      { 
    848 //        if (indexDomainData_[idxDomain][i]) 
    849 //        { 
    850 //          currentIndex[0] = localDomainIndex_[idxDomain][correctIndexDomain]; 
    851 //          currentIndex[1] = localDomainIndex_[idxDomain+1][correctIndexDomain]; 
    852 //          isCurrentIndexDomainDataCorrect &= true; 
    853 //          ++correctIndexDomain; 
    854 //        } 
    855 //        else isCurrentIndexDomainDataCorrect = false; 
    856 //      } 
    857 //      else 
    858 //      { 
    859 //        if (indexAxisData_[idxAxis][i]) 
    860 //        { 
    861 //          currentIndex[0] = localAxisIndex_[idxAxis][correctIndexAxis]; 
    862 //          isCurrentIndexAxisDataCorrect &= true; 
    863 //          ++correctIndexAxis; 
    864 //        } 
    865 //        else isCurrentIndexAxisDataCorrect = false; 
    866 //      } 
    867 // 
    868 //      int gridMaskIndex = currentIndex[0]; 
    869 //      int mulDimMask = 1; 
    870 //      for (int k = 1; k < this->dims_; ++k) 
    871 //      { 
    872 //        mulDimMask *= nLocal_[k-1]; 
    873 //        gridMaskIndex += (currentIndex[k])*mulDimMask; 
    874 //      } 
    875 // 
    876 //      if (isCurrentIndexDomainDataCorrect && 
    877 //          isCurrentIndexAxisDataCorrect && 
    878 //          gridMask_(gridMaskIndex)) 
    879 //      { 
    880 //        localDataIndex_[indexLocalDataOnClientCount] = countLocalData; 
    881 //        bool isIndexOnServer = true; 
    882 //        for (int idxElement = 0; idxElement < this->numElement_; ++idxElement) 
    883 //        { 
    884 //          int actualIdx = 0; 
    885 //          if (axisDomainOrder_(idxElement)) 
    886 //          { 
    887 //            actualIdx = currentIndex[indexMap_[idxElement]]+currentIndex[indexMap_[idxElement]+1]*nLocal_[indexMap_[idxElement]]; 
    888 //            isIndexOnServer = isIndexOnServer && (((*infoIndex_[indexMap_[idxElement]])(actualIdx)) <= nZoomEnd_[indexMap_[idxElement]]) 
    889 //                                              && (nZoomBegin_[indexMap_[idxElement]] <= ((*infoIndex_[indexMap_[idxElement]])(actualIdx))) 
    890 //                                              && (((*infoIndex_[indexMap_[idxElement]+1])(actualIdx)) <= nZoomEnd_[indexMap_[idxElement]+1]) 
    891 //                                              && (nZoomBegin_[indexMap_[idxElement]+1] <= ((*infoIndex_[indexMap_[idxElement]+1])(actualIdx))); 
    892 //          } 
    893 //          else 
    894 //          { 
    895 //            isIndexOnServer = isIndexOnServer && (((*infoIndex_[indexMap_[idxElement]])(currentIndex[indexMap_[idxElement]])) <= nZoomEnd_[indexMap_[idxElement]]) 
    896 //                                              && (nZoomBegin_[indexMap_[idxElement]] <= ((*infoIndex_[indexMap_[idxElement]])(currentIndex[indexMap_[idxElement]]))); 
    897 //          } 
    898 //        } 
    899 // 
    900 //        if (isIndexOnServer) 
    901 //        { 
    902 //          int actualIdx = (axisDomainOrder_(0)) ? currentIndex[0]+currentIndex[1]*nLocal_[0] 
    903 //                                                : currentIndex[0]; 
    904 //          size_t globalIndex = (*infoIndex_[0])(actualIdx); //idxLoop[0] + nBeginGlobal_[0]; 
    905 //          size_t mulDim = 1; 
    906 //          for (int idxElement = 0; idxElement < this->numElement_; ++idxElement) 
    907 //          { 
    908 //            if (axisDomainOrder_(idxElement)) 
    909 //            { 
    910 //              actualIdx = currentIndex[indexMap_[idxElement]]+currentIndex[indexMap_[idxElement]+1]*nLocal_[indexMap_[idxElement]]; 
    911 //              int jb = (0 == idxElement) ? 1 : 0; 
    912 //              for (int j = jb; j <= 1; ++j) 
    913 //              { 
    914 //                mulDim *= nGlob_[indexMap_[idxElement]+j-1]; 
    915 //                globalIndex += ((*infoIndex_[indexMap_[idxElement]+j])(actualIdx))*mulDim; 
    916 //              } 
    917 //            } 
    918 //            else 
    919 //            { 
    920 //              if (0 != idxElement) 
    921 //              { 
    922 //                mulDim *= nGlob_[indexMap_[idxElement]-1]; 
    923 //                globalIndex += ((*infoIndex_[indexMap_[idxElement]])(currentIndex[indexMap_[idxElement]]))*mulDim; 
    924 //              } 
    925 //            } 
    926 //          } 
    927 //          globalLocalDataSendToServerMap_[globalIndex] = indexLocalDataOnClientCount; 
    928 //          localMaskIndex_[indexSend2ServerCount] = gridMaskIndex; 
    929 //          ++indexSend2ServerCount; 
    930 //        } 
    931 //        ++indexLocalDataOnClientCount; 
    932 //      } 
    933 //      ++countLocalData; 
    934 //    } 
    935 //    idxLoop[0] += innerLoopSize; 
    936 //    idx += innerLoopSize; 
    937 //  } 
    938 //} 
    939578 
    940579/*! 
Note: See TracChangeset for help on using the changeset viewer.