0
是否有boost::MPI
等效於以下C MPI代碼?我試圖移植下面的標準MPI代碼,它是一個基本的主從模板,找到here。在boost mpi文檔之後,只有3個參數,用於mpi_send或mpi_recv等級,標記和緩衝區。提升mpi相當於狀態.MPI_SOURCE
while (work != NULL) {
/* Receive results from a slave */
MPI_Recv(&result, /* message buffer */
1, /* one data item */
MPI_INT, /* of type double real */
MPI_ANY_SOURCE, /* receive from any sender */
MPI_ANY_TAG, /* any type of message */
MPI_COMM_WORLD, /* default communicator */
&status); /* info about the received message */
/* Send the slave a new work unit */
MPI_Send(&work, /* message buffer */
1, /* one data item */
MPI_INT, /* data item is an integer */
status.MPI_SOURCE, /* to who we just received from */
WORKTAG, /* user chosen message tag */
MPI_COMM_WORLD); /* default communicator */
/* Get the next unit of work to be done */
work = get_next_work_item();
}