[mpich-discuss] Q: Why doesn't "use mpi, only : mpi_bcast" (or similar) work in MPICH?

Zhou, Hui zhouh at anl.gov
Tue Jun 1 23:14:17 CDT 2021


MPICH’s `use mpi` module does not define function interfaces. Functions such as `MPI_Send` and `MPI_Bcast` are directly linked to the C symbols. Fortran 90 used to have very poor support for “choice buffers”, which probably resulted in the decision not to define the function interface in our legacy “use mpi” module. We recommend to try “use mpi_f08” instead. The `mpi_f08` interface has the full interface defined and adopts the C interoperability features.

--
Hui Zhou


From: Brian Dobbins via discuss <discuss at mpich.org>
Date: Tuesday, June 1, 2021 at 7:53 PM
To: discuss at mpich.org <discuss at mpich.org>
Cc: Brian Dobbins <bdobbins at gmail.com>
Subject: [mpich-discuss] Q: Why doesn't "use mpi, only : mpi_bcast" (or similar) work in MPICH?

Hi all,

  I figure this is one of those things in the standard, but I figured I'd get a better explanation asking here than digging through that myself.

  Long story short, if I try the following code:

program foo
  use mpi, only: mpi_bcast
end program foo

  ... This fails to compile in MPICH (3.4.2, at least), IntelMPI and MVAPICH, but does work on OpenMPI and SGI MPT, at least on systems I've tried.  Replacing the 'use, only' with just a 'use' directive works fine.  And MPI_BCAST is just an example here; things like 'MPI_Finalize' and 'MPI_Integer' appear to be in the module, but MPI_Send also fails.  Is this a scenario where the standard doesn't support this, but OpenMPI and MPT do it as a matter of convenience vs strict adherence found in the MPICH-based libraries?  Or am I missing some simple issue?

  Any insight would be greatly appreciated!

  Thanks,
  - Brian

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mpich.org/pipermail/discuss/attachments/20210602/a4aaa3ac/attachment.html>


More information about the discuss mailing list