Dear all,
I’m trying to compile the following (very simple) piece of code:
program sendrecv
use mpi
implicit none
integer :: nthreads=1
integer :: nproc, myrank
integer :: tag, status, ierr
integer :: token=0
integer :: i
call MPI_Init(ierr)
call MPI_Comm_Size(MPI_COMM_WORLD, nproc, ierr)
call MPI_Comm_Rank(MPI_COMM_WORLD, myrank, ierr)
do i = 1, nproc
call MPI_Barrier(MPI_COMM_WORLD, ierr)
if (myrank == (i - 1)) then
print "('My rank is: ', I2, ' on ', I2, ' total processes')" &
, myrank, nproc
endif
enddo
call MPI_Barrier(MPI_COMM_WORLD, ierr)
tag = 42
if (myrank > 0) then
call MPI_Recv(token, 1, MPI_INTEGER, myrank-1, tag, MPI_COMM_WORLD &
, status, ierr)
endif
call getpid(pid)
print "('proc: ', I2)", myrank
if (myrank < (nproc-1)) then
call MPI_Send(token, 1, MPI_INTEGER, myrank+1, tag, MPI_COMM_WORLD, ierr)
endif
call MPI_Barrier(MPI_COMM_WORLD, ierr)
call MPI_Finalize(ierr)
end program sendrecv
But it fails and I get this error:
PGF90-S-0155-Could not resolve generic procedure mpi_recv (sendrecv.f90: 39)
If I understand well, it is linked to the strong typing of Fortran variables, and it means that something is wrong in my MPI_Send/Recv() calls. I failed to see what is wrong though, since “token” is an integer, and I declare it as a “MPI_INTEGER” in these calls.
I’m working with PGI 14.1 and OpenMPI 1.8.
Any help would be appreciated!