Commit 4eaa3126 authored by giannozz's avatar giannozz

Calls to mpi_comm_split replaced by interface mp_comm_split


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/[email protected] c92efa57-630b-4861-b058-cf58834340f0
parent 7c20113e
......@@ -294,24 +294,21 @@ subroutine seqopn (unit, extension, formatt, exst, tmp_dir_)
else
tempfile = trim(tmp_dir) // trim(filename)
end if
if ( trim(nd_nmbr) == '1' .or. trim(nd_nmbr) == '01'.or. &
trim(nd_nmbr) == '001' .or. trim(nd_nmbr) == '0001'.or. &
trim(nd_nmbr) == '00001' .or. trim(nd_nmbr) == '000001' ) then
if ( trim(nd_nmbr) /= '1' .and. trim(nd_nmbr) /= '01' .and. &
trim(nd_nmbr) /= '001' .and. trim(nd_nmbr) /= '0001' .and. &
trim(nd_nmbr) /= '00001' .and. trim(nd_nmbr) /= '000001' ) then
!
! do not add processor number to files opened by processor 1
! in parallel execution: if only the first processor writes,
! we do not want the filename to be dependent on the number
! of processors
!
!tempfile = tempfile
else
tempfile = trim(tempfile) // nd_nmbr
end if
inquire (file = tempfile, exist = exst)
!
! Open the file
!
open (unit = unit, file = tempfile, form = formatt, status = &
'unknown', iostat = ios)
......
......@@ -52,6 +52,7 @@ constraints_module.o : kind.o
control_flags.o : kind.o
control_flags.o : parameters.o
dspev_drv.o : kind.o
dspev_drv.o : mp.o
dspev_drv.o : mp_bands.o
dspev_drv.o : mp_diag.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 : parallel_include.o
mp_global.o : command_line_options.o
mp_global.o : mp.o
mp_global.o : mp_bands.o
mp_global.o : mp_diag.o
mp_global.o : mp_images.o
......
......@@ -9,7 +9,7 @@
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
!
IMPLICIT NONE
......@@ -51,7 +51,7 @@ CONTAINS
INTEGER, INTENT(IN) :: nband_, parent_comm
INTEGER, INTENT(IN), OPTIONAL :: ntg_
!
INTEGER :: parent_nproc = 1, parent_mype = 0, ierr = 0
INTEGER :: parent_nproc = 1, parent_mype = 0
!
#if defined (__MPI)
!
......@@ -84,19 +84,13 @@ CONTAINS
!
! ... the intra_bgrp_comm communicator is created
!
CALL MPI_COMM_SPLIT( parent_comm, my_bgrp_id, parent_mype, intra_bgrp_comm, ierr )
!
IF ( ierr /= 0 ) CALL errore( 'mp_start_bands', &
'intra band group communicator initialization', ABS(ierr) )
CALL mp_comm_split( parent_comm, my_bgrp_id, parent_mype, intra_bgrp_comm )
!
CALL mp_barrier( parent_comm )
!
! ... the inter_bgrp_comm communicator is created
!
CALL MPI_COMM_SPLIT( parent_comm, me_bgrp, parent_mype, inter_bgrp_comm, ierr )
!
IF ( ierr /= 0 ) CALL errore( 'mp_start_bands', &
'inter band group communicator initialization', ABS(ierr) )
CALL mp_comm_split( parent_comm, me_bgrp, parent_mype, inter_bgrp_comm )
!
IF ( PRESENT(ntg_) ) THEN
ntask_groups = ntg_
......@@ -112,7 +106,7 @@ CONTAINS
IMPLICIT NONE
INTEGER, INTENT(IN) :: comm, nbnd
INTEGER :: npe, myrank, ierror, rest, k
INTEGER :: npe, myrank, rest, k
myrank = mp_rank(comm)
npe = mp_size(comm)
......
......@@ -9,7 +9,7 @@
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
! for scalapack
......@@ -193,9 +193,7 @@ CONTAINS
!
! initialize the communicator for the new group by splitting the input communicator
!
CALL MPI_COMM_SPLIT( comm_all, color, key, ortho_comm, ierr )
IF( ierr /= 0 ) &
CALL errore( " init_ortho_group ", " initializing ortho group communicator ", ierr )
CALL mp_comm_split ( comm_all, color, key, ortho_comm )
!
! Computes coordinates of the processors, in row maior order
!
......@@ -213,8 +211,8 @@ CONTAINS
IF( me_ortho1*leg_ortho /= me_all ) &
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 MPI_COMM_SPLIT( ortho_comm, me_ortho(1), me_ortho(2), ortho_row_comm, ierr )
CALL mp_comm_split( ortho_comm, me_ortho(2), me_ortho(1), ortho_col_comm)
CALL mp_comm_split( ortho_comm, me_ortho(1), me_ortho(2), ortho_row_comm)
else
ortho_comm_id = 0
......
......@@ -9,7 +9,7 @@
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 parallel_include
!
......@@ -40,7 +40,7 @@ CONTAINS
IMPLICIT NONE
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
!
......@@ -75,19 +75,15 @@ CONTAINS
!
! ... the intra_image_comm communicator is created
!
CALL MPI_COMM_SPLIT ( parent_comm, my_image_id, parent_mype, &
intra_image_comm, ierr )
IF ( ierr /= 0 ) CALL errore &
( 'mp_start_images', 'intra image communicator initialization', ABS(ierr) )
CALL mp_comm_split ( parent_comm, my_image_id, parent_mype, &
intra_image_comm )
!
CALL mp_barrier( parent_comm )
!
! ... the inter_image_comm communicator is created
!
CALL MPI_COMM_SPLIT( parent_comm, me_image, parent_mype, &
inter_image_comm, ierr )
IF ( ierr /= 0 ) CALL errore &
( 'mp_start_images', 'inter image communicator initialization', ABS(ierr) )
CALL mp_comm_split ( parent_comm, me_image, parent_mype, &
inter_image_comm )
!
! ... set processor that performs I/O
!
......
......@@ -9,7 +9,7 @@
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
!
IMPLICIT NONE
......@@ -44,7 +44,7 @@ CONTAINS
!
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)
!
......@@ -76,19 +76,13 @@ CONTAINS
!
! ... the intra_pool_comm communicator is created
!
CALL MPI_COMM_SPLIT( parent_comm, my_pool_id, parent_mype, intra_pool_comm, ierr )
!
IF ( ierr /= 0 ) CALL errore( 'mp_start_pools', &
'intra pool communicator initialization', ABS(ierr) )
CALL mp_comm_split ( parent_comm, my_pool_id, parent_mype, intra_pool_comm )
!
CALL mp_barrier( parent_comm )
!
! ... the inter_pool_comm communicator is created
!
CALL MPI_COMM_SPLIT( parent_comm, me_pool, parent_mype, inter_pool_comm, ierr )
!
IF ( ierr /= 0 ) CALL errore( 'mp_start_pools', &
'inter pool communicator initialization', ABS(ierr) )
CALL mp_comm_split ( parent_comm, me_pool, parent_mype, inter_pool_comm )
!
#endif
!
......
......@@ -9,7 +9,7 @@
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
!
IMPLICIT NONE
......@@ -41,7 +41,7 @@ CONTAINS
!
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)
!
......@@ -74,19 +74,13 @@ CONTAINS
!
! ... the intra_pot_comm communicator is created
!
CALL MPI_COMM_SPLIT( parent_comm, my_pot_id, parent_mype, intra_pot_comm, ierr )
!
IF ( ierr /= 0 ) CALL errore( 'mp_start_pots', &
'intra pot communicator initialization', ABS(ierr) )
CALL mp_comm_split( parent_comm, my_pot_id, parent_mype, intra_pot_comm )
!
CALL mp_barrier( parent_comm )
!
! ... the inter_pot_comm communicator is created
!
CALL MPI_COMM_SPLIT( parent_comm, me_pot, parent_mype, inter_pot_comm, ierr )
!
IF ( ierr /= 0 ) &
CALL errore( 'mp_start_pots', 'inter pot communicator initialization', ABS(ierr) )
CALL mp_comm_split( parent_comm, me_pot, parent_mype, inter_pot_comm )
!
#endif
!
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment