Ignore:
Timestamp:
10/25/23 11:40:07 (9 months ago)
Author:
jderouillat
Message:

Update the p2p protocol as a mirror protocol : the servers buffers will strictly mirror (number of buffers, positions of messages in the buffers) the clients buffers. The memory consumption of servers will be capped impplicitly by the clients behavior where the time spent to wait for free buffers could be present again.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS3/trunk/src/transport/p2p_server_buffer.hpp

    r2585 r2594  
    4646              if (start_-end_ >= size) 
    4747              { 
     48                //if (start!=end_) info(logProtocol)<<" CASE 0, recv/computed : " << start << "/" << end_ << endl; 
    4849                count=size ; 
    4950                size = 0 ; 
     
    5455              else 
    5556              { 
     57                // Server buffers get blocs from clients, they should not be splitted (mirrors the client buffers) 
     58                //if (start!=end_) info(logProtocol)<<" CASE 1"<< endl; 
     59                //info(logProtocol)<<" CASE 1 : start/end/count - size : "<< start_ << ", " << end_ << ", " << count_ << " " << size_ << " vs size " << size << endl; 
     60                ERROR("COneSidedServerBuffer::reserve()",<<"This should be the case of the 2nd part of a splitted message"<<std::endl); 
    5661                //count = start_-end_ ; 
    5762                //size -= count ; 
     
    6671              if (size_-end_ >= size) 
    6772              { 
     73                //if (start!=end_ ) info(logProtocol)<<" CASE 2, recv/computed : "<< start << "/" << end_ << endl; 
    6874                count = size ; 
    6975                size = 0; 
     
    7480              else 
    7581              { 
     82                // Server buffers get blocs from clients, they should not be splitted (mirrors the client buffers) 
     83                //     1st part of a splitted message, fill the end of the buffer 
     84                //     end_ must be set to 0 like on clients 
     85                //if (start!=end_) info(logProtocol)<<" CASE 3"<< endl; 
     86                //  info(logProtocol)<<" CASE 3 : start/end/count - size : "<< start_ << ", " << end_ << ", " << count_ << " " << size_ << " vs size " << size << endl; 
    7687                //count = size_ - end_ ; 
    7788                //size -= count ; 
    7889                //start=end_ ; 
    79                 //end_ = 0 ; 
     90                end_ = 0 ; 
    8091                //count_+= count ; 
    8192                count = 0 ; 
     
    94105          } 
    95106 
    96           size_t remain(void) { return size_-count_; } 
     107          size_t remain(void) { 
     108            if (count_==0) 
     109              return size_; 
     110            else if (end_<start_) 
     111              return start_-end_; 
     112            else 
     113              return size_-end_; 
     114          } 
    97115          size_t getSize(void) { return size_ ;} 
    98116          size_t getCount(void) {return count_ ;} 
     
    110128          while (!buffers_.empty()) { 
    111129              delete buffers_.front(); 
    112               buffers_.pop_front() ; // if buffer is empty free buffer 
     130              buffers_.erase(buffers_.begin()) ; // if buffer is empty free buffer 
     131              countDeletedBuffers_++; 
    113132          } 
    114133      }; 
     
    135154      void transferRmaRequest(size_t timeline, MPI_Aint addr, MPI_Aint offset, CBuffer* buffer, size_t start, int count, int window) ; 
    136155      size_t remainSize(void) ; 
     156      size_t remainSize(int bufferId) ; 
    137157 
    138158 
     
    144164      double bufferServerFactor_=1. ; 
    145165       
    146       std::list<CBuffer*> buffers_ ; 
     166      std::vector<CBuffer*> buffers_ ; 
    147167      CBuffer* currentBuffer_=nullptr ; 
    148168 
     
    151171 
    152172      map<size_t, int> nbSenders_ ; 
    153       map<size_t, list<tuple<MPI_Aint,int,int>>> pendingBlocs_; 
     173      map<size_t, list<tuple<MPI_Aint,int,int,size_t>>> pendingBlocs_; 
    154174      
    155175      vector<MPI_Request> pendingRmaRequests_ ; 
     
    176196      const int windowRank_=0 ; 
    177197      MPI_Aint lastBlocToFree_=0 ; 
     198      int countDeletedBuffers_; 
    178199 
    179200  } ; 
Note: See TracChangeset for help on using the changeset viewer.