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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions config/ompi_ext.m4
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ EOF
#include "ompi/mpi/fortran/configure-fortran-output.h"

module mpi_ext
! Some mpi_ext extensions may require the mpi module.
use mpi
!
! Even though this is not a useful parameter (cannot be used as a
! preprocessor catch) define it to keep the linker from complaining
! during the build.
Expand Down Expand Up @@ -213,6 +216,9 @@ EOF
#include "ompi/mpi/fortran/configure-fortran-output.h"

module mpi_f08_ext
! Some mpi_f08_ext extensions may require the mpi_f08 module.
use mpi_f08
!
! Even though this is not a useful parameter (cannot be used as a
! preprocessor catch) define it to keep the linker from complaining
! during the build.
Expand Down Expand Up @@ -601,9 +607,15 @@ EOF
#
# Include the mpif.h header if it is available. Cannot do
# this from inside the usempi.h since, for VPATH builds, the
# srcdir is needed to find the header.
# srcdir is needed to find the header. Each extension can
# refuse it by defining the OMPI_MPIEXT_$1_INCLUDE_MPIFH_IN_USEMPI
# macro in its ompi/mpiext/*/configure.m4. See
# ompi/mpiext/example/configure.m4 for an example.
#
if test "$enabled_mpifh" = 1; then
m4_ifdef([OMPI_MPIEXT_]$1[_INCLUDE_MPIFH_IN_USEMPI],
[include_mpifh=OMPI_MPIEXT_$1_INCLUDE_MPIFH_IN_USEMPI],
[include_mpifh=1])
if test "$enabled_mpifh" = 1 && test "$include_mpifh" != 0; then
mpifh_component_header="mpiext_${component}_mpifh.h"
cat >> $mpiusempi_ext_h <<EOF
#include "${mpifh_component_header_path}"
Expand Down Expand Up @@ -657,9 +669,15 @@ EOF
#
# Include the mpif.h header if it is available. Cannot do
# this from inside the usempif08.h since, for VPATH builds,
# the srcdir is needed to find the header.
# the srcdir is needed to find the header. Each extension can
# refuse it by defining the OMPI_MPIEXT_$1_INCLUDE_MPIFH_IN_USEMPIF08
# macro in its ompi/mpiext/*/configure.m4. See
# ompi/mpiext/example/configure.m4 for an example.
#
if test "$enabled_mpifh" = 1; then
m4_ifdef([OMPI_MPIEXT_]$1[_INCLUDE_MPIFH_IN_USEMPIF08],
[include_mpifh=OMPI_MPIEXT_$1_INCLUDE_MPIFH_IN_USEMPIF08],
[include_mpifh=1])
if test "$enabled_mpifh" = 1 && test "$include_mpifh" != 0; then
mpifh_component_header="mpiext_${component}_mpifh.h"
cat >> $mpiusempif08_ext_h <<EOF
#include "${mpifh_component_header_path}"
Expand Down
1 change: 1 addition & 0 deletions ompi/mpi/fortran/mpiext-use-mpi-f08/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ if OMPI_BUILD_FORTRAN_USEMPI_OR_USEMPIF08_EXT
AM_FCFLAGS = -I$(top_builddir)/ompi/include -I$(top_srcdir)/ompi/include \
$(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/mpi/fortran/base \
$(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/mpi/fortran/use-mpi-f08/mod \
$(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/mpi/fortran/use-mpi-f08 \
-I$(top_srcdir) $(FCFLAGS_f90)

flibs =
Expand Down
1 change: 1 addition & 0 deletions ompi/mpi/fortran/mpiext-use-mpi/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ if OMPI_BUILD_FORTRAN_USEMPI_OR_USEMPIF08_EXT

AM_FCFLAGS = -I$(top_builddir)/ompi/include -I$(top_srcdir)/ompi/include \
$(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/mpi/fortran/base \
$(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/mpi/fortran/use-mpi-ignore-tkr \
-I$(top_srcdir) $(FCFLAGS_f90)

flibs =
Expand Down
8 changes: 8 additions & 0 deletions ompi/mpiext/example/configure.m4
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,11 @@ AC_DEFUN([OMPI_MPIEXT_example_CONFIG],[

# only need to set this if the component needs init/finalize hooks
AC_DEFUN([OMPI_MPIEXT_example_NEED_INIT], [1])

# By default, mpiext_example_mpifh.h is included in the source file
# of the mpi_ext module. To disable it, define this macro as 0.
#AC_DEFUN([OMPI_MPIEXT_example_INCLUDE_MPIFH_IN_USEMPI], [0])

# By default, mpiext_example_mpifh.h is included in the source file
# of the mpi_f08_ext module. To disable it, define this macro as 0.
#AC_DEFUN([OMPI_MPIEXT_example_INCLUDE_MPIFH_IN_USEMPIF08], [0])