c++ - 在四核处理器上运行 MPICH 时出错

标签 c++ mpi

我试图运行以下 MPI 代码,但遇到了如下所示的错误。如果有人能帮助我,我将不胜感激。

#include <mpi.h>
#include <stdio.h>

int main(){
    int rank, size;

    MPI_Init(NULL, NULL);

//  MPI_Comm_rank(MPI_COMM_WORLD, &rank);
//  MPI_Comm_size(MPI_COMM_WORLD, &size);

//  printf("Hello from %d of %d\n", rank, size);

    MPI_Finalize();

    return 0;
}

错误:

$ mpirun -np 4 ./a.out
mpiexec_ubuntu: cannot connect to local mpd (/tmp/mpd2.console_joseph); possible causes:
  1. no mpd is running on this host
  2. an mpd is running but was started without a "console" (-n option)
In case 1, you can start an mpd on this host with:
    mpd &
and you will be able to run jobs just on this host.

最佳答案

只需按照错误消息中的说明进行操作:在命令行上运行 mpd&。

我强烈建议您尽可能使用 OpenMPI 而不是 MPICH。

关于c++ - 在四核处理器上运行 MPICH 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5923731/

相关文章:

C++ std::set 排序不适用于客户类*

c++ - 如何对指向 int* 数组元素的 int** 数组进行排序

c++ - MPI_File_write_at() 是否用零初始化文件?

c - 非阻塞点对点通信中发送模式对 MPI 开销的影响

linux - 安装 mpich2 总是安装我 mpich

c++ - 将三位值存储到 unsigned char 数组

c++ - boost库应该依赖于结构成员对齐吗?

c++ - 查找相邻节点 A Star Path-Finding C++

c++ - MPI_Send 到在同一进程上运行的多个 POSIX 线程

c - MPI:程序工作取决于进程数