Ignore:
Timestamp:
04/17/20 18:55:28 (4 years ago)
Author:
ymipsl
Message:

Some update on XIOS_COUPLING branch...

YM

File:
1 edited

Legend:

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

    r1869 r1870  
    20852085  CATCH_DUMP_ATTR 
    20862086 
     2087  void CDomain::sendDomainToFileServer(CContextClient* client) 
     2088  { 
     2089    if (sendDomainToFileServer_done_.count(client)!=0) return ; 
     2090    else sendDomainToFileServer_done_.insert(client) ; 
     2091 
     2092    StdString domDefRoot("domain_definition"); 
     2093    CDomainGroup* domPtr = CDomainGroup::get(domDefRoot); 
     2094    domPtr->sendCreateChild(this->getId(), client); 
     2095    this->sendAllAttributesToServer(client)  ; 
     2096    this->sendDistributionAttributes(client);    
     2097    this->sendIndex(client);        
     2098    this->sendLonLat(client); 
     2099    this->sendArea(client);     
     2100    this->sendDataIndex(client); 
     2101  } 
     2102 
    20872103  /*! 
    20882104    Send all attributes from client to connected clients 
    20892105    The attributes will be rebuilt on receiving side 
    20902106  */ 
     2107  // ym obsolete to be removed 
    20912108  void CDomain::sendAttributes() 
    20922109  TRY 
    20932110  { 
    2094     sendDistributionAttributes(); 
    2095     sendIndex();        
    2096     sendLonLat(); 
    2097     sendArea();     
    2098     sendDataIndex(); 
     2111    //sendDistributionAttributes(); 
     2112    //sendIndex();        
     2113    //sendLonLat(); 
     2114    //sendArea();     
     2115    //sendDataIndex(); 
    20992116  } 
    21002117  CATCH 
     
    21022119    Send global index from client to connected client(s) 
    21032120  */ 
    2104   void CDomain::sendIndex() 
     2121  void CDomain::sendIndex(CContextClient* client) 
    21052122  TRY 
    21062123  { 
    21072124    int ns, n, i, j, ind, nv, idx; 
    2108     std::list<CContextClient*>::iterator it; 
    2109     for (it=clients.begin(); it!=clients.end(); ++it) 
     2125    
     2126    int serverSize = client->serverSize; 
     2127    CEventClient eventIndex(getType(), EVENT_ID_INDEX); 
     2128 
     2129    list<CMessage> list_msgsIndex; 
     2130    list<CArray<int,1> > list_indGlob; 
     2131 
     2132    std::unordered_map<int, vector<size_t> >::const_iterator itIndex, iteIndex; 
     2133    iteIndex = indSrv_[serverSize].end(); 
     2134    for (int k = 0; k < connectedServerRank_[serverSize].size(); ++k) 
    21102135    { 
    2111       CContextClient* client = *it; 
    2112  
    2113       int serverSize = client->serverSize; 
    2114       CEventClient eventIndex(getType(), EVENT_ID_INDEX); 
    2115  
    2116       list<CMessage> list_msgsIndex; 
    2117       list<CArray<int,1> > list_indGlob; 
    2118  
    2119       std::unordered_map<int, vector<size_t> >::const_iterator itIndex, iteIndex; 
    2120       iteIndex = indSrv_[serverSize].end(); 
    2121       for (int k = 0; k < connectedServerRank_[serverSize].size(); ++k) 
    2122       { 
    2123         int nbIndGlob = 0; 
    2124         int rank = connectedServerRank_[serverSize][k]; 
    2125         itIndex = indSrv_[serverSize].find(rank); 
    2126         if (iteIndex != itIndex) 
    2127           nbIndGlob = itIndex->second.size(); 
    2128  
    2129         list_indGlob.push_back(CArray<int,1>(nbIndGlob));         
    2130  
    2131         CArray<int,1>& indGlob = list_indGlob.back(); 
    2132         for (n = 0; n < nbIndGlob; ++n) 
    2133         { 
    2134           indGlob(n) = static_cast<int>(itIndex->second[n]); 
    2135         } 
    2136  
    2137         list_msgsIndex.push_back(CMessage()); 
    2138         list_msgsIndex.back() << this->getId() << (int)type; // enum ne fonctionne pour les message => ToFix 
    2139         list_msgsIndex.back() << isCurvilinear; 
    2140         list_msgsIndex.back() << list_indGlob.back(); //list_indi.back() << list_indj.back(); 
     2136      int nbIndGlob = 0; 
     2137      int rank = connectedServerRank_[serverSize][k]; 
     2138      itIndex = indSrv_[serverSize].find(rank); 
     2139      if (iteIndex != itIndex) 
     2140        nbIndGlob = itIndex->second.size(); 
     2141 
     2142      list_indGlob.push_back(CArray<int,1>(nbIndGlob));         
     2143 
     2144      CArray<int,1>& indGlob = list_indGlob.back(); 
     2145      for (n = 0; n < nbIndGlob; ++n) indGlob(n) = static_cast<int>(itIndex->second[n]); 
     2146 
     2147      list_msgsIndex.push_back(CMessage()); 
     2148      list_msgsIndex.back() << this->getId() << (int)type; // enum ne fonctionne pour les message => ToFix 
     2149      list_msgsIndex.back() << isCurvilinear; 
     2150      list_msgsIndex.back() << list_indGlob.back(); //list_indi.back() << list_indj.back(); 
    21412151        
    2142         eventIndex.push(rank, nbSenders[serverSize][rank], list_msgsIndex.back()); 
    2143       } 
    2144  
    2145       client->sendEvent(eventIndex); 
    2146     } 
     2152      eventIndex.push(rank, nbSenders[serverSize][rank], list_msgsIndex.back()); 
     2153    } 
     2154    client->sendEvent(eventIndex); 
    21472155  } 
    21482156  CATCH_DUMP_ATTR 
     
    21532161    it calculates this distribution then sends it to the corresponding clients on the next level 
    21542162  */ 
    2155   void CDomain::sendDistributionAttributes(void) 
     2163  void CDomain::sendDistributionAttributes(CContextClient* client) 
    21562164  TRY 
    21572165  { 
    2158     std::list<CContextClient*>::iterator it; 
    2159     for (it=clients.begin(); it!=clients.end(); ++it) 
     2166    int nbServer = client->serverSize; 
     2167    std::vector<int> nGlobDomain(2); 
     2168    nGlobDomain[0] = this->ni_glo; 
     2169    nGlobDomain[1] = this->nj_glo; 
     2170 
     2171    CServerDistributionDescription serverDescription(nGlobDomain, nbServer); 
     2172    if (isUnstructed_) serverDescription.computeServerDistribution(false, 0); 
     2173    else serverDescription.computeServerDistribution(false, 1); 
     2174 
     2175    std::vector<std::vector<int> > serverIndexBegin = serverDescription.getServerIndexBegin(); 
     2176    std::vector<std::vector<int> > serverDimensionSizes = serverDescription.getServerDimensionSizes(); 
     2177 
     2178    CEventClient event(getType(),EVENT_ID_SERVER_ATTRIBUT); 
     2179    if (client->isServerLeader()) 
    21602180    { 
    2161       CContextClient* client = *it; 
    2162       int nbServer = client->serverSize; 
    2163       std::vector<int> nGlobDomain(2); 
    2164       nGlobDomain[0] = this->ni_glo; 
    2165       nGlobDomain[1] = this->nj_glo; 
    2166  
    2167       CServerDistributionDescription serverDescription(nGlobDomain, nbServer); 
    2168       if (isUnstructed_) serverDescription.computeServerDistribution(false, 0); 
    2169       else serverDescription.computeServerDistribution(false, 1); 
    2170  
    2171       std::vector<std::vector<int> > serverIndexBegin = serverDescription.getServerIndexBegin(); 
    2172       std::vector<std::vector<int> > serverDimensionSizes = serverDescription.getServerDimensionSizes(); 
    2173  
    2174       CEventClient event(getType(),EVENT_ID_SERVER_ATTRIBUT); 
    2175       if (client->isServerLeader()) 
    2176       { 
    2177         std::list<CMessage> msgs; 
    2178  
    2179         const std::list<int>& ranks = client->getRanksServerLeader(); 
    2180         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 
    2181         { 
    2182           // Use const int to ensure CMessage holds a copy of the value instead of just a reference 
    2183           const int ibegin_srv = serverIndexBegin[*itRank][0]; 
    2184           const int jbegin_srv = serverIndexBegin[*itRank][1]; 
    2185           const int ni_srv = serverDimensionSizes[*itRank][0]; 
    2186           const int nj_srv = serverDimensionSizes[*itRank][1]; 
    2187  
    2188           msgs.push_back(CMessage()); 
    2189           CMessage& msg = msgs.back(); 
    2190           msg << this->getId() ; 
    2191           msg << isUnstructed_; 
    2192           msg << ni_srv << ibegin_srv << nj_srv << jbegin_srv; 
    2193           msg << ni_glo.getValue() << nj_glo.getValue(); 
    2194           msg << isCompressible_; 
    2195  
    2196           event.push(*itRank,1,msg); 
    2197         } 
    2198         client->sendEvent(event); 
    2199       } 
    2200       else client->sendEvent(event); 
    2201     } 
     2181      std::list<CMessage> msgs; 
     2182 
     2183      const std::list<int>& ranks = client->getRanksServerLeader(); 
     2184      for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 
     2185      { 
     2186        // Use const int to ensure CMessage holds a copy of the value instead of just a reference 
     2187        const int ibegin_srv = serverIndexBegin[*itRank][0]; 
     2188        const int jbegin_srv = serverIndexBegin[*itRank][1]; 
     2189        const int ni_srv = serverDimensionSizes[*itRank][0]; 
     2190        const int nj_srv = serverDimensionSizes[*itRank][1]; 
     2191 
     2192        msgs.push_back(CMessage()); 
     2193        CMessage& msg = msgs.back(); 
     2194        msg << this->getId() ; 
     2195        msg << isUnstructed_; 
     2196        msg << ni_srv << ibegin_srv << nj_srv << jbegin_srv; 
     2197        msg << ni_glo.getValue() << nj_glo.getValue(); 
     2198        msg << isCompressible_; 
     2199 
     2200        event.push(*itRank,1,msg); 
     2201      } 
     2202      client->sendEvent(event); 
     2203    } 
     2204    else client->sendEvent(event); 
    22022205  } 
    22032206  CATCH_DUMP_ATTR 
     
    22062209    Send area from client to connected client(s) 
    22072210  */ 
    2208   void CDomain::sendArea() 
     2211  void CDomain::sendArea(CContextClient* client) 
    22092212  TRY 
    22102213  { 
     
    22122215 
    22132216    int ns, n, i, j, ind, nv, idx; 
    2214     std::list<CContextClient*>::iterator it; 
    2215  
    2216     for (it=clients.begin(); it!=clients.end(); ++it) 
     2217    int serverSize = client->serverSize; 
     2218 
     2219    // send area for each connected server 
     2220    CEventClient eventArea(getType(), EVENT_ID_AREA); 
     2221 
     2222    list<CMessage> list_msgsArea; 
     2223    list<CArray<double,1> > list_area; 
     2224 
     2225    std::unordered_map<int, vector<size_t> >::const_iterator it, iteMap; 
     2226    iteMap = indSrv_[serverSize].end(); 
     2227    for (int k = 0; k < connectedServerRank_[serverSize].size(); ++k) 
    22172228    { 
    2218       CContextClient* client = *it; 
    2219       int serverSize = client->serverSize; 
    2220  
    2221       // send area for each connected server 
    2222       CEventClient eventArea(getType(), EVENT_ID_AREA); 
    2223  
    2224       list<CMessage> list_msgsArea; 
    2225       list<CArray<double,1> > list_area; 
    2226  
    2227       std::unordered_map<int, vector<size_t> >::const_iterator it, iteMap; 
    2228       iteMap = indSrv_[serverSize].end(); 
    2229       for (int k = 0; k < connectedServerRank_[serverSize].size(); ++k) 
    2230       { 
    2231         int nbData = 0; 
    2232         int rank = connectedServerRank_[serverSize][k]; 
    2233         it = indSrv_[serverSize].find(rank); 
    2234         if (iteMap != it) 
    2235           nbData = it->second.size(); 
    2236         list_area.push_back(CArray<double,1>(nbData)); 
    2237  
    2238         const std::vector<size_t>& temp = it->second; 
    2239         for (n = 0; n < nbData; ++n) 
    2240         { 
    2241           idx = static_cast<int>(it->second[n]); 
    2242           list_area.back()(n) = areavalue(globalLocalIndexMap_[idx]); 
    2243         } 
    2244  
    2245         list_msgsArea.push_back(CMessage()); 
    2246         list_msgsArea.back() << this->getId() << hasArea; 
    2247         list_msgsArea.back() << list_area.back(); 
    2248         eventArea.push(rank, nbSenders[serverSize][rank], list_msgsArea.back()); 
    2249       } 
    2250       client->sendEvent(eventArea); 
    2251     } 
     2229      int nbData = 0; 
     2230      int rank = connectedServerRank_[serverSize][k]; 
     2231      it = indSrv_[serverSize].find(rank); 
     2232      if (iteMap != it) 
     2233        nbData = it->second.size(); 
     2234      list_area.push_back(CArray<double,1>(nbData)); 
     2235 
     2236      const std::vector<size_t>& temp = it->second; 
     2237      for (n = 0; n < nbData; ++n) 
     2238      { 
     2239        idx = static_cast<int>(it->second[n]); 
     2240        list_area.back()(n) = areavalue(globalLocalIndexMap_[idx]); 
     2241      } 
     2242 
     2243      list_msgsArea.push_back(CMessage()); 
     2244      list_msgsArea.back() << this->getId() << hasArea; 
     2245      list_msgsArea.back() << list_area.back(); 
     2246      eventArea.push(rank, nbSenders[serverSize][rank], list_msgsArea.back()); 
     2247    } 
     2248    client->sendEvent(eventArea); 
    22522249  } 
    22532250  CATCH_DUMP_ATTR 
     
    22582255    Because longitude and latitude are optional, this function only called if latitude and longitude exist 
    22592256  */ 
    2260   void CDomain::sendLonLat() 
     2257  void CDomain::sendLonLat(CContextClient* client) 
    22612258  TRY 
    22622259  { 
     
    22642261 
    22652262    int ns, n, i, j, ind, nv, idx; 
    2266     std::list<CContextClient*>::iterator it; 
    2267     for (it=clients.begin(); it!=clients.end(); ++it) 
     2263    int serverSize = client->serverSize; 
     2264 
     2265    // send lon lat for each connected server 
     2266    CEventClient eventLon(getType(), EVENT_ID_LON); 
     2267    CEventClient eventLat(getType(), EVENT_ID_LAT); 
     2268 
     2269    list<CMessage> list_msgsLon, list_msgsLat; 
     2270    list<CArray<double,1> > list_lon, list_lat; 
     2271    list<CArray<double,2> > list_boundslon, list_boundslat; 
     2272 
     2273    std::unordered_map<int, vector<size_t> >::const_iterator it, iteMap; 
     2274    iteMap = indSrv_[serverSize].end(); 
     2275    for (int k = 0; k < connectedServerRank_[serverSize].size(); ++k) 
    22682276    { 
    2269       CContextClient* client = *it; 
    2270       int serverSize = client->serverSize; 
    2271  
    2272       // send lon lat for each connected server 
    2273       CEventClient eventLon(getType(), EVENT_ID_LON); 
    2274       CEventClient eventLat(getType(), EVENT_ID_LAT); 
    2275  
    2276       list<CMessage> list_msgsLon, list_msgsLat; 
    2277       list<CArray<double,1> > list_lon, list_lat; 
    2278       list<CArray<double,2> > list_boundslon, list_boundslat; 
    2279  
    2280       std::unordered_map<int, vector<size_t> >::const_iterator it, iteMap; 
    2281       iteMap = indSrv_[serverSize].end(); 
    2282       for (int k = 0; k < connectedServerRank_[serverSize].size(); ++k) 
    2283       { 
    2284         int nbData = 0; 
    2285         int rank = connectedServerRank_[serverSize][k]; 
    2286         it = indSrv_[serverSize].find(rank); 
    2287         if (iteMap != it) 
    2288           nbData = it->second.size(); 
    2289  
    2290         list_lon.push_back(CArray<double,1>(nbData)); 
    2291         list_lat.push_back(CArray<double,1>(nbData)); 
     2277      int nbData = 0; 
     2278      int rank = connectedServerRank_[serverSize][k]; 
     2279      it = indSrv_[serverSize].find(rank); 
     2280      if (iteMap != it) 
     2281        nbData = it->second.size(); 
     2282 
     2283      list_lon.push_back(CArray<double,1>(nbData)); 
     2284      list_lat.push_back(CArray<double,1>(nbData)); 
     2285 
     2286      if (hasBounds) 
     2287      { 
     2288        list_boundslon.push_back(CArray<double,2>(nvertex, nbData)); 
     2289        list_boundslat.push_back(CArray<double,2>(nvertex, nbData)); 
     2290      } 
     2291 
     2292      CArray<double,1>& lon = list_lon.back(); 
     2293      CArray<double,1>& lat = list_lat.back(); 
     2294      const std::vector<size_t>& temp = it->second; 
     2295      for (n = 0; n < nbData; ++n) 
     2296      { 
     2297        idx = static_cast<int>(it->second[n]); 
     2298        int localInd = globalLocalIndexMap_[idx]; 
     2299        lon(n) = lonvalue(localInd); 
     2300        lat(n) = latvalue(localInd); 
    22922301 
    22932302        if (hasBounds) 
    22942303        { 
    2295           list_boundslon.push_back(CArray<double,2>(nvertex, nbData)); 
    2296           list_boundslat.push_back(CArray<double,2>(nvertex, nbData)); 
    2297         } 
    2298  
    2299         CArray<double,1>& lon = list_lon.back(); 
    2300         CArray<double,1>& lat = list_lat.back(); 
    2301         const std::vector<size_t>& temp = it->second; 
    2302         for (n = 0; n < nbData; ++n) 
    2303         { 
    2304           idx = static_cast<int>(it->second[n]); 
    2305           int localInd = globalLocalIndexMap_[idx]; 
    2306           lon(n) = lonvalue(localInd); 
    2307           lat(n) = latvalue(localInd); 
    2308  
    2309           if (hasBounds) 
     2304          CArray<double,2>& boundslon = list_boundslon.back(); 
     2305          CArray<double,2>& boundslat = list_boundslat.back(); 
     2306 
     2307          for (nv = 0; nv < nvertex; ++nv) 
    23102308          { 
    2311             CArray<double,2>& boundslon = list_boundslon.back(); 
    2312             CArray<double,2>& boundslat = list_boundslat.back(); 
    2313  
    2314             for (nv = 0; nv < nvertex; ++nv) 
    2315             { 
    2316               boundslon(nv, n) = bounds_lonvalue(nv, localInd); 
    2317               boundslat(nv, n) = bounds_latvalue(nv, localInd); 
    2318             } 
     2309            boundslon(nv, n) = bounds_lonvalue(nv, localInd); 
     2310            boundslat(nv, n) = bounds_latvalue(nv, localInd); 
    23192311          } 
    23202312        } 
    2321  
    2322         list_msgsLon.push_back(CMessage()); 
    2323         list_msgsLat.push_back(CMessage()); 
    2324  
    2325         list_msgsLon.back() << this->getId() << hasLonLat; 
    2326         if (hasLonLat)  
    2327           list_msgsLon.back() << list_lon.back(); 
    2328         list_msgsLon.back()  << hasBounds; 
    2329         if (hasBounds) 
    2330         { 
    2331           list_msgsLon.back() << list_boundslon.back(); 
    2332         } 
    2333  
    2334         list_msgsLat.back() << this->getId() << hasLonLat; 
    2335         if (hasLonLat) 
    2336           list_msgsLat.back() << list_lat.back(); 
    2337         list_msgsLat.back() << hasBounds; 
    2338         if (hasBounds) 
    2339         {           
    2340           list_msgsLat.back() << list_boundslat.back(); 
    2341         } 
    2342  
    2343         eventLon.push(rank, nbSenders[serverSize][rank], list_msgsLon.back()); 
    2344         eventLat.push(rank, nbSenders[serverSize][rank], list_msgsLat.back()); 
    2345       } 
    2346       client->sendEvent(eventLon); 
    2347       client->sendEvent(eventLat); 
    2348     } 
     2313      } 
     2314 
     2315      list_msgsLon.push_back(CMessage()); 
     2316      list_msgsLat.push_back(CMessage()); 
     2317 
     2318      list_msgsLon.back() << this->getId() << hasLonLat; 
     2319      if (hasLonLat)  
     2320        list_msgsLon.back() << list_lon.back(); 
     2321      list_msgsLon.back()  << hasBounds; 
     2322      if (hasBounds) 
     2323      { 
     2324        list_msgsLon.back() << list_boundslon.back(); 
     2325      } 
     2326 
     2327      list_msgsLat.back() << this->getId() << hasLonLat; 
     2328      if (hasLonLat) 
     2329        list_msgsLat.back() << list_lat.back(); 
     2330      list_msgsLat.back() << hasBounds; 
     2331      if (hasBounds) 
     2332      {           
     2333        list_msgsLat.back() << list_boundslat.back(); 
     2334      } 
     2335 
     2336      eventLon.push(rank, nbSenders[serverSize][rank], list_msgsLon.back()); 
     2337      eventLat.push(rank, nbSenders[serverSize][rank], list_msgsLat.back()); 
     2338    } 
     2339    client->sendEvent(eventLon); 
     2340    client->sendEvent(eventLat); 
    23492341  } 
    23502342  CATCH_DUMP_ATTR 
     
    23562348    The compressed index are represented with 1 and others are represented with -1 
    23572349  */ 
    2358   void CDomain::sendDataIndex() 
     2350  void CDomain::sendDataIndex(CContextClient* client) 
    23592351  TRY 
    23602352  { 
    23612353    int ns, n, i, j, ind, nv, idx; 
    2362     std::list<CContextClient*>::iterator it; 
    2363     for (it=clients.begin(); it!=clients.end(); ++it) 
     2354    int serverSize = client->serverSize; 
     2355 
     2356    // send area for each connected server 
     2357    CEventClient eventDataIndex(getType(), EVENT_ID_DATA_INDEX); 
     2358 
     2359    list<CMessage> list_msgsDataIndex; 
     2360    list<CArray<int,1> > list_data_i_index, list_data_j_index; 
     2361 
     2362    int nbIndex = i_index.numElements(); 
     2363    int niByIndex = max(i_index) - min(i_index) + 1; 
     2364    int njByIndex = max(j_index) - min(j_index) + 1;  
     2365    int dataIindexBound = (1 == data_dim) ? (niByIndex * njByIndex) : niByIndex; 
     2366    int dataJindexBound = (1 == data_dim) ? (niByIndex * njByIndex) : njByIndex; 
     2367 
     2368     
     2369    CArray<int,1> dataIIndex(nbIndex), dataJIndex(nbIndex); 
     2370    dataIIndex = -1;  
     2371    dataJIndex = -1; 
     2372    ind = 0; 
     2373 
     2374    for (idx = 0; idx < data_i_index.numElements(); ++idx) 
    23642375    { 
    2365       CContextClient* client = *it; 
    2366  
    2367       int serverSize = client->serverSize; 
    2368  
    2369       // send area for each connected server 
    2370       CEventClient eventDataIndex(getType(), EVENT_ID_DATA_INDEX); 
    2371  
    2372       list<CMessage> list_msgsDataIndex; 
    2373       list<CArray<int,1> > list_data_i_index, list_data_j_index; 
    2374  
    2375       int nbIndex = i_index.numElements(); 
    2376       int niByIndex = max(i_index) - min(i_index) + 1; 
    2377       int njByIndex = max(j_index) - min(j_index) + 1;  
    2378       int dataIindexBound = (1 == data_dim) ? (niByIndex * njByIndex) : niByIndex; 
    2379       int dataJindexBound = (1 == data_dim) ? (niByIndex * njByIndex) : njByIndex; 
    2380  
    2381        
    2382       CArray<int,1> dataIIndex(nbIndex), dataJIndex(nbIndex); 
    2383       dataIIndex = -1;  
    2384       dataJIndex = -1; 
    2385       ind = 0; 
    2386  
    2387       for (idx = 0; idx < data_i_index.numElements(); ++idx) 
    2388       { 
    2389         int dataIidx = data_i_index(idx) + data_ibegin; 
    2390         int dataJidx = data_j_index(idx) + data_jbegin; 
    2391         if ((0 <= dataIidx) && (dataIidx < dataIindexBound) && 
    2392             (0 <= dataJidx) && (dataJidx < dataJindexBound)) 
    2393         { 
    2394           dataIIndex((1 == data_dim) ? dataIidx : dataJidx * ni + dataIidx) = 1; //i_index(dataIidx);//dataIidx; 
    2395           dataJIndex((1 == data_dim) ? dataIidx : dataJidx * ni + dataIidx) = 1; //j_index(dataJidx);//           
    2396         } 
    2397       } 
    2398  
    2399       std::unordered_map<int, vector<size_t> >::const_iterator it, iteMap; 
    2400       iteMap = indSrv_[serverSize].end(); 
    2401       for (int k = 0; k < connectedServerRank_[serverSize].size(); ++k) 
    2402       { 
    2403         int nbData = 0; 
    2404         int rank = connectedServerRank_[serverSize][k]; 
    2405         it = indSrv_[serverSize].find(rank); 
    2406         if (iteMap != it) 
    2407           nbData = it->second.size(); 
    2408         list_data_i_index.push_back(CArray<int,1>(nbData)); 
    2409         list_data_j_index.push_back(CArray<int,1>(nbData)); 
    2410  
    2411         const std::vector<size_t>& temp = it->second; 
    2412         for (n = 0; n < nbData; ++n) 
    2413         { 
    2414           idx = static_cast<int>(it->second[n]); 
    2415           i = globalLocalIndexMap_[idx]; 
    2416           list_data_i_index.back()(n) = dataIIndex(i); 
    2417           list_data_j_index.back()(n) = dataJIndex(i); 
    2418         } 
    2419  
    2420         list_msgsDataIndex.push_back(CMessage()); 
    2421         list_msgsDataIndex.back() << this->getId(); 
    2422         list_msgsDataIndex.back() << list_data_i_index.back() << list_data_j_index.back(); 
    2423         eventDataIndex.push(rank, nbSenders[serverSize][rank], list_msgsDataIndex.back()); 
    2424       } 
    2425       client->sendEvent(eventDataIndex); 
    2426     } 
     2376      int dataIidx = data_i_index(idx) + data_ibegin; 
     2377      int dataJidx = data_j_index(idx) + data_jbegin; 
     2378      if ((0 <= dataIidx) && (dataIidx < dataIindexBound) && 
     2379          (0 <= dataJidx) && (dataJidx < dataJindexBound)) 
     2380      { 
     2381        dataIIndex((1 == data_dim) ? dataIidx : dataJidx * ni + dataIidx) = 1; //i_index(dataIidx);//dataIidx; 
     2382        dataJIndex((1 == data_dim) ? dataIidx : dataJidx * ni + dataIidx) = 1; //j_index(dataJidx);//           
     2383      } 
     2384    } 
     2385 
     2386    std::unordered_map<int, vector<size_t> >::const_iterator it, iteMap; 
     2387    iteMap = indSrv_[serverSize].end(); 
     2388    for (int k = 0; k < connectedServerRank_[serverSize].size(); ++k) 
     2389    { 
     2390      int nbData = 0; 
     2391      int rank = connectedServerRank_[serverSize][k]; 
     2392      it = indSrv_[serverSize].find(rank); 
     2393      if (iteMap != it) 
     2394        nbData = it->second.size(); 
     2395      list_data_i_index.push_back(CArray<int,1>(nbData)); 
     2396      list_data_j_index.push_back(CArray<int,1>(nbData)); 
     2397 
     2398      const std::vector<size_t>& temp = it->second; 
     2399      for (n = 0; n < nbData; ++n) 
     2400      { 
     2401        idx = static_cast<int>(it->second[n]); 
     2402        i = globalLocalIndexMap_[idx]; 
     2403        list_data_i_index.back()(n) = dataIIndex(i); 
     2404        list_data_j_index.back()(n) = dataJIndex(i); 
     2405      } 
     2406 
     2407      list_msgsDataIndex.push_back(CMessage()); 
     2408      list_msgsDataIndex.back() << this->getId(); 
     2409      list_msgsDataIndex.back() << list_data_i_index.back() << list_data_j_index.back(); 
     2410      eventDataIndex.push(rank, nbSenders[serverSize][rank], list_msgsDataIndex.back()); 
     2411    } 
     2412    client->sendEvent(eventDataIndex); 
    24272413  } 
    24282414  CATCH 
Note: See TracChangeset for help on using the changeset viewer.