Skip to content

Use mpi_f08 module in mpi_f08_ext module #6210

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

Merged
merged 2 commits into from
Jan 21, 2019

Conversation

kawashima-fj
Copy link
Member

I cannot add a new datatype in the mpi_f08_ext module without this change in PR #6205 .

@jsquyres Could you review? I'm not familiar with Fortran and Autoconf. Please see commit messages for details.

I'll merge this PR after receiving review and doing more build tests.

@kawashima-fj
Copy link
Member Author

@jsquyres (or someone) Could you check whether this is a sane fix? I'm not familiar with Fortran and Autoconf. I tested some build patterns and all worked fine.

kawashima-fj added a commit to kawashima-fj/ompi that referenced this pull request Dec 27, 2018
The latest two commits in this branch needs commits in the PR open-mpi#6210.
To avoid compilation errors, the new datatypes are disabled in the
use-mpi-f08 bindings until the PR is merged.

After the PR is merged, this commit will be removed.

Signed-off-by: KAWASHIMA Takahiro <[email protected]>
@kawashima-fj kawashima-fj mentioned this pull request Dec 27, 2018
@kawashima-fj
Copy link
Member Author

@jsquyres Ping.

@jsquyres
Copy link
Member

Sorry for the huge delay.

Including `mpiext_*_mpifh.h` in the source file of the `mpi_f08_ext`
module is not always appropriate. For example, if you want to define
a new datatype in an MPI extension, the `include 'mpif-ext.h'` binding
defines the datatype as `integer` but the `use mpi_f08_ext` binding
defines it as `type(mpi_datatype)`. They conflict.

This commit allows each MPI extension to declare whether it wants to
include its `mpiext_*_mpifh.h` in `mpi_f08` and `mpi_f08_ext`
respectively. The default (no declaration) is 'want'.

See `ompi/mpiext/example/configure.m4` for an example.

Signed-off-by: KAWASHIMA Takahiro <[email protected]>
If MPI extensions are enabled, all
`ompi/mpiext/pcollreq/use-mpi/mpiext_*_usempi.h` are included in
`ompi/mpi/fortran/mpiext-use-mpi/mpi-ext-module.F90` and all
`ompi/mpiext/pcollreq/use-mpi/mpiext_*_usempif08.h` are included in
`ompi/mpi/fortran/mpiext-use-mpi-f08/mpi-f08-ext-module.F90` using
`#include` directives.

In `mpiext_*_usempi.h` and `mpiext_*_usempif08.h`, some MPI extension
may want to use constants or handles defined in the `mpi` module and
the `mpi_f08` module. For example, if you want to define a new
datatype in `mpi_f08_ext`, you'll need the definition of
`type(mpi_datatype)`. However, putting `use mpi_f08` line in thier
`mpiext_*_usempif08.h` may cause a compilation error if more than
one MPI extensions are enabled because the `use` statement must be
put prior to any variable declarations.

To resolve this problem, this commit puts `use mpi` and `use mpi_f08`
as first lines of `mpi-ext-module.F90` and `mpi-f08-ext-module.F90`
respectively.

Signed-off-by: KAWASHIMA Takahiro <[email protected]>
@kawashima-fj kawashima-fj merged commit 352b667 into open-mpi:master Jan 21, 2019
@kawashima-fj kawashima-fj deleted the pr/mpiext-use-mod branch January 23, 2019 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants