【问题标题】:MPI_Recv is not receiving the entire messageMPI_Recv 没有收到整个消息
【发布时间】:2012-08-20 23:09:48
【问题描述】:

在 MPI_Recv 之后,仅填充数组的第一个索引,其余元素保持为 '0'。当我在发送之前打印数组时,元素非零。但是收到后,除了第一个,其他都是零。

我已经检查了数组的大小和数据类型。

【问题讨论】:

  • 如果没有看到您的代码,恐怕帮不了您。
  • 是的,请提供代码。
  • 我认为问题在于您在第 42 行缺少一对大括号。

标签: mpi distributed-computing


【解决方案1】:

检查 MPI_Recv 中的 'count' 参数是否正确指示正在发送和接收的数组的总元素。当我准确地指定数组中的元素数量时,我遇到了同样的问题。这是语法: int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Status *status)

【讨论】:

    猜你喜欢
    • 2020-12-14
    • 2017-09-01
    • 1970-01-01
    • 2015-09-28
    • 1970-01-01
    • 2011-09-07
    • 2017-10-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多