Compiling FORTRAN 2008 code with NVHPC 24.9 and OpenMPI 5.0.3

Hello,

I am helping a user to compile fortran 2003 code using NVHPC 24.9 and OpenMPI 5.0.3.
The compilations fails with the error message (see reproducer below):

NVFORTRAN-S-0155-Could not resolve generic procedure mpi_allgather

Interestingly, other MPI functions such as MPI_Barrier can be used without a problem. Also using legacy FORTRAN 90 code with the same compiler as well as corresponding C code works as expected. The FORTRAN 2008 code could be compiled with nvfortran 24.5 and OpenMPI 4.1.5 without problems. It seems to a problem with one specific dialect and compiler version.

Any suggestions are welcome.

Kind regards,

Stefan

reproducible example:

program test

  use mpi_f08
  implicit none
  type(MPI_comm)       :: mpicomm
  integer              :: n_blocks, ierr, mpirank, mpisize
  integer, allocatable :: blocks_per_rank(:)

  mpicomm = MPI_COMM_WORLD

  call MPI_Init(ierr)
  call MPI_Comm_rank(mpicomm, mpirank, ierr)
  call MPI_Comm_size(mpicomm, mpisize, ierr)
  allocate(blocks_per_rank(0:mpisize-1))

  n_blocks = 1
  call MPI_Allgather(n_blocks, 1, MPI_INTEGER, blocks_per_rank, 1, &
       MPI_INTEGER, mpicomm, ierr)

  print *, mpirank, blocks_per_rank

  call MPI_Finalize(ierr)

end program test

compile

 mpifort --show test2.f90
pgfortran test2.f90 -I<<<pathto>>>/OpenMPI/5.0.3-NVHPC-24.9-CUDA-12.6.0/include \
                                    -I<<<pathto>>>/OpenMPI/5.0.3-NVHPC-24.9-CUDA-12.6.0/lib \
                                   -L<<<pathto>>/OpenMPI/5.0.3-NVHPC-24.9-CUDA-12.6.0/lib \
                                    -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi

 pgfortran --version

pgfortran (aka nvfortran) 24.9-0 64-bit target on x86-64 Linux -tp znver2
PGI Compilers and Tools
Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES.  All rights reserved.

mpifort test2.f90 
NVFORTRAN-S-0155-Could not resolve generic procedure mpi_allgather (test2.f90: 19)
  0 inform,   0 warnings,   1 severes, 0 fatal for test

The last step works with NVHPC 24.5 and OpenMPI 4.1.5

Hi Stefan and welcome!

We do have some known issues with OpenMPI 5 which we’re working on. However, I’m not able to reproduce this error. Though my build is with OpenMPI 5.0.7 and NVHPC 25.3.

What I’d suggest is to try the latest OpenMPI 5.0.7 in case your issue is with OpenMPI as well as update the NVHPC SDK to 25.3. If you still see issues, then I’ll bring in the folks who build the MPIs that ship with the SDK in case there’s differences in how yours is built.

-Mat