Changeset 1600


Ignore:
Timestamp:
11/19/18 11:53:54 (17 months ago)
Author:
oabramkina
Message:

Dev: removing traces of sending mask on domain and axis.

Location:
XIOS/dev/dev_olga/src/node
Files:
3 edited

Legend:

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

    r1589 r1600  
    11441144    int nbReceived = ranks.size(), idx, ind, gloInd, locInd; 
    11451145    vector<CArray<int,1> > vec_indi(nbReceived), vec_dataInd(nbReceived); 
    1146     vector<CArray<bool,1> > vec_mask(nbReceived); 
    11471146    vector<CArray<double,1> > vec_val(nbReceived); 
    11481147    vector<CArray<double,2> > vec_bounds(nbReceived); 
  • XIOS/dev/dev_olga/src/node/domain.cpp

    r1597 r1600  
    19981998    sendDistributionAttributes(); 
    19991999    sendIndex();        
    2000 //    sendMask(); 
    20012000    sendLonLat(); 
    20022001    sendArea();     
     
    21052104 
    21062105  /*! 
    2107     Send mask index from client to connected(s) clients     
    2108   */ 
    2109   void CDomain::sendMask() 
    2110   { 
    2111     int ns, n, i, j, ind, nv, idx; 
    2112     std::list<CContextClient*>::iterator it; 
    2113     for (it=clients.begin(); it!=clients.end(); ++it) 
    2114     { 
    2115       CContextClient* client = *it; 
    2116       int serverSize = client->serverSize; 
    2117  
    2118       // send area for each connected server 
    2119       CEventClient eventMask(getType(), EVENT_ID_MASK); 
    2120  
    2121       list<CMessage> list_msgsMask; 
    2122       list<CArray<bool,1> > list_mask; 
    2123  
    2124       std::unordered_map<int, vector<size_t> >::const_iterator it, iteMap; 
    2125       iteMap = indSrv_[serverSize].end(); 
    2126       for (int k = 0; k < connectedServerRank_[serverSize].size(); ++k) 
    2127       { 
    2128         int nbData = 0; 
    2129         int rank = connectedServerRank_[serverSize][k]; 
    2130         it = indSrv_[serverSize].find(rank); 
    2131         if (iteMap != it) 
    2132           nbData = it->second.size(); 
    2133         list_mask.push_back(CArray<bool,1>(nbData)); 
    2134  
    2135         const std::vector<size_t>& temp = it->second; 
    2136         for (n = 0; n < nbData; ++n) 
    2137         { 
    2138           idx = static_cast<int>(it->second[n]); 
    2139           list_mask.back()(n) = domainMask(globalLocalIndexMap_[idx]); 
    2140         } 
    2141  
    2142         list_msgsMask.push_back(CMessage()); 
    2143         list_msgsMask.back() << this->getId() << list_mask.back(); 
    2144         eventMask.push(rank, nbSenders[serverSize][rank], list_msgsMask.back()); 
    2145       } 
    2146       client->sendEvent(eventMask); 
    2147     } 
    2148   } 
    2149  
    2150   /*! 
    21512106    Send area from client to connected client(s) 
    21522107  */ 
     
    23802335        case EVENT_ID_INDEX: 
    23812336          recvIndex(event); 
    2382           return true; 
    2383           break; 
    2384         case EVENT_ID_MASK: 
    2385           recvMask(event); 
    23862337          return true; 
    23872338          break; 
     
    25302481 
    25312482  /*! 
    2532     Receive area event from clients(s) 
    2533     \param[in] event event contain info about rank and associated area 
    2534   */ 
    2535   void CDomain::recvMask(CEventServer& event) 
    2536   { 
    2537     string domainId; 
    2538     std::map<int, CBufferIn*> rankBuffers; 
    2539  
    2540     list<CEventServer::SSubEvent>::iterator it; 
    2541     for (it = event.subEvents.begin(); it != event.subEvents.end(); ++it) 
    2542     {       
    2543       CBufferIn* buffer = it->buffer; 
    2544       *buffer >> domainId; 
    2545       rankBuffers[it->rank] = buffer;      
    2546     } 
    2547     get(domainId)->recvMask(rankBuffers); 
    2548   } 
    2549  
    2550  
    2551   /*! 
    2552     Receive mask information from client(s) 
    2553     \param[in] rankBuffers rank of sending client and the corresponding receive buffer   
    2554   */ 
    2555   void CDomain::recvMask(std::map<int, CBufferIn*>& rankBuffers) 
    2556   { 
    2557     int nbReceived = rankBuffers.size(), i, ind, index, lInd; 
    2558     if (nbReceived != recvClientRanks_.size()) 
    2559       ERROR("void CDomain::recvMask(std::map<int, CBufferIn*>& rankBuffers)", 
    2560            << "The number of sending clients is not correct." 
    2561            << "Expected number: " << recvClientRanks_.size() << " but received " << nbReceived); 
    2562  
    2563     vector<CArray<bool,1> > recvMaskValue(nbReceived);       
    2564     for (i = 0; i < recvClientRanks_.size(); ++i) 
    2565     { 
    2566       int rank = recvClientRanks_[i]; 
    2567       CBufferIn& buffer = *(rankBuffers[rank]);       
    2568       buffer >> recvMaskValue[i]; 
    2569     } 
    2570  
    2571     int nbMaskInd = 0; 
    2572     for (i = 0; i < nbReceived; ++i) 
    2573     { 
    2574       nbMaskInd += recvMaskValue[i].numElements(); 
    2575     } 
    2576    
    2577     if (nbMaskInd != globalLocalIndexMap_.size()) 
    2578       info (0) << "If domain " << this->getDomainOutputName() <<" does not have overlapped regions between processes " 
    2579                << "something must be wrong with mask index "<< std::endl; 
    2580  
    2581     nbMaskInd = globalLocalIndexMap_.size(); 
    2582     mask_1d.resize(nbMaskInd); 
    2583     domainMask.resize(nbMaskInd); 
    2584     mask_1d = false; 
    2585      
    2586     for (i = 0; i < nbReceived; ++i) 
    2587     { 
    2588       CArray<int,1>& tmpInd = indGlob_[recvClientRanks_[i]]; 
    2589       CArray<bool,1>& tmp = recvMaskValue[i]; 
    2590       for (ind = 0; ind < tmp.numElements(); ++ind) 
    2591       { 
    2592         lInd = globalLocalIndexMap_[size_t(tmpInd(ind))]; 
    2593         if (!mask_1d(lInd)) // Only rewrite mask_1d if it's not true 
    2594           mask_1d(lInd) = tmp(ind); 
    2595       } 
    2596     } 
    2597     domainMask=mask_1d ; 
    2598   } 
    2599  
    2600   /*! 
    26012483    Receive longitude event from clients(s) 
    26022484    \param[in] event event contain info about rank and associated longitude 
  • XIOS/dev/dev_olga/src/node/domain.hpp

    r1589 r1600  
    4949         { 
    5050           EVENT_ID_INDEX, EVENT_ID_LON, EVENT_ID_LAT,  
    51            EVENT_ID_AREA, EVENT_ID_MASK, 
     51           EVENT_ID_AREA, 
    5252           EVENT_ID_DATA_INDEX, EVENT_ID_SERVER_ATTRIBUT 
    5353         } ; 
     
    175175         void sendIndex(); 
    176176         void sendDistributionAttributes(); 
    177          void sendMask(); 
    178177         void sendArea(); 
    179178         void sendLonLat();          
     
    186185         static void recvDistributionAttributes(CEventServer& event); 
    187186         static void recvIndex(CEventServer& event); 
    188          static void recvMask(CEventServer& event);          
    189187         static void recvLon(CEventServer& event); 
    190188         static void recvLat(CEventServer& event); 
     
    193191         void recvDistributionAttributes(CBufferIn& buffer);                   
    194192         void recvIndex(std::map<int, CBufferIn*>& rankBuffers);          
    195          void recvMask(std::map<int, CBufferIn*>& rankBuffers); 
    196193         void recvLon(std::map<int, CBufferIn*>& rankBuffers); 
    197194         void recvLat(std::map<int, CBufferIn*>& rankBuffers); 
Note: See TracChangeset for help on using the changeset viewer.