Changeset 2309
- Timestamp:
- 03/14/22 14:33:17 (3 years ago)
- Location:
- XIOS/dev/dev_ym/XIOS_COUPLING/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_COUPLING/src/buffer_server.cpp
r2246 r2309 156 156 first=0 ; 157 157 count-- ; 158 used-- ; 158 159 end=size ; 159 160 } … … 182 183 ERROR("void CServerBuffer::freeBuffer(size_t count)", 183 184 <<"cannot free required size in buffer") ; 185 } 186 } 187 used-=count ; 188 } 189 190 void CServerBuffer::popBuffer(size_t count) 191 { 192 if (count==0) return ; 193 194 if (current==0) 195 { 196 current = end ; 197 end=size ; 198 } 199 200 201 if (first<=current) 202 { 203 if (current-count >first) 204 { 205 current-=count ; 206 } 207 else 208 { 209 ERROR("void CServerBuffer::popBuffer(size_t count)", 210 <<"cannot pop required size in buffer") ; 211 } 212 213 } 214 else 215 { 216 if (current-count>=0) 217 { 218 current-=count ; 219 } 220 else 221 { 222 ERROR("void CServerBuffer::freeBuffer(size_t count)", 223 <<"cannot pop required size in buffer") ; 184 224 } 185 225 } -
XIOS/dev/dev_ym/XIOS_COUPLING/src/buffer_server.hpp
r2273 r2309 20 20 void* getBuffer(size_t count) ; 21 21 void freeBuffer(size_t count) ; 22 void popBuffer(size_t count) ; 22 23 void createWindows(MPI_Comm oneSidedComm) ; 23 24 bool getBufferFromClient(size_t timeLine, char* & buffer, size_t& count) ; … … 28 29 void notifyClientFinalize(void) ; 29 30 void notifyBufferResizing(void) ; 31 size_t getUsed(void) { return used ;} 30 32 private: 31 33 char* buffer; -
XIOS/dev/dev_ym/XIOS_COUPLING/src/context_server.cpp
r2307 r2309 305 305 buffers[rank]->notifyBufferResizing() ; 306 306 buffers[rank]->updateCurrentWindows() ; 307 buffers[rank]->freeBuffer(count) ; 308 info(100)<<"Context id "<<context->getId()<<" : Receive NotifyChangeBufferSize from client rank "<<rank<<endl ; 307 buffers[rank]->popBuffer(count) ; 308 info(100)<<"Context id "<<context->getId()<<" : Receive NotifyChangeBufferSize from client rank "<<rank<<endl 309 <<"isBufferEmpty ? "<<buffers[rank]->isBufferEmpty()<<" remaining count : "<<buffers[rank]->getUsed()<<endl; 309 310 } 310 311 else if (timeLine==timelineEventChangeBufferSize)
Note: See TracChangeset
for help on using the changeset viewer.