Reusing the same buffer


Up: Buffering issues Next: Other Point-to-Point Features Previous: Buffered Send

Consider a loop

MPI_Buffer_attach( buf, bufsize ); 
while (!done) { 
    ... 
    MPI_Bsend( ... ); 
    } 
where the buf is large enough to hold the message in the MPI_Bsend. This code may fail because the
{ 
void *buf; int bufsize; 
MPI_Buffer_detach( &buf, &bufsize ); 
MPI_Buffer_attach( buf, bufsize ); 
} 



Up: Buffering issues Next: Other Point-to-Point Features Previous: Buffered Send