Compilability of non-MPI configurations
Context
A PSyclone developer has reported that the compilation of a recent NEMO development branch after the deactivation of MPI fails due to the presence of an MPI-library subroutine call in the pre-processed source code. This issue is also present in the current NEMO 'main' branch.
Analysis
When the pre-processing key key_mpi_off
is defined, a MPI-library subroutine call appears to survive the pre-processing of the source code. This call stems from the inclusion of file lbc_lnk_neicoll_generic.h90
by file lbclnk.F90
; the call is present by default, but suppressed if pre-processing key key_mpi2
is defined.
Fix
It is proposed to exclude the MPI-library subroutine call when pre-processing key key_mpi_off
is defined, in the same way this call is suppressed when key_mpi2
is defined, i.e.,
--- a/src/OCE/LBC/lbc_lnk_neicoll_generic.h90
+++ b/src/OCE/LBC/lbc_lnk_neicoll_generic.h90
@@ -216,7 +216,7 @@
IF( ihlsmax > 0 ) THEN
impi_nc = mpi_nc_com8( ihlsmax )
IF( ll4only ) impi_nc = mpi_nc_com4( ihlsmax )
-#if ! defined key_mpi2
+#if ! defined key_mpi2 & ! defined key_mpi_off
IF( ln_timing ) CALL tic_tac( .TRUE.)
CALL mpi_Ineighbor_alltoallv(BUFFSND, iScnt, iSdpl, MPI_TYPE, BUFFRCV, iRcnt, iRdpl, MPI_TYPE, impi_nc, nreq_nei, ierr)
IF( ln_timing ) CALL tic_tac(.FALSE.)