Changeset 5488


Ignore:
Timestamp:
11/02/20 10:08:27 (23 months ago)
Author:
ymipsl
Message:

Ensemble management in LMDZ dynamic : splitting whole communicator to distribute a new one at each member.

YM

Location:
CONFIG_DEVT/LMDZOR_V6.2_work_ENSEMBLES/modeles/LMDZ/libf/dyn3dmem
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • CONFIG_DEVT/LMDZOR_V6.2_work_ENSEMBLES/modeles/LMDZ/libf/dyn3dmem/gcm.F90

    r5477 r5488  
    77#endif 
    88 
    9   USE mod_const_mpi, ONLY: init_const_mpi 
     9  USE mod_const_mpi, ONLY: init_const_mpi, COMM_LMDZ_ENSEMBLE 
    1010  USE parallel_lmdz 
    1111  USE infotrac 
     
    399399#ifdef CPP_PHYS 
    400400     CALL iniphysiq(iim,jjm,llm, & 
    401           distrib_phys(mpi_rank),comm_lmdz, & 
     401          distrib_phys(mpi_rank),COMM_LMDZ_ENSEMBLE, & 
    402402          daysec,day_ini,dtphys/nsplit_phys, & 
    403403          rlatu,rlatv,rlonu,rlonv,aire,cu,cv,rad,g,r,cpp, & 
  • CONFIG_DEVT/LMDZOR_V6.2_work_ENSEMBLES/modeles/LMDZ/libf/dyn3dmem/mod_const_mpi.F90

    r5477 r5488  
    11!  
    2 ! $Id: mod_const_para.F90 1279 2009-12-10 09:02:56Z fairhead $ 
     2! $Id: mod_const_mpi.F90 2055 2014-06-04 12:33:27Z acaubel $ 
    33! 
    44MODULE mod_const_mpi 
     
    66  INTEGER,SAVE :: COMM_LMDZ 
    77  INTEGER,SAVE :: MPI_REAL_LMDZ 
    8   
     8  INTEGER,SAVE :: COMM_LMDZ_ENSEMBLE 
    99 
    1010CONTAINS  
     
    3434    INTEGER             :: thread_provided 
    3535    CHARACTER(len = 6)  :: type_ocean 
     36     
    3637 
    3738!$OMP MASTER 
     
    6566    USE wxios, only: wxios_init 
    6667#endif 
     68 
     69#ifdef CPP_IOIPSL 
     70    USE IOIPSL, ONLY: getin 
     71#else 
     72! if not using IOIPSL, we still need to use (a local version of) getin 
     73    USE ioipsl_getincom, only: getin 
     74#endif 
     75 
    6776  IMPLICIT NONE 
    6877#ifdef CPP_MPI 
     
    7281    INTEGER             :: thread_required 
    7382    INTEGER             :: thread_provided 
     83    INTEGER             :: ensemble_pool_size 
     84    INTEGER             :: ensemble_comm_size 
     85    INTEGER             :: ensemble_comm_rank 
     86    INTEGER             :: ensemble_rank 
     87    INTEGER             :: member_size 
    7488 
    7589#ifdef CPP_MPI 
     
    8296                ' in mod_const_mpi::Init_const_mpi' 
    8397      ENDIF 
    84       COMM_LMDZ=MPI_COMM_WORLD 
     98      COMM_LMDZ_ENSEMBLE=MPI_COMM_WORLD 
    8599      MPI_REAL_LMDZ=MPI_REAL8 
    86100!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
     
    88102!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
    89103#ifdef CPP_XIOS 
    90       CALL wxios_init("LMDZ", outcom=COMM_LMDZ) 
     104      CALL wxios_init("LMDZ", outcom=COMM_LMDZ_ENSEMBLE) 
    91105#endif 
    92106!$OMP END MASTER 
     
    99113#endif 
    100114 
     115  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!   
     116  !! SPLIT COMMUNICATOR FOR ENSEMBLE         !!! 
     117  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
     118     ensemble_pool_size = 1 
     119     CALL getin("ensemble_pool_size", ensemble_pool_size) 
     120 
     121     CALL MPI_COMM_SIZE(COMM_LMDZ_ENSEMBLE,ensemble_comm_size,ierr) 
     122     CALL MPI_COMM_RANK(COMM_LMDZ_ENSEMBLE,ensemble_comm_rank,ierr) 
     123     IF (MOD(ensemble_comm_size,ensemble_pool_size)/=0) THEN 
     124      CALL abort_physic('Init_mpi','Nb of MPI processes in whole ensemble is not divisible by the size of ensemble',1) 
     125     ENDIF   
     126     member_size = ensemble_comm_size/ensemble_pool_size 
     127     ensemble_rank = ensemble_comm_rank/member_size 
     128     CALL MPI_COMM_SPLIT(COMM_LMDZ_ENSEMBLE, ensemble_rank, ensemble_comm_rank,COMM_LMDZ,ierr) 
     129      
     130      
    101131   END SUBROUTINE Init_mpi 
    102132     
Note: See TracChangeset for help on using the changeset viewer.