Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing PMPI symbols for some Fortran 2008 calls #12954

Open
gcorbin opened this issue Dec 3, 2024 · 1 comment
Open

Missing PMPI symbols for some Fortran 2008 calls #12954

gcorbin opened this issue Dec 3, 2024 · 1 comment

Comments

@gcorbin
Copy link

gcorbin commented Dec 3, 2024

Background information

For context: I found this because I am developing a PMPI wrapper library for the Fortran 2008 bindings.

What version of Open MPI are you using? (e.g., v4.1.6, v5.0.1, git branch name and hash, etc.)

I see the bug with

  • 5.0.4
  • 5.0.6

With older versions (4.1) the bug is not present

Describe how Open MPI was installed (e.g., from a source/distribution tarball, from a git clone, from an operating system distribution package, etc.)

Installed from tarball on my local linux machine with a plain configure. Compiler is gcc/11.4

If you are building/installing from a git clone, please copy-n-paste the output from git submodule status.

n/a

Please describe the system on which you are running

  • Operating system/version: Linux 6.8.0-49-generic x86_64
  • Computer hardware: Laptop
  • Network type: Linux shared memory + TCP enabled by configure, but probably not relevant to this issue

Details of the problem

Compiling the program below with mpif90 main.f90 results in a linker error:

/usr/bin/ld: /tmp/ccpw1Fqo.o: in function `MAIN__':
main.f90:(.text+0x63): undefined reference to `pmpi_allreduce_init_f08_'
/usr/bin/ld: main.f90:(.text+0x88): undefined reference to `pmpi_group_from_session_pset_f08_'
/usr/bin/ld: main.f90:(.text+0xa2): undefined reference to `pmpi_session_call_errhandler_f08_'
program main
! This program is not intended to run correctly.
! Its purpose is to trigger undefined reference errors when compiled with OpenMPI/5.0.x
    use :: mpi_f08, only: &
        PMPI_Allreduce_init, MPI_Request, MPI_REAL, MPI_SUM, MPI_COMM_WORLD, MPI_INFO_NULL, &
        PMPI_Group_from_session_pset, MPI_Session, MPI_Group, &
        PMPI_Session_call_errhandler, MPI_SUCCESS

    implicit none

    integer, parameter :: nbuf = 10
    real, dimension(nbuf) :: sendbuf, recvbuf
    type(MPI_Request) :: request

    type(MPI_Session) :: session
    type(MPI_Group) :: group
    integer :: ierror

    call PMPI_Allreduce_init(sendbuf, &
        recvbuf, &
        nbuf, &
        MPI_REAL, &
        MPI_SUM, &
        MPI_COMM_WORLD, &
        MPI_INFO_NULL, &
        request, &
        ierror)

    call PMPI_Group_from_session_pset(session, "group", group, ierror)

    call PMPI_Session_call_errhandler(session, MPI_SUCCESS, ierror)
end program

Symbols for

  • PMPI_Allreduce_init,
  • PMPI_Group_from_session_pset,
  • PMPI_Session_call_errhandler

are missing .

The names are present in the mpi_f08 module, because otherwise the compiler would complain about not finding them.

@jsquyres
Copy link
Member

jsquyres commented Dec 3, 2024

@gcorbin Many thanks for reporting the problem!

I have filed a fix in #12956.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants