Ignore:
Timestamp:
01/20/17 16:17:57 (7 years ago)
Author:
oabramkina
Message:

dev: intermediate commit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_olga/src/node/domain.cpp

    r1027 r1030  
    14421442    CContext* context = CContext::getCurrent(); 
    14431443     // 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; 
    14451446    for (int i = 0; i < nbSrvPools; ++i) 
    14461447    { 
    1447        CContextClient* contextClientTmp = (context->hasServer) ? context->clientPrimServer[i] 
     1448      CContextClient* contextClientTmp = (context->hasServer) ? context->clientPrimServer[i] 
    14481449                                                                         : context->client;     
    14491450      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); 
    14551456      if (isUnstructed_) serverDescription.computeServerDistribution(false, 0); 
    14561457      else serverDescription.computeServerDistribution(false, 1); 
     
    14951496  { 
    14961497    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; 
    14981500    for (int i = 0; i < nbSrvPools; ++i) 
    14991501    { 
     
    16661668      for (it = globalIndexDomainOnServer.begin(); it != ite; ++it) { 
    16671669        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; 
    16681673      } 
    16691674 
     
    17101715    int ns, n, i, j, ind, nv, idx; 
    17111716    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; 
    17131719    for (int i = 0; i < nbSrvPools; ++i) 
    17141720    { 
     
    17801786    int ns, n, i, j, ind, nv, idx; 
    17811787    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; 
    17831790    for (int i = 0; i < nbSrvPools; ++i) 
    17841791    { 
     
    18261833    int ns, n, i, j, ind, nv, idx; 
    18271834    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; 
    18291837    for (int i = 0; i < nbSrvPools; ++i) 
    18301838    { 
     
    18751883    int ns, n, i, j, ind, nv, idx; 
    18761884    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; 
    18781887    for (int i = 0; i < nbSrvPools; ++i) 
    18791888    { 
     
    19601969    int ns, n, i, j, ind, nv, idx; 
    19611970    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; 
    19631973    for (int i = 0; i < nbSrvPools; ++i) 
    19641974    { 
     
    21502160      { 
    21512161         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; 
    21542164         ++nbIndGlob; 
    21552165      }  
     
    21722182      { 
    21732183         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; 
    21762186         ++nbZoomInd; 
    21772187      }  
     
    22012211        count_write_index_[0] = nbIZoom; 
    22022212        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          }          
    22032237      } 
    22042238             
Note: See TracChangeset for help on using the changeset viewer.