Changeset 1337
- Timestamp:
- 11/21/17 10:05:04 (7 years ago)
- Location:
- XIOS/dev/XIOS_DEV_CMIP6/src/node
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/XIOS_DEV_CMIP6/src/node/axis.cpp
r1336 r1337 180 180 { 181 181 // size estimation for sendDistributedValue 182 boost::unordered_map<int, vector<size_t> >::const_iterator it, ite = indSrv_[client ].end();183 for (it = indSrv_[client ].begin(); it != ite; ++it)182 boost::unordered_map<int, vector<size_t> >::const_iterator it, ite = indSrv_[client->serverSize].end(); 183 for (it = indSrv_[client->serverSize].begin(); it != ite; ++it) 184 184 { 185 185 size_t sizeIndexEvent = CArray<int,1>::size(it->second.size()); … … 607 607 608 608 609 indSrv_[ client].swap(globalIndexAxisOnServer);609 indSrv_[nbServer].swap(globalIndexAxisOnServer); 610 610 611 611 if (distType==CServerDistributionDescription::ROOT_DISTRIBUTION) 612 612 { 613 for(int i=1; i<nbServer; ++i) indSrv_[ client].insert(pair<int, vector<size_t> >(i,indSrv_[client][0]) ) ;613 for(int i=1; i<nbServer; ++i) indSrv_[nbServer].insert(pair<int, vector<size_t> >(i,indSrv_[nbServer][0]) ) ; 614 614 serverZeroIndexLeader.clear() ; 615 615 } 616 616 617 CClientServerMapping::GlobalIndexMap::const_iterator it = indSrv_[ client].begin(),618 ite = indSrv_[ client].end();619 620 for (it = indSrv_[ client].begin(); it != ite; ++it) connectedServerRank_[client].push_back(it->first);617 CClientServerMapping::GlobalIndexMap::const_iterator it = indSrv_[nbServer].begin(), 618 ite = indSrv_[nbServer].end(); 619 620 for (it = indSrv_[nbServer].begin(); it != ite; ++it) connectedServerRank_[nbServer].push_back(it->first); 621 621 622 622 for (std::list<int>::const_iterator it = serverZeroIndexLeader.begin(); it != serverZeroIndexLeader.end(); ++it) 623 connectedServerRank_[ client].push_back(*it);623 connectedServerRank_[nbServer].push_back(*it); 624 624 625 625 // Even if a client has no index, it must connect to at least one server and 626 626 // send an "empty" data to this server 627 if (connectedServerRank_[client].empty()) 628 connectedServerRank_[client].push_back(client->clientRank % client->serverSize); 629 630 nbSenders[client] = CClientServerMapping::computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerRank_[client]); 627 if (connectedServerRank_[nbServer].empty()) 628 connectedServerRank_[nbServer].push_back(client->clientRank % client->serverSize); 629 630 // nbSenders[client] = CClientServerMapping::computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerRank_[client]); 631 nbSenders[nbServer] = CClientServerMapping::computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerRank_[nbServer]); 631 632 632 633 delete clientServerMap; … … 1091 1092 { 1092 1093 CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[p] : context->client; 1094 int nbServer = client->serverSize; 1093 1095 1094 1096 CEventClient eventData(getType(), EVENT_ID_DISTRIBUTED_ATTRIBUTES); … … 1111 1113 1112 1114 boost::unordered_map<int, std::vector<size_t> >::const_iterator it, iteMap; 1113 iteMap = indSrv_[ client].end();1114 for (int k = 0; k < connectedServerRank_[ client].size(); ++k)1115 iteMap = indSrv_[nbServer].end(); 1116 for (int k = 0; k < connectedServerRank_[nbServer].size(); ++k) 1115 1117 { 1116 1118 int nbData = 0; 1117 int rank = connectedServerRank_[ client][k];1118 it = indSrv_[ client].find(rank);1119 int rank = connectedServerRank_[nbServer][k]; 1120 it = indSrv_[nbServer].find(rank); 1119 1121 if (iteMap != it) 1120 1122 nbData = it->second.size(); … … 1182 1184 listData.back() << list_label.back(); 1183 1185 1184 eventData.push(rank, nbSenders[ client][rank], listData.back());1186 eventData.push(rank, nbSenders[nbServer][rank], listData.back()); 1185 1187 } 1186 1188 -
XIOS/dev/XIOS_DEV_CMIP6/src/node/axis.hpp
r1330 r1337 157 157 //! True if and only if the data defined on the axis can be outputted in a compressed way 158 158 bool isCompressible_; 159 std::map< CContextClient*, map<int,int> > nbSenders; // Mapping of number of communicating client to a server160 std::map< CContextClient*, boost::unordered_map<int, vector<size_t> > > indSrv_; // Global index of each client sent to server159 std::map<int, map<int,int> > nbSenders; // Mapping of number of communicating client to a server 160 std::map<int, boost::unordered_map<int, vector<size_t> > > indSrv_; // Global index of each client sent to server 161 161 // std::map<int, vector<int> > indWrittenSrv_; // Global written index of each client sent to server 162 162 boost::unordered_map<size_t,size_t> globalLocalIndexMap_; … … 164 164 std::map<int,int> numberWrittenIndexes_, totalNumberWrittenIndexes_, offsetWrittenIndexes_; 165 165 std::map<int, CArray<int, 1> > compressedIndexToWriteOnServer; 166 std::map< CContextClient*, std::vector<int> > connectedServerRank_;166 std::map<int, std::vector<int> > connectedServerRank_; 167 167 bool hasBounds; 168 168 bool hasLabel; -
XIOS/dev/XIOS_DEV_CMIP6/src/node/domain.cpp
r1336 r1337 45 45 , globalLocalIndexMap_(), computedWrittenIndex_(false) 46 46 { 47 47 } 48 48 49 49 CDomain::~CDomain(void) … … 147 147 } 148 148 149 boost::unordered_map<int, vector<size_t> >::const_iterator itIndexEnd = indSrv_[client ].end();149 boost::unordered_map<int, vector<size_t> >::const_iterator itIndexEnd = indSrv_[client->serverSize].end(); 150 150 // std::map<int, std::vector<int> >::const_iterator itWrittenIndexEnd = indWrittenSrv_.end(); 151 for (size_t k = 0; k < connectedServerRank_[client ].size(); ++k)152 { 153 int rank = connectedServerRank_[client ][k];154 boost::unordered_map<int, std::vector<size_t> >::const_iterator it = indSrv_[client ].find(rank);151 for (size_t k = 0; k < connectedServerRank_[client->serverSize].size(); ++k) 152 { 153 int rank = connectedServerRank_[client->serverSize][k]; 154 boost::unordered_map<int, std::vector<size_t> >::const_iterator it = indSrv_[client->serverSize].find(rank); 155 155 size_t idxCount = (it != itIndexEnd) ? it->second.size() : 0; 156 156 … … 635 635 void CDomain::AllgatherRectilinearLonLat(CArray<double,1>& lon, CArray<double,1>& lat, CArray<double,1>& lon_g, CArray<double,1>& lat_g) 636 636 { 637 637 CContext* context = CContext::getCurrent(); 638 638 // For now the assumption is that secondary server pools consist of the same number of procs. 639 639 // CHANGE the line below if the assumption changes. 640 640 CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[0] : context->client; 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 641 lon_g.resize(ni_glo) ; 642 lat_g.resize(nj_glo) ; 643 644 645 int* ibegin_g = new int[client->clientSize] ; 646 int* jbegin_g = new int[client->clientSize] ; 647 int* ni_g = new int[client->clientSize] ; 648 int* nj_g = new int[client->clientSize] ; 649 int v ; 650 v=ibegin ; 651 MPI_Allgather(&v,1,MPI_INT,ibegin_g,1,MPI_INT,client->intraComm) ; 652 v=jbegin ; 653 MPI_Allgather(&v,1,MPI_INT,jbegin_g,1,MPI_INT,client->intraComm) ; 654 v=ni ; 655 MPI_Allgather(&v,1,MPI_INT,ni_g,1,MPI_INT,client->intraComm) ; 656 v=nj ; 657 MPI_Allgather(&v,1,MPI_INT,nj_g,1,MPI_INT,client->intraComm) ; 658 659 MPI_Allgatherv(lon.dataFirst(),ni,MPI_DOUBLE,lon_g.dataFirst(),ni_g, ibegin_g,MPI_DOUBLE,client->intraComm) ; 660 MPI_Allgatherv(lat.dataFirst(),nj,MPI_DOUBLE,lat_g.dataFirst(),nj_g, jbegin_g,MPI_DOUBLE,client->intraComm) ; 661 661 662 662 delete[] ibegin_g ; … … 783 783 if (type == type_attr::gaussian) 784 784 { 785 786 787 788 789 785 hasPole=true ; 786 type.setValue(type_attr::unstructured) ; 787 } 788 else if (type == type_attr::rectilinear) hasPole=true ; 789 790 790 if (type == type_attr::unstructured) 791 791 { … … 1048 1048 else 1049 1049 { 1050 1051 1052 } 1050 domainMask.resize(mask_1d.numElements()); 1051 domainMask=mask_1d ; 1052 } 1053 1053 } 1054 1054 … … 1712 1712 CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[p] : context->client; 1713 1713 int nbServer = client->serverSize; 1714 int nbClient = client->clientSize; 1714 1715 int rank = client->clientRank; 1715 1716 bool doComputeGlobalIndexServer = true; 1716 1717 1717 int i,j,i_ind,j_ind, nbIndex, nbIndexZoom; 1718 int global_zoom_iend=global_zoom_ibegin+global_zoom_ni-1; 1719 int global_zoom_jend=global_zoom_jbegin+global_zoom_nj-1; 1720 1721 // Precompute number of index 1722 int globalIndexCountZoom = 0; 1723 nbIndex = i_index.numElements(); 1724 1725 if (doZoomByIndex_) 1726 { 1727 globalIndexCountZoom = zoom_i_index.numElements(); 1728 } 1729 else 1730 { 1731 for (i = 0; i < nbIndex; ++i) 1732 { 1733 i_ind=i_index(i); 1734 j_ind=j_index(i); 1735 1736 if (i_ind >= global_zoom_ibegin && i_ind <= global_zoom_iend && j_ind >= global_zoom_jbegin && j_ind <= global_zoom_jend) 1737 { 1738 ++globalIndexCountZoom; 1739 } 1740 } 1741 } 1742 1743 1744 // Fill in index 1745 CArray<size_t,1> globalIndexDomainZoom(globalIndexCountZoom); 1746 CArray<size_t,1> localIndexDomainZoom(globalIndexCountZoom); 1747 CArray<size_t,1> globalIndexDomain(nbIndex); 1748 size_t globalIndex; 1749 int globalIndexCount = 0; 1750 1751 for (i = 0; i < nbIndex; ++i) 1752 { 1753 i_ind=i_index(i); 1754 j_ind=j_index(i); 1755 globalIndex = i_ind + j_ind * ni_glo; 1756 globalIndexDomain(i) = globalIndex; 1757 } 1758 1759 if (globalLocalIndexMap_.empty()) 1760 { 1761 for (i = 0; i < nbIndex; ++i) 1762 globalLocalIndexMap_[globalIndexDomain(i)] = i; 1763 } 1764 1765 globalIndexCountZoom = 0; 1766 if (doZoomByIndex_) 1767 { 1768 int nbIndexZoom = zoom_i_index.numElements(); 1769 1770 for (i = 0; i < nbIndexZoom; ++i) 1771 { 1772 i_ind=zoom_i_index(i); 1773 j_ind=zoom_j_index(i); 1774 globalIndex = i_ind + j_ind * ni_glo; 1775 globalIndexDomainZoom(globalIndexCountZoom) = globalIndex; 1776 ++globalIndexCountZoom; 1777 } 1778 } 1779 else 1780 { 1781 int global_zoom_iend=global_zoom_ibegin+global_zoom_ni-1; 1782 int global_zoom_jend=global_zoom_jbegin+global_zoom_nj-1; 1783 for (i = 0; i < nbIndex; ++i) 1784 { 1718 if (indSrv_.find(nbServer) == indSrv_.end()) 1719 { 1720 int i,j,i_ind,j_ind, nbIndex, nbIndexZoom; 1721 int global_zoom_iend=global_zoom_ibegin+global_zoom_ni-1; 1722 int global_zoom_jend=global_zoom_jbegin+global_zoom_nj-1; 1723 1724 // Precompute number of index 1725 int globalIndexCountZoom = 0; 1726 nbIndex = i_index.numElements(); 1727 1728 if (doZoomByIndex_) 1729 { 1730 globalIndexCountZoom = zoom_i_index.numElements(); 1731 } 1732 else 1733 { 1734 for (i = 0; i < nbIndex; ++i) 1735 { 1736 i_ind=i_index(i); 1737 j_ind=j_index(i); 1738 1739 if (i_ind >= global_zoom_ibegin && i_ind <= global_zoom_iend && j_ind >= global_zoom_jbegin && j_ind <= global_zoom_jend) 1740 { 1741 ++globalIndexCountZoom; 1742 } 1743 } 1744 } 1745 1746 1747 // Fill in index 1748 CArray<size_t,1> globalIndexDomainZoom(globalIndexCountZoom); 1749 CArray<size_t,1> localIndexDomainZoom(globalIndexCountZoom); 1750 CArray<size_t,1> globalIndexDomain(nbIndex); 1751 size_t globalIndex; 1752 int globalIndexCount = 0; 1753 1754 for (i = 0; i < nbIndex; ++i) 1755 { 1785 1756 i_ind=i_index(i); 1786 1757 j_ind=j_index(i); 1787 1758 globalIndex = i_ind + j_ind * ni_glo; 1788 if (i_ind >= global_zoom_ibegin && i_ind <= global_zoom_iend && j_ind >= global_zoom_jbegin && j_ind <= global_zoom_jend) 1759 globalIndexDomain(i) = globalIndex; 1760 } 1761 1762 if (globalLocalIndexMap_.empty()) 1763 { 1764 for (i = 0; i < nbIndex; ++i) 1765 globalLocalIndexMap_[globalIndexDomain(i)] = i; 1766 } 1767 1768 globalIndexCountZoom = 0; 1769 if (doZoomByIndex_) 1770 { 1771 int nbIndexZoom = zoom_i_index.numElements(); 1772 1773 for (i = 0; i < nbIndexZoom; ++i) 1789 1774 { 1790 globalIndexDomainZoom(globalIndexCountZoom) = globalIndex; 1791 ++globalIndexCountZoom; 1775 i_ind=zoom_i_index(i); 1776 j_ind=zoom_j_index(i); 1777 globalIndex = i_ind + j_ind * ni_glo; 1778 globalIndexDomainZoom(globalIndexCountZoom) = globalIndex; 1779 ++globalIndexCountZoom; 1792 1780 } 1793 } 1794 1795 int iend = ibegin + ni -1; 1796 int jend = jbegin + nj -1; 1797 zoom_ibegin = global_zoom_ibegin > ibegin ? global_zoom_ibegin : ibegin; 1798 int zoom_iend = global_zoom_iend < iend ? zoom_iend : iend ; 1799 zoom_ni = zoom_iend-zoom_ibegin+1 ; 1800 1801 zoom_jbegin = global_zoom_jbegin > jbegin ? global_zoom_jbegin : jbegin ; 1802 int zoom_jend = global_zoom_jend < jend ? zoom_jend : jend; 1803 zoom_nj = zoom_jend-zoom_jbegin+1; 1804 } 1805 1806 1807 size_t globalSizeIndex = 1, indexBegin, indexEnd; 1808 int range, clientSize = client->clientSize; 1809 std::vector<int> nGlobDomain(2); 1810 nGlobDomain[0] = this->ni_glo; 1811 nGlobDomain[1] = this->nj_glo; 1812 for (int i = 0; i < nGlobDomain.size(); ++i) globalSizeIndex *= nGlobDomain[i]; 1813 indexBegin = 0; 1814 if (globalSizeIndex <= clientSize) 1815 { 1816 indexBegin = rank%globalSizeIndex; 1817 indexEnd = indexBegin; 1818 } 1819 else 1820 { 1821 for (int i = 0; i < clientSize; ++i) 1822 { 1823 range = globalSizeIndex / clientSize; 1824 if (i < (globalSizeIndex%clientSize)) ++range; 1825 if (i == client->clientRank) break; 1826 indexBegin += range; 1827 } 1828 indexEnd = indexBegin + range - 1; 1829 } 1830 1831 // Even if servers have no index, they must received something from client 1832 // We only use several client to send "empty" message to these servers 1833 CServerDistributionDescription serverDescription(nGlobDomain, nbServer); 1834 std::vector<int> serverZeroIndex; 1835 if (isUnstructed_) serverZeroIndex = serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t,size_t>(indexBegin, indexEnd), 0); 1836 else serverZeroIndex = serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t,size_t>(indexBegin, indexEnd), 1); 1837 1838 std::list<int> serverZeroIndexLeader; 1839 std::list<int> serverZeroIndexNotLeader; 1840 CContextClient::computeLeader(client->clientRank, client->clientSize, serverZeroIndex.size(), serverZeroIndexLeader, serverZeroIndexNotLeader); 1841 for (std::list<int>::iterator it = serverZeroIndexLeader.begin(); it != serverZeroIndexLeader.end(); ++it) 1842 *it = serverZeroIndex[*it]; 1843 1844 CClientServerMapping* clientServerMap = new CClientServerMappingDistributed(serverDescription.getGlobalIndexRange(), 1845 client->intraComm); 1846 clientServerMap->computeServerIndexMapping(globalIndexDomain, nbServer); 1847 CClientServerMapping::GlobalIndexMap& globalIndexDomainOnServer = clientServerMap->getGlobalIndexOnServer(); 1848 1849 CClientServerMapping::GlobalIndexMap::const_iterator it = globalIndexDomainOnServer.begin(), 1850 ite = globalIndexDomainOnServer.end(); 1851 indSrv_[client].swap(globalIndexDomainOnServer); 1852 connectedServerRank_[client].clear(); 1853 for (it = indSrv_[client].begin(); it != ite; ++it) 1854 connectedServerRank_[client].push_back(it->first); 1855 1856 for (std::list<int>::const_iterator it = serverZeroIndexLeader.begin(); it != serverZeroIndexLeader.end(); ++it) 1857 connectedServerRank_[client].push_back(*it); 1858 1859 // Even if a client has no index, it must connect to at least one server and 1860 // send an "empty" data to this server 1861 if (connectedServerRank_[client].empty()) 1862 connectedServerRank_[client].push_back(client->clientRank % client->serverSize); 1863 1864 nbSenders[client] = clientServerMap->computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerRank_[client]); 1865 1866 delete clientServerMap; 1781 } 1782 else 1783 { 1784 int global_zoom_iend=global_zoom_ibegin+global_zoom_ni-1; 1785 int global_zoom_jend=global_zoom_jbegin+global_zoom_nj-1; 1786 for (i = 0; i < nbIndex; ++i) 1787 { 1788 i_ind=i_index(i); 1789 j_ind=j_index(i); 1790 globalIndex = i_ind + j_ind * ni_glo; 1791 if (i_ind >= global_zoom_ibegin && i_ind <= global_zoom_iend && j_ind >= global_zoom_jbegin && j_ind <= global_zoom_jend) 1792 { 1793 globalIndexDomainZoom(globalIndexCountZoom) = globalIndex; 1794 ++globalIndexCountZoom; 1795 } 1796 } 1797 1798 int iend = ibegin + ni -1; 1799 int jend = jbegin + nj -1; 1800 zoom_ibegin = global_zoom_ibegin > ibegin ? global_zoom_ibegin : ibegin; 1801 int zoom_iend = global_zoom_iend < iend ? zoom_iend : iend ; 1802 zoom_ni = zoom_iend-zoom_ibegin+1 ; 1803 1804 zoom_jbegin = global_zoom_jbegin > jbegin ? global_zoom_jbegin : jbegin ; 1805 int zoom_jend = global_zoom_jend < jend ? zoom_jend : jend; 1806 zoom_nj = zoom_jend-zoom_jbegin+1; 1807 } 1808 1809 1810 size_t globalSizeIndex = 1, indexBegin, indexEnd; 1811 int range, clientSize = client->clientSize; 1812 std::vector<int> nGlobDomain(2); 1813 nGlobDomain[0] = this->ni_glo; 1814 nGlobDomain[1] = this->nj_glo; 1815 for (int i = 0; i < nGlobDomain.size(); ++i) globalSizeIndex *= nGlobDomain[i]; 1816 indexBegin = 0; 1817 if (globalSizeIndex <= clientSize) 1818 { 1819 indexBegin = rank%globalSizeIndex; 1820 indexEnd = indexBegin; 1821 } 1822 else 1823 { 1824 for (int i = 0; i < clientSize; ++i) 1825 { 1826 range = globalSizeIndex / clientSize; 1827 if (i < (globalSizeIndex%clientSize)) ++range; 1828 if (i == client->clientRank) break; 1829 indexBegin += range; 1830 } 1831 indexEnd = indexBegin + range - 1; 1832 } 1833 1834 // Even if servers have no index, they must received something from client 1835 // We only use several client to send "empty" message to these servers 1836 CServerDistributionDescription serverDescription(nGlobDomain, nbServer); 1837 std::vector<int> serverZeroIndex; 1838 if (isUnstructed_) serverZeroIndex = serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t,size_t>(indexBegin, indexEnd), 0); 1839 else serverZeroIndex = serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t,size_t>(indexBegin, indexEnd), 1); 1840 1841 std::list<int> serverZeroIndexLeader; 1842 std::list<int> serverZeroIndexNotLeader; 1843 CContextClient::computeLeader(client->clientRank, client->clientSize, serverZeroIndex.size(), serverZeroIndexLeader, serverZeroIndexNotLeader); 1844 for (std::list<int>::iterator it = serverZeroIndexLeader.begin(); it != serverZeroIndexLeader.end(); ++it) 1845 *it = serverZeroIndex[*it]; 1846 1847 CClientServerMapping* clientServerMap = new CClientServerMappingDistributed(serverDescription.getGlobalIndexRange(), 1848 client->intraComm); 1849 clientServerMap->computeServerIndexMapping(globalIndexDomain, nbServer); 1850 CClientServerMapping::GlobalIndexMap& globalIndexDomainOnServer = clientServerMap->getGlobalIndexOnServer(); 1851 1852 CClientServerMapping::GlobalIndexMap::const_iterator it = globalIndexDomainOnServer.begin(), 1853 ite = globalIndexDomainOnServer.end(); 1854 // indSrv_[client].swap(globalIndexDomainOnServer); 1855 // connectedServerRank_[client].clear(); 1856 // for (it = indSrv_[client].begin(); it != ite; ++it) 1857 // connectedServerRank_[client].push_back(it->first); 1858 indSrv_[nbServer].swap(globalIndexDomainOnServer); 1859 connectedServerRank_[nbServer].clear(); 1860 for (it = indSrv_[nbServer].begin(); it != ite; ++it) 1861 connectedServerRank_[nbServer].push_back(it->first); 1862 1863 for (std::list<int>::const_iterator it = serverZeroIndexLeader.begin(); it != serverZeroIndexLeader.end(); ++it) 1864 connectedServerRank_[nbServer].push_back(*it); 1865 1866 // Even if a client has no index, it must connect to at least one server and 1867 // send an "empty" data to this server 1868 if (connectedServerRank_[nbServer].empty()) 1869 connectedServerRank_[nbServer].push_back(client->clientRank % client->serverSize); 1870 1871 nbSenders[nbServer] = clientServerMap->computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerRank_[nbServer]); 1872 // if (connectedServerRank_[client].empty()) 1873 // connectedServerRank_[client].push_back(client->clientRank % client->serverSize); 1874 // 1875 // nbSenders[client] = clientServerMap->computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerRank_[client]); 1876 1877 delete clientServerMap; 1878 } 1867 1879 } 1868 1880 } … … 2060 2072 { 2061 2073 CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[p] : context->client; 2062 2074 int serverSize = client->serverSize; 2063 2075 CEventClient eventIndex(getType(), EVENT_ID_INDEX); 2064 2076 … … 2067 2079 2068 2080 boost::unordered_map<int, vector<size_t> >::const_iterator itIndex, iteIndex; 2069 iteIndex = indSrv_[ client].end();2070 for (int k = 0; k < connectedServerRank_[ client].size(); ++k)2081 iteIndex = indSrv_[serverSize].end(); 2082 for (int k = 0; k < connectedServerRank_[serverSize].size(); ++k) 2071 2083 { 2072 2084 int nbIndGlob = 0; 2073 int rank = connectedServerRank_[ client][k];2074 itIndex = indSrv_[ client].find(rank);2085 int rank = connectedServerRank_[serverSize][k]; 2086 itIndex = indSrv_[serverSize].find(rank); 2075 2087 if (iteIndex != itIndex) 2076 2088 nbIndGlob = itIndex->second.size(); … … 2089 2101 list_msgsIndex.back() << list_indGlob.back(); //list_indi.back() << list_indj.back(); 2090 2102 2091 eventIndex.push(rank, nbSenders[ client][rank], list_msgsIndex.back());2103 eventIndex.push(rank, nbSenders[serverSize][rank], list_msgsIndex.back()); 2092 2104 } 2093 2105 … … 2165 2177 { 2166 2178 CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[p] : context->client; 2179 int serverSize = client->serverSize; 2167 2180 2168 2181 // send area for each connected server … … 2173 2186 2174 2187 boost::unordered_map<int, vector<size_t> >::const_iterator it, iteMap; 2175 iteMap = indSrv_[ client].end();2176 for (int k = 0; k < connectedServerRank_[ client].size(); ++k)2188 iteMap = indSrv_[serverSize].end(); 2189 for (int k = 0; k < connectedServerRank_[serverSize].size(); ++k) 2177 2190 { 2178 2191 int nbData = 0; 2179 int rank = connectedServerRank_[ client][k];2180 it = indSrv_[ client].find(rank);2192 int rank = connectedServerRank_[serverSize][k]; 2193 it = indSrv_[serverSize].find(rank); 2181 2194 if (iteMap != it) 2182 2195 nbData = it->second.size(); … … 2192 2205 list_msgsMask.push_back(CMessage()); 2193 2206 list_msgsMask.back() << this->getId() << list_mask.back(); 2194 eventMask.push(rank, nbSenders[ client][rank], list_msgsMask.back());2207 eventMask.push(rank, nbSenders[serverSize][rank], list_msgsMask.back()); 2195 2208 } 2196 2209 client->sendEvent(eventMask); … … 2213 2226 { 2214 2227 CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[p] : context->client; 2228 int serverSize = client->serverSize; 2215 2229 2216 2230 // send area for each connected server … … 2221 2235 2222 2236 boost::unordered_map<int, vector<size_t> >::const_iterator it, iteMap; 2223 iteMap = indSrv_[ client].end();2224 for (int k = 0; k < connectedServerRank_[ client].size(); ++k)2237 iteMap = indSrv_[serverSize].end(); 2238 for (int k = 0; k < connectedServerRank_[serverSize].size(); ++k) 2225 2239 { 2226 2240 int nbData = 0; 2227 int rank = connectedServerRank_[ client][k];2228 it = indSrv_[ client].find(rank);2241 int rank = connectedServerRank_[serverSize][k]; 2242 it = indSrv_[serverSize].find(rank); 2229 2243 if (iteMap != it) 2230 2244 nbData = it->second.size(); … … 2241 2255 list_msgsArea.back() << this->getId() << hasArea; 2242 2256 list_msgsArea.back() << list_area.back(); 2243 eventArea.push(rank, nbSenders[ client][rank], list_msgsArea.back());2257 eventArea.push(rank, nbSenders[serverSize][rank], list_msgsArea.back()); 2244 2258 } 2245 2259 client->sendEvent(eventArea); … … 2264 2278 { 2265 2279 CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[p] : context->client; 2280 int serverSize = client->serverSize; 2266 2281 2267 2282 // send lon lat for each connected server … … 2274 2289 2275 2290 boost::unordered_map<int, vector<size_t> >::const_iterator it, iteMap; 2276 iteMap = indSrv_[ client].end();2277 for (int k = 0; k < connectedServerRank_[ client].size(); ++k)2291 iteMap = indSrv_[serverSize].end(); 2292 for (int k = 0; k < connectedServerRank_[serverSize].size(); ++k) 2278 2293 { 2279 2294 int nbData = 0; 2280 int rank = connectedServerRank_[ client][k];2281 it = indSrv_[ client].find(rank);2295 int rank = connectedServerRank_[serverSize][k]; 2296 it = indSrv_[serverSize].find(rank); 2282 2297 if (iteMap != it) 2283 2298 nbData = it->second.size(); … … 2336 2351 } 2337 2352 2338 eventLon.push(rank, nbSenders[ client][rank], list_msgsLon.back());2339 eventLat.push(rank, nbSenders[ client][rank], list_msgsLat.back());2353 eventLon.push(rank, nbSenders[serverSize][rank], list_msgsLon.back()); 2354 eventLat.push(rank, nbSenders[serverSize][rank], list_msgsLat.back()); 2340 2355 } 2341 2356 client->sendEvent(eventLon); … … 2360 2375 { 2361 2376 CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[p] : context->client; 2377 int serverSize = client->serverSize; 2362 2378 2363 2379 // send area for each connected server … … 2392 2408 2393 2409 boost::unordered_map<int, vector<size_t> >::const_iterator it, iteMap; 2394 iteMap = indSrv_[ client].end();2395 for (int k = 0; k < connectedServerRank_[ client].size(); ++k)2410 iteMap = indSrv_[serverSize].end(); 2411 for (int k = 0; k < connectedServerRank_[serverSize].size(); ++k) 2396 2412 { 2397 2413 int nbData = 0; 2398 int rank = connectedServerRank_[ client][k];2399 it = indSrv_[ client].find(rank);2414 int rank = connectedServerRank_[serverSize][k]; 2415 it = indSrv_[serverSize].find(rank); 2400 2416 if (iteMap != it) 2401 2417 nbData = it->second.size(); … … 2415 2431 list_msgsDataIndex.back() << this->getId(); 2416 2432 list_msgsDataIndex.back() << list_data_i_index.back() << list_data_j_index.back(); 2417 eventDataIndex.push(rank, nbSenders[ client][rank], list_msgsDataIndex.back());2433 eventDataIndex.push(rank, nbSenders[serverSize][rank], list_msgsDataIndex.back()); 2418 2434 } 2419 2435 client->sendEvent(eventDataIndex); -
XIOS/dev/XIOS_DEV_CMIP6/src/node/domain.hpp
r1330 r1337 205 205 bool isClientAfterTransformationChecked; 206 206 std::map<int, CArray<int,1> > indGlob_; 207 std::map<CContextClient*, map<int,int> > nbSenders; // Mapping of number of communicating client to a server 208 209 std::map<CContextClient*, boost::unordered_map<int, vector<size_t> > > indSrv_; // Global index of each client sent to server 207 std::map<int, map<int,int> > nbSenders; // Mapping of number of communicating client to a server 208 209 /** Global index of each client sent to server: map<serverSize, map<serverRank, indexes>> */ 210 std::map<int, boost::unordered_map<int, vector<size_t> > > indSrv_; 210 211 // std::map<CContextClient*, std::map<int, vector<int> > > indWrittenSrv_; // Global written index of each client sent to server 211 212 std::vector<int> indexesToWrite; … … 213 214 std::map<int,int> numberWrittenIndexes_, totalNumberWrittenIndexes_, offsetWrittenIndexes_; 214 215 std::map<int, CArray<int, 1> > compressedIndexToWriteOnServer; 215 std::map< CContextClient*, std::map<int,size_t> > connectedDataSize_;216 std::map< CContextClient*, std::vector<int> > connectedServerRank_;216 std::map<int, std::map<int,size_t> > connectedDataSize_; 217 std::map<int, std::vector<int> > connectedServerRank_; 217 218 218 219 //! True if and only if the data defined on the domain can be outputted in a compressed way
Note: See TracChangeset
for help on using the changeset viewer.