Calls to mpi_comm_split replaced by interface mp_comm_split

git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@10675 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
giannozz 2014-01-11 09:14:24 +00:00
parent 7c20113ee7
commit 4eaa312633
7 changed files with 28 additions and 53 deletions

View File

@ -294,24 +294,21 @@ subroutine seqopn (unit, extension, formatt, exst, tmp_dir_)
else else
tempfile = trim(tmp_dir) // trim(filename) tempfile = trim(tmp_dir) // trim(filename)
end if end if
if ( trim(nd_nmbr) == '1' .or. trim(nd_nmbr) == '01'.or. & if ( trim(nd_nmbr) /= '1' .and. trim(nd_nmbr) /= '01' .and. &
trim(nd_nmbr) == '001' .or. trim(nd_nmbr) == '0001'.or. & trim(nd_nmbr) /= '001' .and. trim(nd_nmbr) /= '0001' .and. &
trim(nd_nmbr) == '00001' .or. trim(nd_nmbr) == '000001' ) then trim(nd_nmbr) /= '00001' .and. trim(nd_nmbr) /= '000001' ) then
! !
! do not add processor number to files opened by processor 1 ! do not add processor number to files opened by processor 1
! in parallel execution: if only the first processor writes, ! in parallel execution: if only the first processor writes,
! we do not want the filename to be dependent on the number ! we do not want the filename to be dependent on the number
! of processors ! of processors
! !
!tempfile = tempfile
else
tempfile = trim(tempfile) // nd_nmbr tempfile = trim(tempfile) // nd_nmbr
end if end if
inquire (file = tempfile, exist = exst) inquire (file = tempfile, exist = exst)
! !
! Open the file ! Open the file
! !
open (unit = unit, file = tempfile, form = formatt, status = & open (unit = unit, file = tempfile, form = formatt, status = &
'unknown', iostat = ios) 'unknown', iostat = ios)

View File

@ -52,6 +52,7 @@ constraints_module.o : kind.o
control_flags.o : kind.o control_flags.o : kind.o
control_flags.o : parameters.o control_flags.o : parameters.o
dspev_drv.o : kind.o dspev_drv.o : kind.o
dspev_drv.o : mp.o
dspev_drv.o : mp_bands.o dspev_drv.o : mp_bands.o
dspev_drv.o : mp_diag.o dspev_drv.o : mp_diag.o
electrons_base.o : constants.o electrons_base.o : constants.o
@ -155,6 +156,7 @@ mp_diag.o : mp_pools.o
mp_diag.o : mp_world.o mp_diag.o : mp_world.o
mp_diag.o : parallel_include.o mp_diag.o : parallel_include.o
mp_global.o : command_line_options.o mp_global.o : command_line_options.o
mp_global.o : mp.o
mp_global.o : mp_bands.o mp_global.o : mp_bands.o
mp_global.o : mp_diag.o mp_global.o : mp_diag.o
mp_global.o : mp_images.o mp_global.o : mp_images.o

View File

@ -9,7 +9,7 @@
MODULE mp_bands MODULE mp_bands
!---------------------------------------------------------------------------- !----------------------------------------------------------------------------
! !
USE mp, ONLY : mp_barrier, mp_bcast, mp_size, mp_rank USE mp, ONLY : mp_barrier, mp_bcast, mp_size, mp_rank, mp_comm_split
USE parallel_include USE parallel_include
! !
IMPLICIT NONE IMPLICIT NONE
@ -51,7 +51,7 @@ CONTAINS
INTEGER, INTENT(IN) :: nband_, parent_comm INTEGER, INTENT(IN) :: nband_, parent_comm
INTEGER, INTENT(IN), OPTIONAL :: ntg_ INTEGER, INTENT(IN), OPTIONAL :: ntg_
! !
INTEGER :: parent_nproc = 1, parent_mype = 0, ierr = 0 INTEGER :: parent_nproc = 1, parent_mype = 0
! !
#if defined (__MPI) #if defined (__MPI)
! !
@ -84,19 +84,13 @@ CONTAINS
! !
! ... the intra_bgrp_comm communicator is created ! ... the intra_bgrp_comm communicator is created
! !
CALL MPI_COMM_SPLIT( parent_comm, my_bgrp_id, parent_mype, intra_bgrp_comm, ierr ) CALL mp_comm_split( parent_comm, my_bgrp_id, parent_mype, intra_bgrp_comm )
!
IF ( ierr /= 0 ) CALL errore( 'mp_start_bands', &
'intra band group communicator initialization', ABS(ierr) )
! !
CALL mp_barrier( parent_comm ) CALL mp_barrier( parent_comm )
! !
! ... the inter_bgrp_comm communicator is created ! ... the inter_bgrp_comm communicator is created
! !
CALL MPI_COMM_SPLIT( parent_comm, me_bgrp, parent_mype, inter_bgrp_comm, ierr ) CALL mp_comm_split( parent_comm, me_bgrp, parent_mype, inter_bgrp_comm )
!
IF ( ierr /= 0 ) CALL errore( 'mp_start_bands', &
'inter band group communicator initialization', ABS(ierr) )
! !
IF ( PRESENT(ntg_) ) THEN IF ( PRESENT(ntg_) ) THEN
ntask_groups = ntg_ ntask_groups = ntg_
@ -112,7 +106,7 @@ CONTAINS
IMPLICIT NONE IMPLICIT NONE
INTEGER, INTENT(IN) :: comm, nbnd INTEGER, INTENT(IN) :: comm, nbnd
INTEGER :: npe, myrank, ierror, rest, k INTEGER :: npe, myrank, rest, k
myrank = mp_rank(comm) myrank = mp_rank(comm)
npe = mp_size(comm) npe = mp_size(comm)

