Skip to content

Commit

Permalink
Merge branch 'framework/mpi_f08_use_only' into release-v8.2.0 (PR #1188)
Browse files Browse the repository at this point in the history
This merge adds ONLY clauses to all USE statements for the mpi_f08 module in
MPAS.

Besides being a generally good practice, the use of only those entities from the
'mpi_f08' module that are actually needed eliminates link-time issues with debug
builds using the Intel oneAPI compilers (with the Cray MPICH library).

* framework/mpi_f08_use_only:
  Add ONLY clause to USE statements for the 'mpi_f08' module
  • Loading branch information
mgduda committed Jun 21, 2024
2 parents 45c4f27 + b6db7d6 commit d00c950
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/framework/mpas_abort.F
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ subroutine mpas_dmpar_global_abort(mesg, deferredAbort)!{{{
#ifdef _MPI
#ifndef NOMPIMOD
#ifdef MPAS_USE_MPI_F08
use mpi_f08
use mpi_f08, only : MPI_COMM_WORLD, MPI_Comm_rank, MPI_Comm_size, MPI_Abort
#else
use mpi
#endif
Expand Down
11 changes: 10 additions & 1 deletion src/framework/mpas_dmpar.F
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,16 @@ module mpas_dmpar
#ifdef _MPI
#ifndef NOMPIMOD
#ifdef MPAS_USE_MPI_F08
use mpi_f08
use mpi_f08, only : MPI_Comm, MPI_Datatype
use mpi_f08, only : MPI_INTEGER, MPI_2INTEGER, MPI_REAL, MPI_2REAL, MPI_DOUBLE_PRECISION, &
MPI_2DOUBLE_PRECISION, MPI_CHARACTER, MPI_INTEGER8
use mpi_f08, only : MPI_COMM_SELF, MPI_COMM_WORLD, MPI_INFO_NULL, MPI_THREAD_SINGLE, &
MPI_THREAD_SERIALIZED, MPI_THREAD_FUNNELED, MPI_THREAD_MULTIPLE, MPI_STATUS_IGNORE
use mpi_f08, only : MPI_Query_thread, MPI_Comm_dup
use mpi_f08, only : MPI_Init_thread , MPI_Init, MPI_Comm_rank, MPI_Comm_size, MPI_Finalize, &
MPI_Comm_free, MPI_Abort, MPI_Bcast, MPI_Allreduce, MPI_Scatterv, MPI_Recv, &
MPI_Send, MPI_Request, MPI_Irecv, MPI_Isend, MPI_Wait, MPI_Wtime, MPI_Test
use mpi_f08, only : MPI_SUM, MPI_MIN, MPI_MAX, MPI_MINLOC, MPI_MAXLOC
#else
use mpi
#endif
Expand Down
5 changes: 4 additions & 1 deletion src/framework/mpas_halo.F
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,10 @@ end subroutine mpas_halo_exch_group_add_field
subroutine mpas_halo_exch_group_full_halo_exch(domain, groupName, iErr)

#ifdef MPAS_USE_MPI_F08
use mpi_f08
use mpi_f08, only : MPI_Datatype, MPI_Comm
use mpi_f08, only : MPI_REAL, MPI_DOUBLE_PRECISION, MPI_REQUEST_NULL, &
MPI_STATUS_IGNORE, MPI_STATUSES_IGNORE
use mpi_f08, only : MPI_Irecv, MPI_Isend, MPI_Waitany, MPI_Waitall
#else
use mpi
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/framework/mpas_log.F
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ subroutine log_abort()
#ifdef _MPI
#ifndef NOMPIMOD
#ifdef MPAS_USE_MPI_F08
use mpi_f08
use mpi_f08, only : MPI_COMM_WORLD, MPI_Abort
#else
use mpi
#endif
Expand Down

0 comments on commit d00c950

Please sign in to comment.