Changeset 2594 for XIOS3/trunk/src/transport/p2p_server_buffer.hpp
- Timestamp:
- 10/25/23 11:40:07 (9 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS3/trunk/src/transport/p2p_server_buffer.hpp
r2585 r2594 46 46 if (start_-end_ >= size) 47 47 { 48 //if (start!=end_) info(logProtocol)<<" CASE 0, recv/computed : " << start << "/" << end_ << endl; 48 49 count=size ; 49 50 size = 0 ; … … 54 55 else 55 56 { 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); 56 61 //count = start_-end_ ; 57 62 //size -= count ; … … 66 71 if (size_-end_ >= size) 67 72 { 73 //if (start!=end_ ) info(logProtocol)<<" CASE 2, recv/computed : "<< start << "/" << end_ << endl; 68 74 count = size ; 69 75 size = 0; … … 74 80 else 75 81 { 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; 76 87 //count = size_ - end_ ; 77 88 //size -= count ; 78 89 //start=end_ ; 79 //end_ = 0 ;90 end_ = 0 ; 80 91 //count_+= count ; 81 92 count = 0 ; … … 94 105 } 95 106 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 } 97 115 size_t getSize(void) { return size_ ;} 98 116 size_t getCount(void) {return count_ ;} … … 110 128 while (!buffers_.empty()) { 111 129 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_++; 113 132 } 114 133 }; … … 135 154 void transferRmaRequest(size_t timeline, MPI_Aint addr, MPI_Aint offset, CBuffer* buffer, size_t start, int count, int window) ; 136 155 size_t remainSize(void) ; 156 size_t remainSize(int bufferId) ; 137 157 138 158 … … 144 164 double bufferServerFactor_=1. ; 145 165 146 std:: list<CBuffer*> buffers_ ;166 std::vector<CBuffer*> buffers_ ; 147 167 CBuffer* currentBuffer_=nullptr ; 148 168 … … 151 171 152 172 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_; 154 174 155 175 vector<MPI_Request> pendingRmaRequests_ ; … … 176 196 const int windowRank_=0 ; 177 197 MPI_Aint lastBlocToFree_=0 ; 198 int countDeletedBuffers_; 178 199 179 200 } ;
Note: See TracChangeset
for help on using the changeset viewer.