New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 15204 for NEMO/branches/UKMO/NEMO_4.0.1_NGMS_couple_stage2_spmd/src/OCE/LBC/lib_mpp.F90 – NEMO

Ignore:
Timestamp:
2021-08-25T20:27:59+02:00 (3 years ago)
Author:
vsmart
Message:

Use variable to control MPI initialisation/finalisation rather than cpp key

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/UKMO/NEMO_4.0.1_NGMS_couple_stage2_spmd/src/OCE/LBC/lib_mpp.F90

    r14661 r15204  
    100100!$AGRIF_END_DO_NOT_TREAT 
    101101   LOGICAL, PUBLIC, PARAMETER ::   lk_mpp = .TRUE.    !: mpp flag 
     102   INTEGER, PUBLIC            ::   mpi_pre_initialised = 0 
    102103#else    
    103104   INTEGER, PUBLIC, PARAMETER ::   MPI_STATUS_SIZE = 1 
     
    176177   !!---------------------------------------------------------------------- 
    177178CONTAINS 
     179 
     180   SUBROUTINE set_mpi_pre_initialised() 
     181      !!---------------------------------------------------------------------- 
     182      !!                  ***  routine set_mpi_pre_initialised  *** 
     183      !! 
     184      !! ** Purpose :   set global variable mpi_pre_initialised 
     185      !!---------------------------------------------------------------------- 
     186      INTEGER ::   ierr 
     187      !!---------------------------------------------------------------------- 
     188#if defined key_mpp_mpi 
     189      call mpi_initialized(mpi_pre_initialised, ierr) 
     190#endif 
     191      ! 
     192   END SUBROUTINE set_mpi_pre_initialised 
    178193 
    179194   SUBROUTINE mpp_start( localComm ) 
     
    692707      ELSE 
    693708         CALL mppsync 
    694 #if !defined key_spmd 
    695          CALL mpi_finalize( info ) 
    696 #endif 
     709         IF (.NOT. mpi_pre_initialised) THEN 
     710             CALL mpi_finalize( info ) 
     711         ENDIF 
    697712      ENDIF 
    698713      IF( ll_abort ) STOP 123 
Note: See TracChangeset for help on using the changeset viewer.