相关疑难解决方法(0)

如何使用MPI发送和接收字符串

我正在尝试使用MPI发送和接收字符串,但结果是无跳的.

发送功能:

MPI_Send(&result, result.size(), MPI_CHAR, 0, 0, MPI_COMM_WORLD);
Run Code Online (Sandbox Code Playgroud)

和recv功能:

    MPI_Recv(&result,      /* message buffer */
        128,                 /* one data item */
        MPI_CHAR,        /* of type char 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 */
Run Code Online (Sandbox Code Playgroud)

结果是字符串.

我没有得到任何错误,但程序不想完成.

c c++ mpi

3
推荐指数
1
解决办法
1万
查看次数

标签 统计

c ×1

c++ ×1

mpi ×1