Ich bin dabei zu lernen, wie OpenMPI und Fortran zu verwenden. Mit Hilfe der OpenMPI-Dokumentation habe ich versucht, ein einfaches Client/Server-Programm zu erstellen. Allerdings, wenn ich es laufen lasse, bekomme ich folgende Fehlermeldung von dem Client:"ORTE_ERROR_LOG: Nicht in Datei dpm_orte.c in Zeile 167 gefunden" verursacht Fortran-Programm mit OpenMPI zum Absturz
[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
--------------------------------------------------------------------------
Der Code für den Server und Client kann unten gesehen werden:
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
I mpif90 server.f90 -o server.out
und mpif90 client.f90 -o client.out
verwenden zu kompilieren und zu mpiexec -np 1 server.out
und mpiexec -np 1 client.out
, um die Programme auszuführen. Wenn der Client den Portnamen erhält (d. H. Wenn ich nach dem read
die Eingabetaste drücke), tritt der Fehler auf.
which dpm_orte.c
kehrt dpm_orte.c not found
ich mit Linux arbeite und ich installiert OpenMPI 1.10.3-1 aus dem Arch extra.
@ d_1999, habe ich die MPI_Finalize() bewegt und trotzdem versucht, aber das Problem bleibt. – GLaDER