View File

@ -9,7 +9,7 @@
MODULE mp_diag MODULE mp_diag
!---------------------------------------------------------------------------- !----------------------------------------------------------------------------
! !
USE mp, ONLY : mp_size, mp_rank, mp_sum, mp_comm_free USE mp, ONLY : mp_size, mp_rank, mp_sum, mp_comm_free, mp_comm_split
! !
! The following variables are needed in order to set up the communicator ! The following variables are needed in order to set up the communicator
! for scalapack ! for scalapack
@ -193,9 +193,7 @@ CONTAINS
! !
! initialize the communicator for the new group by splitting the input communicator ! initialize the communicator for the new group by splitting the input communicator
! !
CALL MPI_COMM_SPLIT( comm_all, color, key, ortho_comm, ierr ) CALL mp_comm_split ( comm_all, color, key, ortho_comm )
IF( ierr /= 0 ) &
CALL errore( " init_ortho_group ", " initializing ortho group communicator ", ierr )
! !
! Computes coordinates of the processors, in row maior order ! Computes coordinates of the processors, in row maior order
! !
@ -213,8 +211,8 @@ CONTAINS
IF( me_ortho1*leg_ortho /= me_all ) & IF( me_ortho1*leg_ortho /= me_all ) &
CALL errore( " init_ortho_group ", " wrong rank assignment in ortho group ", ierr ) CALL errore( " init_ortho_group ", " wrong rank assignment in ortho group ", ierr )
CALL MPI_COMM_SPLIT( ortho_comm, me_ortho(2), me_ortho(1), ortho_col_comm, ierr ) CALL mp_comm_split( ortho_comm, me_ortho(2), me_ortho(1), ortho_col_comm)
CALL MPI_COMM_SPLIT( ortho_comm, me_ortho(1), me_ortho(2), ortho_row_comm, ierr ) CALL mp_comm_split( ortho_comm, me_ortho(1), me_ortho(2), ortho_row_comm)
else else
ortho_comm_id = 0 ortho_comm_id = 0

View File

@ -9,7 +9,7 @@
MODULE mp_images MODULE mp_images
!---------------------------------------------------------------------------- !----------------------------------------------------------------------------
! !
USE mp, ONLY : mp_barrier, mp_bcast, mp_size, mp_rank USE mp, ONLY : mp_barrier, mp_bcast, mp_size, mp_rank, mp_comm_split
USE io_global, ONLY : ionode, ionode_id USE io_global, ONLY : ionode, ionode_id
USE parallel_include USE parallel_include
! !
@ -40,7 +40,7 @@ CONTAINS
IMPLICIT NONE IMPLICIT NONE
INTEGER, INTENT(IN) :: nimage_, parent_comm INTEGER, INTENT(IN) :: nimage_, parent_comm
! !
INTEGER :: parent_nproc, parent_mype, ierr = 0 INTEGER :: parent_nproc, parent_mype
! !
! ... nothing needed to be done in serial calculation ! ... nothing needed to be done in serial calculation
! !
@ -75,19 +75,15 @@ CONTAINS
! !
! ... the intra_image_comm communicator is created ! ... the intra_image_comm communicator is created
! !
CALL MPI_COMM_SPLIT ( parent_comm, my_image_id, parent_mype, & CALL mp_comm_split ( parent_comm, my_image_id, parent_mype, &
intra_image_comm, ierr ) intra_image_comm )
IF ( ierr /= 0 ) CALL errore &
( 'mp_start_images', 'intra image communicator initialization', ABS(ierr) )
! !
CALL mp_barrier( parent_comm ) CALL mp_barrier( parent_comm )
! !
! ... the inter_image_comm communicator is created ! ... the inter_image_comm communicator is created
! !
CALL MPI_COMM_SPLIT( parent_comm, me_image, parent_mype, & CALL mp_comm_split ( parent_comm, me_image, parent_mype, &
inter_image_comm, ierr ) inter_image_comm )
IF ( ierr /= 0 ) CALL errore &
( 'mp_start_images', 'inter image communicator initialization', ABS(ierr) )
! !
! ... set processor that performs I/O ! ... set processor that performs I/O
! !

