Changeset 1030 for XIOS/dev/dev_olga/src/node/domain.cpp
- Timestamp:
- 01/20/17 16:17:57 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_olga/src/node/domain.cpp
r1027 r1030 1442 1442 CContext* context = CContext::getCurrent(); 1443 1443 // Use correct context client to send message 1444 int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1; 1444 // int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1; 1445 int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 0) : 1; 1445 1446 for (int i = 0; i < nbSrvPools; ++i) 1446 1447 { 1447 1448 CContextClient* contextClientTmp = (context->hasServer) ? context->clientPrimServer[i] 1448 1449 : context->client; 1449 1450 int nbServer = contextClientTmp->serverSize; 1450 std::vector<int> nGlobDomain(2);1451 nGlobDomain[0] = this->ni_glo;1452 nGlobDomain[1] = this->nj_glo;1453 1454 CServerDistributionDescription serverDescription(nGlobDomain, nbServer);1451 std::vector<int> nGlobDomain(2); 1452 nGlobDomain[0] = this->ni_glo; 1453 nGlobDomain[1] = this->nj_glo; 1454 1455 CServerDistributionDescription serverDescription(nGlobDomain, nbServer); 1455 1456 if (isUnstructed_) serverDescription.computeServerDistribution(false, 0); 1456 1457 else serverDescription.computeServerDistribution(false, 1); … … 1495 1496 { 1496 1497 CContext* context=CContext::getCurrent() ; 1497 int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1; 1498 // int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1; 1499 int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 0) : 1; 1498 1500 for (int i = 0; i < nbSrvPools; ++i) 1499 1501 { … … 1666 1668 for (it = globalIndexDomainOnServer.begin(); it != ite; ++it) { 1667 1669 connectedServerRank_.push_back(it->first); 1670 // std::vector<size_t> vec = it->second; 1671 // std::sort(vec.begin(), vec.end()); 1672 // indSrv_[it->first] = vec; 1668 1673 } 1669 1674 … … 1710 1715 int ns, n, i, j, ind, nv, idx; 1711 1716 CContext* context = CContext::getCurrent(); 1712 int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1; 1717 // int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1; 1718 int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 0) : 1; 1713 1719 for (int i = 0; i < nbSrvPools; ++i) 1714 1720 { … … 1780 1786 int ns, n, i, j, ind, nv, idx; 1781 1787 CContext* context = CContext::getCurrent(); 1782 int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1; 1788 // int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1; 1789 int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 0) : 1; 1783 1790 for (int i = 0; i < nbSrvPools; ++i) 1784 1791 { … … 1826 1833 int ns, n, i, j, ind, nv, idx; 1827 1834 CContext* context = CContext::getCurrent(); 1828 int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1; 1835 // int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1; 1836 int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 0) : 1; 1829 1837 for (int i = 0; i < nbSrvPools; ++i) 1830 1838 { … … 1875 1883 int ns, n, i, j, ind, nv, idx; 1876 1884 CContext* context = CContext::getCurrent(); 1877 int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1; 1885 // int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1; 1886 int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 0) : 1; 1878 1887 for (int i = 0; i < nbSrvPools; ++i) 1879 1888 { … … 1960 1969 int ns, n, i, j, ind, nv, idx; 1961 1970 CContext* context = CContext::getCurrent(); 1962 int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1; 1971 // int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1; 1972 int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 0) : 1; 1963 1973 for (int i = 0; i < nbSrvPools; ++i) 1964 1974 { … … 2150 2160 { 2151 2161 index = tmp(ind); 2152 i_index(nbIndGlob) = index /ni_glo;2153 j_index(nbIndGlob) = index %ni_glo;2162 i_index(nbIndGlob) = index % ni_glo; 2163 j_index(nbIndGlob) = index / ni_glo; 2154 2164 ++nbIndGlob; 2155 2165 } … … 2172 2182 { 2173 2183 index = tmp(ind); 2174 zoom_i_index(nbZoomInd) = index /ni_glo;2175 zoom_j_index(nbZoomInd) = index %ni_glo;2184 zoom_i_index(nbZoomInd) = index % ni_glo; 2185 zoom_j_index(nbZoomInd) = index / ni_glo; 2176 2186 ++nbZoomInd; 2177 2187 } … … 2201 2211 count_write_index_[0] = nbIZoom; 2202 2212 count_write_index_[1] = nbJZoom; 2213 2214 // Reoder the zoom_index 2215 for (int j = 0; j < nbJZoom; ++j) 2216 for (int i = 0; i < nbIZoom; ++i) 2217 { 2218 idx = nbIZoom * j + i; 2219 if (idx < ni_zoom) 2220 { 2221 zoom_i_index(idx) = ibegin + i; 2222 zoom_j_index(idx) = jbegin + j; 2223 } 2224 } 2225 2226 // Reorder the global index 2227 for (int j = 0; j < nj; ++j) 2228 for (int i = 0; i < ni; ++i) 2229 { 2230 idx = ni * j + i; 2231 if (idx < nbIndGlob) 2232 { 2233 i_index(idx) = ibegin + i; 2234 j_index(idx) = jbegin + j; 2235 } 2236 } 2203 2237 } 2204 2238
Note: See TracChangeset
for help on using the changeset viewer.