我的程序:

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

int main(int argc, char *argv[]) {
  int numprocs, rank, namelen;
  char processor_name[MPI_MAX_PROCESSOR_NAME];

  MPI_Init(&argc, &argv);
  MPI_Comm_size(MPI_COMM_WORLD, &numprocs);
  MPI_Comm_rank(MPI_COMM_WORLD, &rank);
  MPI_Get_processor_name(processor_name, &namelen);

  printf("Process %d on %s out of %d\n", rank, processor_name, numprocs);

  MPI_Finalize();
}

要运行的命令:
mpirun -np 2 -machinefile mach_list a.out

我发现了这些错误:
[noor-desktop:04209] [[50859,0],1]->[[50859,0],0] mca_oob_tcp_msg_send_handler: writev failed: Bad file descriptor (9) [sd = 9]
[noor-desktop:04209] [[50859,0],1]->[[50859,0],0] mca_oob_tcp_msg_send_handler: writev failed: Bad file descriptor (9) [sd = 9]
[noor-desktop:04209] [[50859,0],1] routed:binomial: Connection to lifeline [[50859,0],0] lost
[noor-desktop:04209] [[50859,0],1] routed:binomial: Connection to lifeline [[50859,0],0] lost

机器文件的内容是:
[email protected]
[email protected]没问题,我使用ssh登录,没有密码,因为我已经在那里复制了公钥。

最佳答案

看这个问题:MPI parallel program execution on single computer

08-27 09:51