SCALE-RM
Functions/Subroutines | Variables
scale_comm_ensemble Module Reference

module Communication for Ensemble system More...

Functions/Subroutines

subroutine, public comm_ensemble_setup
 Setup. More...
 
subroutine, public comm_ensemble_finalize
 finalize More...
 

Variables

integer, public comm_ensemble_world
 
integer, public comm_ensemble_myrank
 
integer, public comm_ensemble_nprocs
 

Detailed Description

module Communication for Ensemble system

Description
MPI Communication module for Ensemble system
Author
Team SCALE

Function/Subroutine Documentation

◆ comm_ensemble_setup()

subroutine, public scale_comm_ensemble::comm_ensemble_setup

Setup.

Definition at line 52 of file scale_comm_ensemble.F90.

52  use scale_prc, only: &
57  prc_nprocs, &
58  prc_myrank, &
59  prc_abort
60  implicit none
61 
62  integer, allocatable :: ensemble2color(:)
63  integer, allocatable :: ensemble2key (:)
64 
65  integer :: n
66  integer :: myrank, nprocs
67  integer :: ierr
68  !---------------------------------------------------------------------------
69 
70  log_newline
71  log_info("COMM_ENSEMBLE_setup",*) 'Setup'
72 
73  !!--- read namelist
74  !rewind(IO_FID_CONF)
75  !read(IO_FID_CONF,nml=PARAM_COMM_ENSEMBLE,iostat=ierr)
76  !if( ierr < 0 ) then !--- missing
77  ! LOG_INFO("COMM_ENSEMBLE_setup",*) 'Not found namelist. Default used.'
78  !elseif( ierr > 0 ) then !--- fatal error
79  ! LOG_ERROR("COMM_ENSEMBLE_setup",*) 'Not appropriate names in namelist PARAM_COMM_ENSEMBLE. Check!'
80  ! call PRC_abort
81  !endif
82  !LOG_NML(PARAM_COMM_ENSEMBLE)
83 
84  ! [global] -> [ensemble]
85  if( prc_global_nprocs < 2 ) then
86  log_error("COMM_ENSEMBLE_setup",*) 'PRC_GLOBAL_nprocs must be greater than or equal to 2:', prc_global_nprocs
87  call prc_abort
88  end if
89 
90  allocate( ensemble2color(0:prc_global_nprocs-1) )
91  allocate( ensemble2key(0:prc_global_nprocs-1) )
92 
93  do n = 0, prc_global_nprocs-1
94  ensemble2color(n) = n
95  ensemble2key(n) = n
96  end do
97 
98  call mpi_comm_split( prc_universal_comm_world, & ! [IN]
99  ensemble2color(prc_global_myrank), & ! [IN]
100  ensemble2key(prc_global_myrank), & ! [IN]
101  comm_ensemble_world, & ! [OUT]
102  ierr ) ! [OUT]
103 
104  call mpi_comm_rank( comm_ensemble_world, comm_ensemble_myrank, ierr )
105  call mpi_comm_size( comm_ensemble_world, comm_ensemble_nprocs, ierr )
106 
107  deallocate( ensemble2color )
108  deallocate( ensemble2key )
109 
110  return

References comm_ensemble_myrank, comm_ensemble_nprocs, comm_ensemble_world, scale_prc::prc_abort(), scale_prc::prc_global_myrank, scale_prc::prc_global_nprocs, scale_prc::prc_local_comm_world, scale_prc::prc_myrank, scale_prc::prc_nprocs, and scale_prc::prc_universal_comm_world.

Referenced by mod_da_driver::da_driver_setup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ comm_ensemble_finalize()

subroutine, public scale_comm_ensemble::comm_ensemble_finalize

finalize

Definition at line 116 of file scale_comm_ensemble.F90.

116  implicit none
117 
118  integer :: ierr
119  !---------------------------------------------------------------------------
120 
121  call mpi_comm_free( comm_ensemble_world, ierr )
122 
123  return

References comm_ensemble_world.

Referenced by mod_da_driver::da_driver_finalize().

Here is the caller graph for this function:

Variable Documentation

◆ comm_ensemble_world

integer, public scale_comm_ensemble::comm_ensemble_world

◆ comm_ensemble_myrank

integer, public scale_comm_ensemble::comm_ensemble_myrank

◆ comm_ensemble_nprocs

integer, public scale_comm_ensemble::comm_ensemble_nprocs
scale_prc::prc_abort
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:350
scale_prc::prc_local_comm_world
integer, public prc_local_comm_world
local communicator
Definition: scale_prc.F90:89
scale_prc::prc_myrank
integer, public prc_myrank
process num in local communicator
Definition: scale_prc.F90:91
scale_prc
module PROCESS
Definition: scale_prc.F90:11
scale_comm_ensemble::comm_ensemble_nprocs
integer, public comm_ensemble_nprocs
Definition: scale_comm_ensemble.F90:37
scale_prc::prc_global_myrank
integer, public prc_global_myrank
myrank in global communicator
Definition: scale_prc.F90:81
scale_prc::prc_universal_comm_world
integer, public prc_universal_comm_world
original communicator
Definition: scale_prc.F90:72
scale_prc::prc_nprocs
integer, public prc_nprocs
myrank in local communicator
Definition: scale_prc.F90:90
scale_prc::prc_global_nprocs
integer, public prc_global_nprocs
process num in global communicator
Definition: scale_prc.F90:82