如何在mpi中运行c代码:无法连接到本地mpd(/tmp/mpd2.console\u karim);可能的原因?

如何在mpi中运行c代码:无法连接到本地mpd(/tmp/mpd2.console\u karim);可能的原因?,c,mpi,ubuntu-18.04,C,Mpi,Ubuntu 18.04,无法在使用ubuntu的终端上运行用c编写的mpi代码 karim@karim:~/Desktop/greetings$ mpicc main.c -o test karim@karim:~/Desktop/greetings$ mpirun -np 3 test mpiexec_karim: cannot connect to local mpd (/tmp/mpd2.console_karim); possible causes: 1. no mpd is running on this

无法在使用ubuntu的终端上运行用c编写的mpi代码

karim@karim:~/Desktop/greetings$ mpicc main.c -o test
karim@karim:~/Desktop/greetings$ mpirun -np 3 test
mpiexec_karim: cannot connect to local mpd (/tmp/mpd2.console_karim); 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.
For more details on starting mpds on a set of hosts, see
the MPICH2 Installation Guide.


搜索之后,我用这个代码解决了这个问题

mpd --ncpus=2 &
mpirun -np 2 --host localhost ./try.exe

搜索之后,我用这个代码解决了这个问题

mpd --ncpus=2 &
mpirun -np 2 --host localhost ./try.exe
mpd --ncpus=2 &
mpirun -np 2 --host localhost ./try.exe