boost mpi等效于status.mpi\u源

boost mpi等效于status.mpi\u源,mpi,boost-mpi,Mpi,Boost Mpi,是否存在与以下C MPI代码等价的boost::MPI?我正在尝试移植以下标准MPI代码,这是一个基本的主从模板。根据boost mpi文档,对于mpi_发送或mpi_recv秩、标记和缓冲区,只有3个参数 while (work != NULL) { /* Receive results from a slave */ MPI_Recv(&result, /* message buffer */ 1,

是否存在与以下C MPI代码等价的
boost::MPI
?我正在尝试移植以下标准MPI代码,这是一个基本的主从模板。根据boost mpi文档,对于mpi_发送或mpi_recv秩、标记和缓冲区,只有3个参数

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();
  }
从:

  • MPI\u任意源
    变为
    ANY\u源
  • MPI\u任意标签
    变为
    ANY\u标签
communicator::recv()
方法返回类的实例,该类提供您所需的所有信息:

  • status.MPI\u SOURCE
    status::SOURCE()返回
  • status.MPI\u标记
    status::TAG()返回
它还提供了两个cast操作符将其内容转换为
MPI\u状态
结构