2003-01-20 05:58:50 +08:00
|
|
|
!
|
2009-10-19 01:48:34 +08:00
|
|
|
! Copyright (C) 2002-2009 Quantum ESPRESSO group
|
2003-01-20 05:58:50 +08:00
|
|
|
! This file is distributed under the terms of the
|
|
|
|
! GNU General Public License. See the file `License'
|
|
|
|
! in the root directory of the present distribution,
|
|
|
|
! or http://www.gnu.org/copyleft/gpl.txt .
|
|
|
|
!
|
2004-03-24 17:36:50 +08:00
|
|
|
!----------------------------------------------------------------------------
|
|
|
|
MODULE mp_global
|
|
|
|
!----------------------------------------------------------------------------
|
|
|
|
!
|
2009-10-19 01:48:34 +08:00
|
|
|
USE mp, ONLY : mp_comm_free, mp_size, mp_rank, mp_sum, mp_barrier, &
|
2010-02-26 04:03:07 +08:00
|
|
|
mp_bcast, mp_start, mp_end, mp_env
|
2010-03-27 18:46:09 +08:00
|
|
|
USE io_global, ONLY : stdout, io_global_start, io_global_getmeta
|
2004-03-24 17:36:50 +08:00
|
|
|
USE parallel_include
|
|
|
|
!
|
2004-03-25 00:30:44 +08:00
|
|
|
IMPLICIT NONE
|
2004-03-24 17:36:50 +08:00
|
|
|
!
|
|
|
|
SAVE
|
|
|
|
!
|
|
|
|
INTEGER :: mpime = 0 ! absolute processor index starting from 0
|
|
|
|
INTEGER :: root = 0 ! index of the absolute root processor
|
|
|
|
INTEGER :: nproc = 1 ! absolute number of processor
|
2007-07-22 00:25:09 +08:00
|
|
|
INTEGER :: nproc_file = 1 ! absolute number of processor written in the
|
2009-10-19 01:48:34 +08:00
|
|
|
! xml punch file
|
2006-03-27 01:14:44 +08:00
|
|
|
INTEGER :: world_comm = 0 ! communicator of all processor
|
2008-10-22 20:14:50 +08:00
|
|
|
#if defined __SCALAPACK
|
2010-05-01 15:30:09 +08:00
|
|
|
INTEGER :: me_blacs = 0 ! BLACS processor index starting from 0
|
|
|
|
INTEGER :: np_blacs = 1 ! BLACS number of processor
|
|
|
|
INTEGER :: world_cntx = -1 ! BLACS context of all processor
|
2008-10-22 20:14:50 +08:00
|
|
|
#endif
|
|
|
|
|
2004-08-23 14:51:19 +08:00
|
|
|
INTEGER :: kunit = 1 ! granularity of k-point distribution
|
|
|
|
!
|
|
|
|
! ... indeces ( all starting from 0 !!! )
|
|
|
|
!
|
|
|
|
INTEGER :: me_pool = 0 ! index of the processor within a pool
|
|
|
|
INTEGER :: me_image = 0 ! index of the processor within an image
|
2010-12-28 08:16:27 +08:00
|
|
|
INTEGER :: me_bgrp = 0 ! index of the processor within a band group
|
2004-08-23 14:51:19 +08:00
|
|
|
INTEGER :: root_pool = 0 ! index of the root processor within a pool
|
|
|
|
INTEGER :: root_image = 0 ! index of the root processor within an image
|
2010-12-28 08:16:27 +08:00
|
|
|
INTEGER :: root_bgrp = 0 ! index of the root processor within a band group
|
2004-08-23 14:51:19 +08:00
|
|
|
INTEGER :: my_pool_id = 0 ! index of my pool
|
|
|
|
INTEGER :: my_image_id = 0 ! index of my image
|
2010-12-28 08:16:27 +08:00
|
|
|
INTEGER :: my_bgrp_id = 0 ! index of my band group
|
2006-10-17 04:50:48 +08:00
|
|
|
INTEGER :: me_ortho(2) = 0 ! coordinates of the processors
|
2008-10-22 20:14:50 +08:00
|
|
|
INTEGER :: me_ortho1 = 0 ! task id for the ortho group
|
2009-05-29 23:48:39 +08:00
|
|
|
INTEGER :: me_pgrp = 0 ! task id for plane wave task group
|
2004-08-23 14:51:19 +08:00
|
|
|
!
|
2004-03-24 17:36:50 +08:00
|
|
|
INTEGER :: npool = 1 ! number of "k-points"-pools
|
2004-09-27 17:17:48 +08:00
|
|
|
INTEGER :: nimage = 1 ! number of "path-images"-pools
|
2010-12-28 08:16:27 +08:00
|
|
|
INTEGER :: nbgrp = 1 ! number of band groups
|
2006-12-18 07:11:16 +08:00
|
|
|
INTEGER :: nogrp = 1 ! number of proc. in an orbital "task group"
|
|
|
|
INTEGER :: npgrp = 1 ! number of proc. in a plane-wave "task group"
|
2004-03-24 17:36:50 +08:00
|
|
|
INTEGER :: nproc_pool = 1 ! number of processor within a pool
|
2007-07-22 00:25:09 +08:00
|
|
|
INTEGER :: nproc_pool_file = 1 ! number of processor within a pool of
|
2009-10-19 01:48:34 +08:00
|
|
|
! written in the xml punch file
|
2004-03-24 17:36:50 +08:00
|
|
|
INTEGER :: nproc_image = 1 ! number of processor within an image
|
2009-11-23 16:12:27 +08:00
|
|
|
INTEGER :: nproc_image_file = 1 ! number of processor within a image
|
2010-12-28 08:16:27 +08:00
|
|
|
INTEGER :: nproc_bgrp = 1 ! number of processor within a band group
|
2006-10-17 04:50:48 +08:00
|
|
|
INTEGER :: np_ortho(2) = 1 ! size of the processor grid used in ortho
|
2010-05-02 20:02:21 +08:00
|
|
|
INTEGER :: nproc_ortho = 1 ! size of the ortho group:
|
2007-08-11 21:36:00 +08:00
|
|
|
INTEGER :: leg_ortho = 1 ! the distance in the father communicator
|
2009-10-19 01:48:34 +08:00
|
|
|
! of two neighbour processors in ortho_comm
|
2007-12-28 22:08:17 +08:00
|
|
|
INTEGER, ALLOCATABLE :: nolist(:) ! list of processors in my orbital task group
|
|
|
|
INTEGER, ALLOCATABLE :: nplist(:) ! list of processors in my plane wave task group
|
2004-08-23 14:51:19 +08:00
|
|
|
!
|
|
|
|
! ... communicators
|
|
|
|
!
|
2004-03-25 00:30:44 +08:00
|
|
|
INTEGER :: inter_pool_comm = 0 ! inter pool communicator
|
|
|
|
INTEGER :: intra_pool_comm = 0 ! intra pool communicator
|
2004-03-24 17:36:50 +08:00
|
|
|
INTEGER :: inter_image_comm = 0 ! inter image communicator
|
|
|
|
INTEGER :: intra_image_comm = 0 ! intra image communicator
|
2010-12-28 08:16:27 +08:00
|
|
|
INTEGER :: inter_bgrp_comm = 0 ! inter band group communicator
|
|
|
|
INTEGER :: intra_bgrp_comm = 0 ! intra band group communicator
|
2006-12-18 07:11:16 +08:00
|
|
|
INTEGER :: pgrp_comm = 0 ! plane-wave group communicator (task grouping)
|
|
|
|
INTEGER :: ogrp_comm = 0 ! orbital group communicarot (task grouping)
|
2006-10-17 04:50:48 +08:00
|
|
|
INTEGER :: ortho_comm = 0 ! communicator used for fast and memory saving ortho
|
2007-08-11 23:46:23 +08:00
|
|
|
INTEGER :: ortho_comm_id = 0 ! id of the ortho_comm
|
2008-10-22 20:14:50 +08:00
|
|
|
#if defined __SCALAPACK
|
2010-05-01 15:30:09 +08:00
|
|
|
INTEGER :: ortho_cntx = -1 ! BLACS context for ortho_comm
|
2008-10-22 20:14:50 +08:00
|
|
|
#endif
|
2004-03-24 17:36:50 +08:00
|
|
|
!
|
2009-11-10 00:07:19 +08:00
|
|
|
! ... Task Groups parallelization
|
|
|
|
!
|
|
|
|
LOGICAL :: &
|
|
|
|
use_task_groups = .FALSE. ! if TRUE task groups parallelization is used
|
|
|
|
!
|
2010-05-02 20:02:21 +08:00
|
|
|
! ... Module Private stuff
|
|
|
|
!
|
|
|
|
LOGICAL, PRIVATE :: user_nproc_ortho = .FALSE.
|
|
|
|
!
|
|
|
|
PRIVATE :: init_pool
|
|
|
|
!
|
2009-10-19 01:48:34 +08:00
|
|
|
CONTAINS
|
|
|
|
!
|
|
|
|
!-----------------------------------------------------------------------
|
2009-11-10 00:07:19 +08:00
|
|
|
SUBROUTINE mp_startup ( )
|
2009-10-19 01:48:34 +08:00
|
|
|
!-----------------------------------------------------------------------
|
|
|
|
! ... This subroutine initializes MPI
|
|
|
|
! ... Processes are organized in NIMAGE images each dealing with a subset of
|
|
|
|
! ... images used to discretize the "path" (only in "path" optimizations)
|
|
|
|
! ... Within each image processes are organized in NPOOL pools each dealing
|
|
|
|
! ... with a subset of kpoints.
|
|
|
|
! ... Within each pool R & G space distribution is performed.
|
|
|
|
! ... NPROC is read from command line or can be set with the appropriate
|
|
|
|
! ... environment variable ( for example use 'setenv MP_PROCS 8' on IBM SP
|
|
|
|
! ... machine to run on NPROC=8 processors ); NIMAGE and NPOOL are read from
|
|
|
|
! ... command line.
|
|
|
|
! ... NPOOL must be a whole divisor of NPROC
|
|
|
|
!
|
|
|
|
IMPLICIT NONE
|
2010-05-02 20:02:21 +08:00
|
|
|
INTEGER :: world, ntask_groups, nproc_ortho_in, meta_ionode_id
|
2010-03-27 18:46:09 +08:00
|
|
|
INTEGER :: root = 0
|
|
|
|
LOGICAL :: meta_ionode
|
2009-10-21 00:01:22 +08:00
|
|
|
!
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
|
|
|
CALL mp_start()
|
|
|
|
!
|
2009-10-21 00:01:22 +08:00
|
|
|
! ... get the basic parameters from communications sub-system
|
|
|
|
! ... to handle processors
|
|
|
|
! ... mpime = processor number, starting from 0
|
|
|
|
! ... nproc = number of processors
|
|
|
|
! ... world = group index of all processors
|
|
|
|
!
|
|
|
|
CALL mp_env( nproc, mpime, world )
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! ... now initialize processors and groups variables
|
|
|
|
! ... set global coordinate for this processor
|
2010-03-27 18:46:09 +08:00
|
|
|
! ... root = index of the root processor
|
2009-10-21 00:01:22 +08:00
|
|
|
!
|
|
|
|
CALL mp_global_start( root, mpime, world, nproc )
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
2009-10-21 00:01:22 +08:00
|
|
|
! ... initialize input/output, set the I/O node
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
2009-10-21 00:01:22 +08:00
|
|
|
CALL io_global_start( mpime, root )
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
2009-10-21 00:01:22 +08:00
|
|
|
! ... get the "meta" I/O node
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
2009-10-21 00:01:22 +08:00
|
|
|
CALL io_global_getmeta ( meta_ionode, meta_ionode_id )
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
|
|
|
IF ( meta_ionode ) THEN
|
2004-03-24 17:36:50 +08:00
|
|
|
!
|
2009-10-19 01:48:34 +08:00
|
|
|
! ... How many parallel images ?
|
2004-03-24 17:36:50 +08:00
|
|
|
!
|
2009-10-19 01:48:34 +08:00
|
|
|
CALL get_arg_nimage( nimage )
|
2004-03-24 17:36:50 +08:00
|
|
|
!
|
2009-10-19 01:48:34 +08:00
|
|
|
nimage = MAX( nimage, 1 )
|
|
|
|
nimage = MIN( nimage, nproc )
|
2010-12-28 08:16:27 +08:00
|
|
|
!
|
|
|
|
! ... How many parallel images ?
|
|
|
|
!
|
|
|
|
CALL get_arg_nbgrp( nbgrp )
|
|
|
|
!
|
|
|
|
nbgrp = MAX( nbgrp, 1 )
|
|
|
|
nbgrp = MIN( nbgrp, nproc )
|
|
|
|
!
|
2009-10-21 00:01:22 +08:00
|
|
|
! ... How many pools ?
|
|
|
|
!
|
|
|
|
CALL get_arg_npool( npool )
|
|
|
|
!
|
|
|
|
npool = MAX( npool, 1 )
|
|
|
|
npool = MIN( npool, nproc )
|
2004-03-24 17:36:50 +08:00
|
|
|
!
|
2009-10-19 01:48:34 +08:00
|
|
|
! ... How many task groups ?
|
2004-03-24 17:36:50 +08:00
|
|
|
!
|
2009-10-19 01:48:34 +08:00
|
|
|
CALL get_arg_ntg( ntask_groups )
|
2004-03-24 17:36:50 +08:00
|
|
|
!
|
2009-10-19 01:48:34 +08:00
|
|
|
! ... How many processors involved in diagonalization of Hamiltonian ?
|
|
|
|
!
|
2010-05-02 20:02:21 +08:00
|
|
|
CALL get_arg_northo( nproc_ortho_in )
|
|
|
|
!
|
|
|
|
IF( nproc_ortho_in < 1 ) THEN
|
|
|
|
! any invalid value means use the default
|
|
|
|
user_nproc_ortho = .FALSE.
|
|
|
|
ELSE
|
|
|
|
user_nproc_ortho = .TRUE.
|
|
|
|
END IF
|
|
|
|
!
|
|
|
|
nproc_ortho_in = MAX( nproc_ortho_in, 1 )
|
|
|
|
nproc_ortho_in = MIN( nproc_ortho_in, nproc )
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
|
|
|
END IF
|
|
|
|
!
|
|
|
|
CALL mp_barrier()
|
|
|
|
!
|
|
|
|
! ... transmit npool and nimage
|
|
|
|
!
|
|
|
|
CALL mp_bcast( npool, meta_ionode_id )
|
|
|
|
CALL mp_bcast( nimage, meta_ionode_id )
|
2010-12-28 08:16:27 +08:00
|
|
|
CALL mp_bcast( nbgrp, meta_ionode_id )
|
2009-10-19 01:48:34 +08:00
|
|
|
CALL mp_bcast( ntask_groups, meta_ionode_id )
|
2010-05-02 20:02:21 +08:00
|
|
|
CALL mp_bcast( nproc_ortho_in, meta_ionode_id )
|
|
|
|
CALL mp_bcast( user_nproc_ortho, meta_ionode_id )
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
2010-12-10 23:43:55 +08:00
|
|
|
use_task_groups = ( ntask_groups > 1 )
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
|
|
|
! ... all pools are initialized here
|
|
|
|
!
|
2010-05-02 20:02:21 +08:00
|
|
|
CALL init_pool( nimage, ntask_groups, nproc_ortho_in )
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
|
|
|
RETURN
|
|
|
|
!
|
|
|
|
END SUBROUTINE mp_startup
|
|
|
|
!
|
|
|
|
!-----------------------------------------------------------------------
|
|
|
|
SUBROUTINE mp_global_start( root_i, mpime_i, group_i, nproc_i )
|
|
|
|
!-----------------------------------------------------------------------
|
|
|
|
!
|
|
|
|
IMPLICIT NONE
|
|
|
|
!
|
|
|
|
INTEGER, INTENT(IN) :: root_i, mpime_i, group_i, nproc_i
|
|
|
|
!
|
|
|
|
root = root_i
|
|
|
|
mpime = mpime_i
|
|
|
|
world_comm = group_i
|
|
|
|
nproc = nproc_i
|
|
|
|
nproc_pool = nproc_i
|
|
|
|
nproc_image = nproc_i
|
2010-12-28 08:16:27 +08:00
|
|
|
nproc_bgrp = nproc_i
|
2009-10-19 01:48:34 +08:00
|
|
|
my_pool_id = 0
|
|
|
|
my_image_id = 0
|
2010-12-28 08:16:27 +08:00
|
|
|
my_bgrp_id = 0
|
2009-10-19 01:48:34 +08:00
|
|
|
me_pool = mpime
|
|
|
|
me_image = mpime
|
2010-12-28 08:16:27 +08:00
|
|
|
me_bgrp = mpime
|
2009-10-19 01:48:34 +08:00
|
|
|
me_pgrp = me_pool
|
|
|
|
root_pool = root
|
|
|
|
root_image = root
|
2010-12-28 08:16:27 +08:00
|
|
|
root_bgrp = root
|
2009-10-19 01:48:34 +08:00
|
|
|
inter_pool_comm = group_i
|
|
|
|
intra_pool_comm = group_i
|
|
|
|
inter_image_comm = group_i
|
|
|
|
intra_image_comm = group_i
|
2010-12-28 08:16:27 +08:00
|
|
|
inter_bgrp_comm = group_i
|
|
|
|
intra_bgrp_comm = group_i
|
2009-10-19 01:48:34 +08:00
|
|
|
ortho_comm = group_i
|
|
|
|
ALLOCATE( nolist( nproc_i ) )
|
|
|
|
ALLOCATE( nplist( nproc_i ) )
|
|
|
|
nolist = 0
|
|
|
|
nplist = 0
|
|
|
|
!
|
|
|
|
RETURN
|
|
|
|
!
|
|
|
|
END SUBROUTINE mp_global_start
|
|
|
|
!
|
2010-02-26 04:03:07 +08:00
|
|
|
!-----------------------------------------------------------------------
|
|
|
|
SUBROUTINE mp_global_end ( )
|
|
|
|
!-----------------------------------------------------------------------
|
|
|
|
!
|
|
|
|
CALL mp_barrier()
|
|
|
|
CALL mp_end ()
|
|
|
|
IF (ALLOCATED (nolist) ) DEALLOCATE ( nolist )
|
|
|
|
IF (ALLOCATED (nplist) ) DEALLOCATE ( nplist )
|
|
|
|
!
|
|
|
|
END SUBROUTINE mp_global_end
|
|
|
|
!
|
2009-10-19 01:48:34 +08:00
|
|
|
!-----------------------------------------------------------------------
|
|
|
|
SUBROUTINE mp_global_group_start( mep, myp, nprocp, num_of_pools )
|
|
|
|
!-----------------------------------------------------------------------
|
|
|
|
!
|
|
|
|
IMPLICIT NONE
|
|
|
|
!
|
|
|
|
INTEGER, INTENT(IN) :: mep, myp, nprocp, num_of_pools
|
|
|
|
!
|
|
|
|
me_pool = mep
|
|
|
|
my_pool_id = myp
|
|
|
|
nproc_pool = nprocp
|
|
|
|
npool = num_of_pools
|
|
|
|
!
|
|
|
|
RETURN
|
|
|
|
!
|
|
|
|
END SUBROUTINE mp_global_group_start
|
2006-05-03 22:19:57 +08:00
|
|
|
!
|
2006-03-27 01:14:44 +08:00
|
|
|
!
|
2009-10-19 01:48:34 +08:00
|
|
|
!----------------------------------------------------------------------------
|
2010-05-02 20:02:21 +08:00
|
|
|
SUBROUTINE init_pool( nimage_ , ntask_groups_ , nproc_ortho_in )
|
2009-10-19 01:48:34 +08:00
|
|
|
!----------------------------------------------------------------------------
|
|
|
|
!
|
|
|
|
! ... This routine initialize the pool : MPI division in pools and images
|
|
|
|
!
|
|
|
|
IMPLICIT NONE
|
|
|
|
!
|
2010-05-02 20:02:21 +08:00
|
|
|
INTEGER, INTENT(IN) :: nimage_
|
|
|
|
INTEGER, INTENT(IN) :: ntask_groups_
|
|
|
|
INTEGER, INTENT(IN) :: nproc_ortho_in
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
2010-05-02 20:02:21 +08:00
|
|
|
INTEGER :: nproc_ortho_try
|
2009-10-19 01:48:34 +08:00
|
|
|
INTEGER :: ierr = 0
|
|
|
|
!
|
2006-03-27 01:14:44 +08:00
|
|
|
#if defined (__PARA)
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
|
|
|
!
|
2010-05-02 20:02:21 +08:00
|
|
|
IF( nimage < 1 ) &
|
|
|
|
CALL errore( 'init_pool', 'invalid number of images, less than one', 1 )
|
|
|
|
!
|
|
|
|
nimage = nimage_
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
|
|
|
! ... here we set all parallel indeces (defined in mp_global):
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! ... number of cpus per image
|
|
|
|
!
|
|
|
|
nproc_image = nproc / nimage
|
|
|
|
!
|
|
|
|
IF ( nproc < nimage ) &
|
2010-05-02 20:02:21 +08:00
|
|
|
CALL errore( 'init_pool', 'invalid number of images, nimage > nproc', 1 )
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
|
|
|
IF ( MOD( nproc, nimage ) /= 0 ) &
|
2010-05-02 20:02:21 +08:00
|
|
|
CALL errore( 'init_pool', 'invalid number of images, nproc /= nproc_image * nimage', 1 )
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
|
|
|
! ... my_image_id = image index for this processor ( 0 : nimage - 1 )
|
|
|
|
! ... me_image = processor index within the image ( 0 : nproc_image - 1 )
|
|
|
|
!
|
|
|
|
my_image_id = mpime / nproc_image
|
|
|
|
me_image = MOD( mpime, nproc_image )
|
|
|
|
!
|
|
|
|
CALL mp_barrier()
|
|
|
|
!
|
|
|
|
! ... the intra_image_comm communicator is created
|
|
|
|
!
|
2010-12-28 08:16:27 +08:00
|
|
|
CALL MPI_COMM_SPLIT( MPI_COMM_WORLD, my_image_id, mpime, intra_image_comm, ierr )
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
2010-05-02 20:02:21 +08:00
|
|
|
IF ( ierr /= 0 ) &
|
|
|
|
CALL errore( 'init_pool', 'intra image communicator initialization', ABS(ierr) )
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
|
|
|
CALL mp_barrier()
|
|
|
|
!
|
|
|
|
! ... the inter_image_comm communicator is created
|
|
|
|
!
|
2010-12-28 08:16:27 +08:00
|
|
|
CALL MPI_COMM_SPLIT( MPI_COMM_WORLD, me_image, mpime, inter_image_comm, ierr )
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
2010-05-02 20:02:21 +08:00
|
|
|
IF ( ierr /= 0 ) &
|
|
|
|
CALL errore( 'init_pool', 'inter image communicator initialization', ABS(ierr) )
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
2010-12-28 08:16:27 +08:00
|
|
|
! ... Now the band group communicator
|
|
|
|
!
|
|
|
|
nproc_bgrp = nproc_image / nbgrp
|
|
|
|
!
|
|
|
|
IF ( MOD( nproc_image, nbgrp ) /= 0 ) &
|
|
|
|
CALL errore( 'init_pool', 'invalid number of band group, nproc_image /= nproc_bgrp * nbgrp', 1 )
|
|
|
|
!
|
|
|
|
! ... my_bgrp_id = band group index for this processor ( 0 : nbgrp - 1 )
|
|
|
|
! ... me_bgrp = processor index within the band group ( 0 : nproc_bgrp - 1 )
|
|
|
|
!
|
|
|
|
my_bgrp_id = me_image / nproc_bgrp
|
|
|
|
me_bgrp = MOD( me_image, nproc_bgrp )
|
|
|
|
!
|
|
|
|
CALL mp_barrier()
|
|
|
|
!
|
|
|
|
! ... the intra_bgrp_comm communicator is created
|
|
|
|
!
|
|
|
|
CALL MPI_COMM_SPLIT( intra_image_comm, my_bgrp_id, me_image, intra_bgrp_comm, ierr )
|
|
|
|
!
|
|
|
|
IF ( ierr /= 0 ) &
|
|
|
|
CALL errore( 'init_pool', 'intra band group communicator initialization', ABS(ierr) )
|
|
|
|
!
|
|
|
|
CALL mp_barrier()
|
|
|
|
!
|
|
|
|
! ... the inter_bgrp_comm communicator is created
|
|
|
|
!
|
|
|
|
CALL MPI_COMM_SPLIT( intra_image_comm, me_bgrp, me_image, inter_bgrp_comm, ierr )
|
|
|
|
!
|
|
|
|
IF ( ierr /= 0 ) &
|
|
|
|
CALL errore( 'init_pool', 'inter band group communicator initialization', ABS(ierr) )
|
|
|
|
!
|
2009-10-19 01:48:34 +08:00
|
|
|
! ... number of cpus per pool of k-points (they are created inside each image)
|
|
|
|
!
|
2010-12-28 08:16:27 +08:00
|
|
|
nproc_pool = nproc_bgrp / npool
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
2010-12-28 08:16:27 +08:00
|
|
|
IF ( MOD( nproc_bgrp, npool ) /= 0 ) &
|
|
|
|
CALL errore( 'init_pool', 'invalid number of pools, nproc_bgrp /= nproc_pool * npool', 1 )
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
|
|
|
! ... my_pool_id = pool index for this processor ( 0 : npool - 1 )
|
|
|
|
! ... me_pool = processor index within the pool ( 0 : nproc_pool - 1 )
|
|
|
|
!
|
2010-12-28 08:16:27 +08:00
|
|
|
my_pool_id = me_bgrp / nproc_pool
|
|
|
|
me_pool = MOD( me_bgrp, nproc_pool )
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
2010-12-28 08:16:27 +08:00
|
|
|
CALL mp_barrier( intra_bgrp_comm )
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
|
|
|
! ... the intra_pool_comm communicator is created
|
|
|
|
!
|
2010-12-28 08:16:27 +08:00
|
|
|
CALL MPI_COMM_SPLIT( intra_bgrp_comm, my_pool_id, me_bgrp, intra_pool_comm, ierr )
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
2010-05-02 20:02:21 +08:00
|
|
|
IF ( ierr /= 0 ) &
|
|
|
|
CALL errore( 'init_pool', 'intra pool communicator initialization', ABS(ierr) )
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
2010-12-28 08:16:27 +08:00
|
|
|
CALL mp_barrier( intra_bgrp_comm )
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
|
|
|
! ... the inter_pool_comm communicator is created
|
|
|
|
!
|
2010-12-28 08:16:27 +08:00
|
|
|
CALL MPI_COMM_SPLIT( intra_bgrp_comm, me_pool, me_bgrp, inter_pool_comm, ierr )
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
2010-05-02 20:02:21 +08:00
|
|
|
IF ( ierr /= 0 ) &
|
|
|
|
CALL errore( 'init_pool', 'inter pool communicator initialization', ABS(ierr) )
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
2008-10-22 20:14:50 +08:00
|
|
|
#endif
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
|
|
|
!
|
2008-10-22 20:14:50 +08:00
|
|
|
#if defined __SCALAPACK
|
|
|
|
|
2010-05-01 15:30:09 +08:00
|
|
|
! define a 1D grid containing all MPI task of MPI_COMM_WORLD communicator
|
|
|
|
!
|
2009-10-19 01:48:34 +08:00
|
|
|
CALL BLACS_PINFO( me_blacs, np_blacs )
|
|
|
|
CALL BLACS_GET( -1, 0, world_cntx )
|
2010-05-01 15:30:09 +08:00
|
|
|
CALL BLACS_GRIDINIT( world_cntx, 'Row', 1, np_blacs )
|
|
|
|
!
|
2006-05-03 22:19:57 +08:00
|
|
|
#endif
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
2010-05-02 20:02:21 +08:00
|
|
|
IF( user_nproc_ortho ) THEN
|
|
|
|
! use the command line value ensuring that it falls in the proper range.
|
|
|
|
nproc_ortho_try = MIN( nproc_ortho_in , nproc_pool )
|
|
|
|
nproc_ortho_try = MAX( nproc_ortho_try , 1 )
|
|
|
|
ELSE
|
|
|
|
! here we can play with custom architecture specific default definitions
|
|
|
|
#if defined __SCALAPACK
|
|
|
|
nproc_ortho_try = MAX( nproc_pool/2, 1 )
|
|
|
|
#else
|
|
|
|
nproc_ortho_try = 1
|
|
|
|
#endif
|
2009-10-19 01:48:34 +08:00
|
|
|
END IF
|
|
|
|
!
|
2010-05-02 20:02:21 +08:00
|
|
|
! the ortho group for parallel linear algebra is a sub-group of the pool,
|
|
|
|
! then there are as many ortho groups as pools.
|
|
|
|
!
|
|
|
|
CALL init_ortho_group( nproc_ortho_try, intra_pool_comm )
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
2010-12-10 23:43:55 +08:00
|
|
|
IF( ntask_groups_ > 1 ) THEN
|
2010-05-02 20:02:21 +08:00
|
|
|
nogrp = ntask_groups_
|
|
|
|
CALL init_task_groups( )
|
2009-10-19 01:48:34 +08:00
|
|
|
END IF
|
|
|
|
!
|
|
|
|
RETURN
|
|
|
|
!
|
|
|
|
END SUBROUTINE init_pool
|
|
|
|
!
|
|
|
|
!
|
|
|
|
SUBROUTINE init_task_groups( )
|
|
|
|
!
|
|
|
|
INTEGER :: i, n1, ipos, color, key, ierr, itsk, ntsk
|
|
|
|
INTEGER :: pgroup( nproc_pool )
|
|
|
|
!
|
|
|
|
!SUBDIVIDE THE PROCESSORS IN GROUPS
|
|
|
|
!
|
|
|
|
!THE NUMBER OF GROUPS HAS TO BE A DIVISOR OF THE NUMBER
|
|
|
|
!OF PROCESSORS
|
|
|
|
!
|
|
|
|
IF( MOD( nproc_pool, nogrp ) /= 0 ) &
|
2010-05-02 20:02:21 +08:00
|
|
|
CALL errore( " init_task_groups ", "the number of task groups should be a divisor of nproc_pool ", 1 )
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
|
|
|
npgrp = nproc_pool / nogrp
|
2007-12-29 18:09:28 +08:00
|
|
|
|
2009-10-19 01:48:34 +08:00
|
|
|
DO i = 1, nproc_pool
|
|
|
|
pgroup( i ) = i - 1
|
|
|
|
ENDDO
|
|
|
|
!
|
|
|
|
!LIST OF PROCESSORS IN MY ORBITAL GROUP
|
|
|
|
!
|
|
|
|
! processors in these group have contiguous indexes
|
|
|
|
!
|
|
|
|
N1 = ( me_pool / NOGRP ) * NOGRP - 1
|
|
|
|
DO i = 1, nogrp
|
|
|
|
nolist( I ) = pgroup( N1 + I + 1 )
|
|
|
|
IF( me_pool == nolist( I ) ) ipos = i - 1
|
|
|
|
ENDDO
|
|
|
|
!
|
|
|
|
!LIST OF PROCESSORS IN MY PLANE WAVE GROUP
|
|
|
|
!
|
|
|
|
DO I = 1, npgrp
|
|
|
|
nplist( I ) = pgroup( ipos + ( i - 1 ) * nogrp + 1 )
|
|
|
|
ENDDO
|
2007-12-29 18:09:28 +08:00
|
|
|
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
|
|
|
!SET UP THE GROUPS
|
|
|
|
!
|
|
|
|
!
|
|
|
|
!CREATE ORBITAL GROUPS
|
|
|
|
!
|
2007-12-29 18:09:28 +08:00
|
|
|
#if defined __MPI
|
2009-10-19 01:48:34 +08:00
|
|
|
color = me_pool / nogrp
|
|
|
|
key = MOD( me_pool , nogrp )
|
|
|
|
CALL MPI_COMM_SPLIT( intra_pool_comm, color, key, ogrp_comm, ierr )
|
|
|
|
if( ierr /= 0 ) &
|
2010-05-02 20:02:21 +08:00
|
|
|
CALL errore( ' init_task_groups ', ' creating ogrp_comm ', ABS(ierr) )
|
2009-10-19 01:48:34 +08:00
|
|
|
CALL MPI_COMM_RANK( ogrp_comm, itsk, IERR )
|
|
|
|
CALL MPI_COMM_SIZE( ogrp_comm, ntsk, IERR )
|
2010-05-02 20:02:21 +08:00
|
|
|
IF( nogrp /= ntsk ) CALL errore( ' init_task_groups ', ' ogrp_comm size ', ntsk )
|
2009-10-19 01:48:34 +08:00
|
|
|
DO i = 1, nogrp
|
|
|
|
IF( me_pool == nolist( i ) ) THEN
|
2010-05-02 20:02:21 +08:00
|
|
|
IF( (i-1) /= itsk ) CALL errore( ' init_task_groups ', ' ogrp_comm rank ', itsk )
|
2009-10-19 01:48:34 +08:00
|
|
|
END IF
|
|
|
|
END DO
|
2007-12-29 18:09:28 +08:00
|
|
|
#endif
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
|
|
|
!CREATE PLANEWAVE GROUPS
|
|
|
|
!
|
2007-12-29 18:09:28 +08:00
|
|
|
#if defined __MPI
|
2009-10-19 01:48:34 +08:00
|
|
|
color = MOD( me_pool , nogrp )
|
|
|
|
key = me_pool / nogrp
|
|
|
|
CALL MPI_COMM_SPLIT( intra_pool_comm, color, key, pgrp_comm, ierr )
|
|
|
|
if( ierr /= 0 ) &
|
2010-05-02 20:02:21 +08:00
|
|
|
CALL errore( ' init_task_groups ', ' creating pgrp_comm ', ABS(ierr) )
|
2009-10-19 01:48:34 +08:00
|
|
|
CALL MPI_COMM_RANK( pgrp_comm, itsk, IERR )
|
|
|
|
CALL MPI_COMM_SIZE( pgrp_comm, ntsk, IERR )
|
2010-05-02 20:02:21 +08:00
|
|
|
IF( npgrp /= ntsk ) CALL errore( ' init_task_groups ', ' pgrp_comm size ', ntsk )
|
2009-10-19 01:48:34 +08:00
|
|
|
DO i = 1, npgrp
|
|
|
|
IF( me_pool == nplist( i ) ) THEN
|
2010-05-02 20:02:21 +08:00
|
|
|
IF( (i-1) /= itsk ) CALL errore( ' init_task_groups ', ' pgrp_comm rank ', itsk )
|
2009-10-19 01:48:34 +08:00
|
|
|
END IF
|
|
|
|
END DO
|
|
|
|
me_pgrp = itsk
|
2007-12-29 18:09:28 +08:00
|
|
|
#endif
|
|
|
|
|
2009-10-19 01:48:34 +08:00
|
|
|
|
|
|
|
RETURN
|
|
|
|
END SUBROUTINE init_task_groups
|
|
|
|
!
|
|
|
|
!
|
2010-05-02 20:02:21 +08:00
|
|
|
SUBROUTINE init_ortho_group( nproc_try_in, comm_all )
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
|
|
|
IMPLICIT NONE
|
|
|
|
|
2010-05-02 20:02:21 +08:00
|
|
|
INTEGER, INTENT(IN) :: nproc_try_in, comm_all
|
2009-10-19 01:48:34 +08:00
|
|
|
|
|
|
|
LOGICAL, SAVE :: first = .true.
|
2010-05-02 20:02:21 +08:00
|
|
|
INTEGER :: ierr, color, key, me_all, nproc_all, nproc_try
|
2008-10-22 20:14:50 +08:00
|
|
|
|
|
|
|
#if defined __SCALAPACK
|
2009-10-19 01:48:34 +08:00
|
|
|
INTEGER, ALLOCATABLE :: blacsmap(:,:)
|
2010-12-28 08:16:27 +08:00
|
|
|
INTEGER, ALLOCATABLE :: ortho_cntx_pe(:,:,:)
|
|
|
|
INTEGER :: nprow, npcol, myrow, mycol, i, j, k
|
2010-05-01 15:30:09 +08:00
|
|
|
INTEGER, EXTERNAL :: BLACS_PNUM
|
2008-10-22 20:14:50 +08:00
|
|
|
#endif
|
2009-10-19 01:48:34 +08:00
|
|
|
|
2006-10-17 04:50:48 +08:00
|
|
|
#if defined __MPI
|
|
|
|
|
2009-10-19 01:48:34 +08:00
|
|
|
me_all = mp_rank( comm_all )
|
2010-05-02 20:02:21 +08:00
|
|
|
!
|
2009-10-19 01:48:34 +08:00
|
|
|
nproc_all = mp_size( comm_all )
|
2010-05-02 20:02:21 +08:00
|
|
|
!
|
|
|
|
nproc_try = MIN( nproc_try_in, nproc_all )
|
|
|
|
nproc_try = MAX( nproc_try, 1 )
|
2007-08-10 04:38:11 +08:00
|
|
|
|
2009-10-19 01:48:34 +08:00
|
|
|
IF( .NOT. first ) THEN
|
|
|
|
!
|
|
|
|
! free resources associated to the communicator
|
|
|
|
!
|
|
|
|
CALL mp_comm_free( ortho_comm )
|
|
|
|
!
|
2008-10-26 15:39:53 +08:00
|
|
|
#if defined __SCALAPACK
|
2010-05-01 15:30:09 +08:00
|
|
|
IF( ortho_comm_id > 0 ) THEN
|
|
|
|
CALL BLACS_GRIDEXIT( ortho_cntx )
|
|
|
|
ENDIF
|
|
|
|
ortho_cntx = -1
|
2008-10-26 15:39:53 +08:00
|
|
|
#endif
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
|
|
|
END IF
|
2006-10-17 04:50:48 +08:00
|
|
|
|
2009-10-19 01:48:34 +08:00
|
|
|
! find the square closer (but lower) to nproc_try
|
|
|
|
!
|
|
|
|
CALL grid2d_dims( 'S', nproc_try, np_ortho(1), np_ortho(2) )
|
|
|
|
!
|
2010-05-02 20:02:21 +08:00
|
|
|
! now, and only now, it is possible to define the number of tasks
|
|
|
|
! in the ortho group for parallel linear algebra
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
2010-05-02 20:02:21 +08:00
|
|
|
nproc_ortho = np_ortho(1) * np_ortho(2)
|
|
|
|
!
|
|
|
|
IF( nproc_all >= 4*nproc_ortho ) THEN
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
|
|
|
! here we choose a processor every 4, in order not to stress memory BW
|
|
|
|
! on multi core procs, for which further performance enhancements are
|
|
|
|
! possible using OpenMP BLAS inside regter/cegter/rdiaghg/cdiaghg
|
|
|
|
! (to be implemented)
|
|
|
|
!
|
|
|
|
color = 0
|
2010-05-02 20:02:21 +08:00
|
|
|
IF( me_all < 4*nproc_ortho .AND. MOD( me_all, 4 ) == 0 ) color = 1
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
|
|
|
leg_ortho = 4
|
|
|
|
!
|
2010-05-02 20:02:21 +08:00
|
|
|
ELSE IF( nproc_all >= 2*nproc_ortho ) THEN
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
|
|
|
! here we choose a processor every 2, in order not to stress memory BW
|
|
|
|
!
|
|
|
|
color = 0
|
2010-05-02 20:02:21 +08:00
|
|
|
IF( me_all < 2*nproc_ortho .AND. MOD( me_all, 2 ) == 0 ) color = 1
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
|
|
|
leg_ortho = 2
|
|
|
|
!
|
|
|
|
ELSE
|
|
|
|
!
|
|
|
|
! here we choose the first processors
|
|
|
|
!
|
|
|
|
color = 0
|
2010-05-02 20:02:21 +08:00
|
|
|
IF( me_all < nproc_ortho ) color = 1
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
|
|
|
leg_ortho = 1
|
|
|
|
!
|
|
|
|
END IF
|
|
|
|
!
|
|
|
|
key = me_all
|
|
|
|
!
|
2010-05-02 20:02:21 +08:00
|
|
|
! initialize the communicator for the new group by splitting the input communicator
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
|
|
|
CALL MPI_COMM_SPLIT( comm_all, color, key, ortho_comm, ierr )
|
|
|
|
IF( ierr /= 0 ) &
|
2010-05-02 20:02:21 +08:00
|
|
|
CALL errore( " init_ortho_group ", " initializing ortho group communicator ", ierr )
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
|
|
|
! Computes coordinates of the processors, in row maior order
|
|
|
|
!
|
2010-05-02 20:02:21 +08:00
|
|
|
me_ortho1 = mp_rank( ortho_comm )
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
|
|
|
IF( me_all == 0 .AND. me_ortho1 /= 0 ) &
|
2010-05-02 20:02:21 +08:00
|
|
|
CALL errore( " init_ortho_group ", " wrong root task in ortho group ", ierr )
|
2009-10-19 01:48:34 +08:00
|
|
|
!
|
|
|
|
if( color == 1 ) then
|
|
|
|
ortho_comm_id = 1
|
|
|
|
CALL GRID2D_COORDS( 'R', me_ortho1, np_ortho(1), np_ortho(2), me_ortho(1), me_ortho(2) )
|
|
|
|
CALL GRID2D_RANK( 'R', np_ortho(1), np_ortho(2), me_ortho(1), me_ortho(2), ierr )
|
|
|
|
IF( ierr /= me_ortho1 ) &
|
2010-05-02 20:02:21 +08:00
|
|
|
CALL errore( " init_ortho_group ", " wrong task coordinates in ortho group ", ierr )
|
2009-10-19 01:48:34 +08:00
|
|
|
IF( me_ortho1*leg_ortho /= me_all ) &
|
2010-05-02 20:02:21 +08:00
|
|
|
CALL errore( " init_ortho_group ", " wrong rank assignment in ortho group ", ierr )
|
2009-10-19 01:48:34 +08:00
|
|
|
else
|
|
|
|
ortho_comm_id = 0
|
|
|
|
me_ortho(1) = me_ortho1
|
|
|
|
me_ortho(2) = me_ortho1
|
|
|
|
endif
|
2008-10-26 15:39:53 +08:00
|
|
|
|
2008-10-22 20:14:50 +08:00
|
|
|
#if defined __SCALAPACK
|
|
|
|
|
2010-12-28 08:16:27 +08:00
|
|
|
ALLOCATE( ortho_cntx_pe( npool, nbgrp, nimage ) )
|
2010-05-01 15:30:09 +08:00
|
|
|
ALLOCATE( blacsmap( np_ortho(1), np_ortho(2) ) )
|
2009-10-19 01:48:34 +08:00
|
|
|
|
2010-05-01 15:30:09 +08:00
|
|
|
DO j = 1, nimage
|
2008-10-26 15:39:53 +08:00
|
|
|
|
2010-12-28 08:16:27 +08:00
|
|
|
DO k = 1, nbgrp
|
|
|
|
|
2010-05-01 15:30:09 +08:00
|
|
|
DO i = 1, npool
|
2008-10-22 20:14:50 +08:00
|
|
|
|
2010-12-28 08:16:27 +08:00
|
|
|
CALL BLACS_GET( -1, 0, ortho_cntx_pe( i, k, j ) ) ! take a default value
|
2008-10-22 20:14:50 +08:00
|
|
|
|
2010-05-01 15:30:09 +08:00
|
|
|
blacsmap = 0
|
|
|
|
nprow = np_ortho(1)
|
|
|
|
npcol = np_ortho(2)
|
2008-10-22 20:14:50 +08:00
|
|
|
|
2010-12-28 08:16:27 +08:00
|
|
|
IF( ( j == ( my_image_id + 1 ) ) .and. ( k == ( my_bgrp_id + 1 ) ) .and. &
|
|
|
|
( i == ( my_pool_id + 1 ) ) .and. ( ortho_comm_id > 0 ) ) THEN
|
2008-10-22 20:14:50 +08:00
|
|
|
|
2010-05-01 15:30:09 +08:00
|
|
|
blacsmap( me_ortho(1) + 1, me_ortho(2) + 1 ) = BLACS_PNUM( world_cntx, 0, me_blacs )
|
|
|
|
|
|
|
|
END IF
|
|
|
|
|
|
|
|
! All MPI tasks defined in world comm take part in the definition of the BLACS grid
|
|
|
|
|
|
|
|
CALL mp_sum( blacsmap )
|
|
|
|
|
2010-12-28 08:16:27 +08:00
|
|
|
CALL BLACS_GRIDMAP( ortho_cntx_pe(i,k,j), blacsmap, nprow, nprow, npcol )
|
2010-05-01 15:30:09 +08:00
|
|
|
|
2010-12-28 08:16:27 +08:00
|
|
|
CALL BLACS_GRIDINFO( ortho_cntx_pe(i,k,j), nprow, npcol, myrow, mycol )
|
2010-05-01 15:30:09 +08:00
|
|
|
|
2010-12-28 08:16:27 +08:00
|
|
|
IF( ( j == ( my_image_id + 1 ) ) .and. ( k == ( my_bgrp_id + 1 ) ) .and. &
|
|
|
|
( i == ( my_pool_id + 1 ) ) .and. ( ortho_comm_id > 0 ) ) THEN
|
2010-05-01 15:30:09 +08:00
|
|
|
|
2010-05-02 20:02:21 +08:00
|
|
|
IF( np_ortho(1) /= nprow ) &
|
|
|
|
CALL errore( ' init_ortho_group ', ' problem with SCALAPACK, wrong no. of task rows ', 1 )
|
|
|
|
IF( np_ortho(2) /= npcol ) &
|
|
|
|
CALL errore( ' init_ortho_group ', ' problem with SCALAPACK, wrong no. of task columns ', 1 )
|
|
|
|
IF( me_ortho(1) /= myrow ) &
|
|
|
|
CALL errore( ' init_ortho_group ', ' problem with SCALAPACK, wrong task row ID ', 1 )
|
|
|
|
IF( me_ortho(2) /= mycol ) &
|
|
|
|
CALL errore( ' init_ortho_group ', ' problem with SCALAPACK, wrong task columns ID ', 1 )
|
2010-05-01 15:30:09 +08:00
|
|
|
|
2010-12-28 08:16:27 +08:00
|
|
|
ortho_cntx = ortho_cntx_pe(i,k,j)
|
2010-05-01 15:30:09 +08:00
|
|
|
|
|
|
|
END IF
|
|
|
|
|
|
|
|
END DO
|
|
|
|
|
2010-12-28 08:16:27 +08:00
|
|
|
END DO
|
|
|
|
|
2010-05-01 15:30:09 +08:00
|
|
|
END DO
|
2008-10-22 20:14:50 +08:00
|
|
|
|
2009-10-19 01:48:34 +08:00
|
|
|
DEALLOCATE( blacsmap )
|
2010-05-01 15:30:09 +08:00
|
|
|
DEALLOCATE( ortho_cntx_pe )
|
|
|
|
|
2008-10-26 15:39:53 +08:00
|
|
|
|
2008-10-23 04:13:29 +08:00
|
|
|
#endif
|
2008-10-22 20:14:50 +08:00
|
|
|
|
2007-08-24 00:54:13 +08:00
|
|
|
#else
|
|
|
|
|
2009-10-19 01:48:34 +08:00
|
|
|
ortho_comm_id = 1
|
2007-08-24 00:54:13 +08:00
|
|
|
|
2006-10-17 04:50:48 +08:00
|
|
|
#endif
|
2007-08-24 00:54:13 +08:00
|
|
|
|
2009-10-19 01:48:34 +08:00
|
|
|
first = .false.
|
|
|
|
|
|
|
|
RETURN
|
|
|
|
END SUBROUTINE init_ortho_group
|
|
|
|
!
|
|
|
|
!
|
2004-03-24 17:36:50 +08:00
|
|
|
END MODULE mp_global
|