MPI_Finalize(); // 结束 MPI 执行环境
return 0;
}
其中,MPI_SEND(buf, count, datatype, dest, tag, comm) 是发送消息的...MPI_RECV(buf, count, datatype, source, tag, comm, status) 是(阻塞)接收消息的 API。...status 用来接收更多信息,可以用 MPI_STATUS_IGNORE 如果我们不需要更多信息。...进阶一些:
// 非阻塞发送。...非阻塞接收为 MPI_Irecv,具体说明可以用 man 命令查询.
int MPI_Isend(const void *buf, int count, MPI_Datatype datatype, int