Skip to content

Commit b380dd5

Browse files
committed
config/ompi_ext: use mpi module in mpi_ext module
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 <t-kawashima@jp.fujitsu.com>
1 parent 2220623 commit b380dd5

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

config/ompi_ext.m4

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,9 @@ EOF
171171
#include "ompi/mpi/fortran/configure-fortran-output.h"
172172
173173
module mpi_ext
174+
! Some mpi_ext extensions may require the mpi module.
175+
use mpi
176+
!
174177
! Even though this is not a useful parameter (cannot be used as a
175178
! preprocessor catch) define it to keep the linker from complaining
176179
! during the build.
@@ -213,6 +216,9 @@ EOF
213216
#include "ompi/mpi/fortran/configure-fortran-output.h"
214217
215218
module mpi_f08_ext
219+
! Some mpi_f08_ext extensions may require the mpi_f08 module.
220+
use mpi_f08
221+
!
216222
! Even though this is not a useful parameter (cannot be used as a
217223
! preprocessor catch) define it to keep the linker from complaining
218224
! during the build.

ompi/mpi/fortran/mpiext-use-mpi-f08/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ if OMPI_BUILD_FORTRAN_USEMPI_OR_USEMPIF08_EXT
2222
AM_FCFLAGS = -I$(top_builddir)/ompi/include -I$(top_srcdir)/ompi/include \
2323
$(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/mpi/fortran/base \
2424
$(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/mpi/fortran/use-mpi-f08/mod \
25+
$(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/mpi/fortran/use-mpi-f08 \
2526
-I$(top_srcdir) $(FCFLAGS_f90)
2627

2728
flibs =

ompi/mpi/fortran/mpiext-use-mpi/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ if OMPI_BUILD_FORTRAN_USEMPI_OR_USEMPIF08_EXT
2121

2222
AM_FCFLAGS = -I$(top_builddir)/ompi/include -I$(top_srcdir)/ompi/include \
2323
$(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/mpi/fortran/base \
24+
$(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/mpi/fortran/use-mpi-ignore-tkr \
2425
-I$(top_srcdir) $(FCFLAGS_f90)
2526

2627
flibs =

0 commit comments

Comments
 (0)