C中的MPI缓冲区通信

时间:2018-07-16 15:57:44

标签: c buffer mpi

int SIZE, bsize;
SIZE = 6;

/*the space needed to send data with the number of SIZE and type of MPI_DOUBLE*/
MPI_Pack_size( SIZE, MPI_DOUBLE, MPI_COMM_WORLD, &bsize ); 

/*the space needed for MPI_Bsend*/
tmpbuffer = (double *) malloc( bsize + 2*MPI_BSEND_OVERHEAD );

MPI_Buffer_attach( tmpbuffer, bsize + MPI_BSEND_OVERHEAD );

我的问题是:

(1)为tmpbuffer分配的内存为bsize + 2*MPI_BSEND_OVERHEAD,当涉及MPI_Buffer_attach时,为什么其大小更改为bsize + MPI_BSEND_OVERHEAD

(2)“ MPI_BSEND_OVERHEAD”是什么意思?为何要按2计时?

0 个答案:

没有答案