99 重用同一缓冲区

BACKWARD FORWARD


考虑一个循环

MPI_Buffer_attach( buf, bufsize ); 
while (!done) { 
    ... 
    MPI_Bsend( ... ); 
    } 
其中,在MPI_Bsend中buf足够大以容纳消息。这个代码会失败,因为
{ 
void *buf; int bufsize; 
MPI_Buffer_detach( &buf, &bufsize ); 
MPI_Buffer_attach( buf, bufsize ); 
} 


Copyright: NPACT BACKWARD FORWARD