View File

@ -9,7 +9,7 @@
MODULE mp_pools MODULE mp_pools
!---------------------------------------------------------------------------- !----------------------------------------------------------------------------
! !
USE mp, ONLY : mp_barrier, mp_size, mp_rank USE mp, ONLY : mp_barrier, mp_size, mp_rank, mp_comm_split
USE parallel_include USE parallel_include
! !
IMPLICIT NONE IMPLICIT NONE
@ -44,7 +44,7 @@ CONTAINS
! !
INTEGER, INTENT(IN) :: npool_, parent_comm INTEGER, INTENT(IN) :: npool_, parent_comm
! !
INTEGER :: parent_nproc = 1, parent_mype = 0, ierr = 0 INTEGER :: parent_nproc = 1, parent_mype = 0
! !
#if defined (__MPI) #if defined (__MPI)
! !
@ -76,19 +76,13 @@ CONTAINS
! !
! ... the intra_pool_comm communicator is created ! ... the intra_pool_comm communicator is created
! !
CALL MPI_COMM_SPLIT( parent_comm, my_pool_id, parent_mype, intra_pool_comm, ierr ) CALL mp_comm_split ( parent_comm, my_pool_id, parent_mype, intra_pool_comm )
!
IF ( ierr /= 0 ) CALL errore( 'mp_start_pools', &
'intra pool communicator initialization', ABS(ierr) )
! !
CALL mp_barrier( parent_comm ) CALL mp_barrier( parent_comm )
! !
! ... the inter_pool_comm communicator is created ! ... the inter_pool_comm communicator is created
! !
CALL MPI_COMM_SPLIT( parent_comm, me_pool, parent_mype, inter_pool_comm, ierr ) CALL mp_comm_split ( parent_comm, me_pool, parent_mype, inter_pool_comm )
!
IF ( ierr /= 0 ) CALL errore( 'mp_start_pools', &
'inter pool communicator initialization', ABS(ierr) )
! !
#endif #endif
! !

View File

@ -9,7 +9,7 @@
MODULE mp_pots MODULE mp_pots
!---------------------------------------------------------------------------- !----------------------------------------------------------------------------
! !
USE mp, ONLY : mp_barrier, mp_size, mp_rank USE mp, ONLY : mp_barrier, mp_size, mp_rank, mp_comm_split
USE parallel_include USE parallel_include
! !
IMPLICIT NONE IMPLICIT NONE
@ -41,7 +41,7 @@ CONTAINS
! !
INTEGER, INTENT(IN) :: npot_, parent_comm INTEGER, INTENT(IN) :: npot_, parent_comm
! !
INTEGER :: parent_nproc = 1, parent_mype = 0, ierr = 0 INTEGER :: parent_nproc = 1, parent_mype = 0
! !
#if defined (__MPI) #if defined (__MPI)
! !
@ -74,19 +74,13 @@ CONTAINS
! !
! ... the intra_pot_comm communicator is created ! ... the intra_pot_comm communicator is created
! !
CALL MPI_COMM_SPLIT( parent_comm, my_pot_id, parent_mype, intra_pot_comm, ierr ) CALL mp_comm_split( parent_comm, my_pot_id, parent_mype, intra_pot_comm )
!
IF ( ierr /= 0 ) CALL errore( 'mp_start_pots', &
'intra pot communicator initialization', ABS(ierr) )
! !
CALL mp_barrier( parent_comm ) CALL mp_barrier( parent_comm )
! !
! ... the inter_pot_comm communicator is created ! ... the inter_pot_comm communicator is created
! !
CALL MPI_COMM_SPLIT( parent_comm, me_pot, parent_mype, inter_pot_comm, ierr ) CALL mp_comm_split( parent_comm, me_pot, parent_mype, inter_pot_comm )
!
IF ( ierr /= 0 ) &
CALL errore( 'mp_start_pots', 'inter pot communicator initialization', ABS(ierr) )
! !
#endif #endif
! !