【发布时间】:2016-11-02 19:11:02
【问题描述】:
我正在学习如何使用 OpenMPI 和 Fortran。通过使用 OpenMPI 文档,我尝试创建一个简单的客户端/服务器程序。但是,当我运行它时,我从客户端收到以下错误:
[Laptop:13402] [[54220,1],0] ORTE_ERROR_LOG: Not found in file dpm_orte.c at line 167
[Laptop:13402] *** An error occurred in MPI_Comm_connect
[Laptop:13402] *** reported by process [3553361921,0]
[Laptop:13402] *** on communicator MPI_COMM_WORLD
[Laptop:13402] *** MPI_ERR_INTERN: internal error
[Laptop:13402] *** MPI_ERRORS_ARE_FATAL (processes in this communicator will now abort,
[Laptop:13402] *** and potentially your MPI job)
-------------------------------------------------------
Primary job terminated normally, but 1 process returned
a non-zero exit code.. Per user-direction, the job has been aborted.
-------------------------------------------------------
--------------------------------------------------------------------------
mpiexec detected that one or more processes exited with non-zero status, thus causing
the job to be terminated. The first process to do so was:
Process name: [[54220,1],0]
Exit code: 17
--------------------------------------------------------------------------
服务端和客户端的代码如下:
server.f90
program name
use mpi
implicit none
! type declaration statements
INTEGER :: ierr, size, newcomm, loop, buf(255), status(MPI_STATUS_SIZE)
CHARACTER(MPI_MAX_PORT_NAME) :: port_name
! executable statements
call MPI_Init(ierr)
call MPI_Comm_size(MPI_COMM_WORLD, size, ierr)
call MPI_Open_port(MPI_INFO_NULL, port_name, ierr)
print *, "Port name is: ", port_name
do while (.true.)
call MPI_Comm_accept(port_name, MPI_INFO_NULL, 0, MPI_COMM_WORLD, newcomm, ierr)
loop = 1
do while (loop .eq. 1)
call MPI_Recv(buf, 255, MPI_INTEGER, MPI_ANY_SOURCE, MPI_ANY_TAG, newcomm, status, ierr)
print *, "Looping the loop."
loop = 0
enddo
call MPI_Comm_free(newcomm, ierr)
call MPI_Close_port(port_name, ierr)
call MPI_Finalize(ierr)
enddo
end program name
client.f90
program name
use mpi
implicit none
! type declaration statements
INTEGER :: ierr, buf(255), tag, newcomm
CHARACTER(MPI_MAX_PORT_NAME) :: port_name
LOGICAL :: done
! executable statements
call MPI_Init(ierr)
print *, "Please provide me with the port name: "
read(*,*) port_name
call MPI_Comm_connect(port_name, MPI_INFO_NULL, 0, MPI_COMM_WORLD, newcomm, ierr)
done = .false.
do while (.not. done)
tag = 0
call MPI_Send(buf, 255, MPI_INTEGER, 0, tag, newcomm, ierr)
done = .true.
enddo
call MPI_Send(buf, 0, MPI_INTEGER, 0, 1, newcomm, ierr)
call MPI_Comm_Disconnect(newcomm, ierr)
call MPI_Finalize(ierr)
end program name
我使用mpif90 server.f90 -o server.out 和mpif90 client.f90 -o client.out 编译并使用mpiexec -np 1 server.out 和mpiexec -np 1 client.out 运行程序。在向客户端提供端口名称时(即当我在read 之后按回车时)会发生错误。
which dpm_orte.c 返回dpm_orte.c not found
我正在运行 Linux,并从 Arch Extra 安装了 OpenMPI 1.10.3-1。
【问题讨论】:
-
@d_1999,我移动了 MPI_Finalize() 并尝试了,但问题仍然存在。