Commit 8371c8e9 authored by sponce's avatar sponce

Pre-processing macro #if defined


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@12980 c92efa57-630b-4861-b058-cf58834340f0
parent 02ad44cd
......@@ -17,7 +17,7 @@
!! In this routine the first processor sends the input to all
!! the other processors
!!
#ifdef __MPI
#if defined(__MPI)
USE phcom, ONLY : zue, trans, tr2_ph, recover, nmix_ph, niter_ph, &
lnscf, ldisp, fildvscf, fildrho, epsil, alpha_mix
USE epwcom, ONLY : epexst, epbwrite, ep_coupling, &
......@@ -205,7 +205,7 @@ END SUBROUTINE bcast_ph_input
SUBROUTINE bcast_ph_input1
!-----------------------------------------------------------------------
!
#ifdef __MPI
#if defined(__MPI)
USE pwcom
USE phcom
USE mp, ONLY: mp_bcast
......
......@@ -39,7 +39,7 @@
nkf_mesh = nkqtotf / 2
nbndfs = ibndmax - ibndmin + 1
!
#ifdef __MPI
#if defined(__MPI)
IF ( .not. ALLOCATED(memlt_pool) ) ALLOCATE(memlt_pool(npool))
memlt_pool(:) = 0.d0
#else
......
......@@ -428,7 +428,7 @@
USE constants, ONLY : eps8
USE fft_base, ONLY : dfftp
USE kfold
#ifdef __NAG
#if defined(__NAG)
USE f90_unix_io, ONLY : flush
#endif
USE mp_global, ONLY : inter_pool_comm
......@@ -709,7 +709,7 @@ ngms = 0
j = mill_g(2, ng)
k = mill_g(3, ng)
#ifdef __MPI
#if defined(__MPI)
m1 = MOD (i, dfftp%nr1) + 1
IF (m1.LT.1) m1 = m1 + dfftp%nr1
m2 = MOD (j, dfftp%nr2) + 1
......
......@@ -127,7 +127,7 @@
fact1 = CMPLX (0.d0, - tpiba * omega, kind=DP)
!
tempfile = trim(tmp_dir) // trim(prefix) // '.recover'
#ifdef __MPI
#if defined(__MPI)
CALL set_ndnmbr (0,my_pool_id+1,1,npool,filelab)
tempfile = trim(tmp_dir) // trim(prefix) // '.recover' // filelab
#endif
......
......@@ -568,7 +568,7 @@
!
DO ipool = 1, npool ! nr of pools
CALL set_ndnmbr(0,ipool,1,npool,filelab)
#ifdef __MPI
#if defined(__MPI)
filephmat = trim(tmp_dir) // trim(prefix) // '.ephmat' // filelab
#else
filephmat = trim(tmp_dir) // trim(prefix) // '.ephmat'
......@@ -602,7 +602,7 @@
nnq(:) = 0
DO ipool = 1, npool ! nr of pools
CALL set_ndnmbr(0,ipool,1,npool,filelab)
#ifdef __MPI
#if defined(__MPI)
filephmat = trim(tmp_dir) // trim(prefix) // '.ephmat' // filelab
#else
filephmat = trim(tmp_dir) // trim(prefix) // '.ephmat'
......
......@@ -610,7 +610,7 @@
REAL(DP) :: rmelt
!
! This is only a quick fix since the subroutine was written for parallel execution - FG June 2014
#ifndef __MPI
#ifndef __MPI
my_pool_id = 0
#endif
!
......
......@@ -57,7 +57,7 @@
USE noncollin_module, ONLY : m_loc
USE iotk_module, ONLY : iotk_open_read, iotk_scan_dat, iotk_free_unit,&
iotk_close_read
#ifdef __NAG
#if defined(__NAG)
USE f90_unix_io, ONLY : flush
#endif
! --------------------------------------------------------------
......
......@@ -62,7 +62,7 @@
INTEGER :: ierr
!! Return if there is an error
!integer(kind=8) :: lrepmatw, lrepmatw2
#ifdef __MPI
#if defined(__MPI)
INTEGER (kind=MPI_OFFSET_KIND) :: lrepmatw
!! Offset to tell where to start reading the file
INTEGER (kind=MPI_OFFSET_KIND) :: lrepmatw2
......@@ -103,7 +103,7 @@
CALL errore ('ephwan2blochp', 'Problem with parallel_k/q scheme', nrr_q)
ENDIF
!
#ifdef __MPI
#if defined(__MPI)
IF (.NOT. etf_mem) then
! Check for directory given by "outdir"
!
......@@ -137,7 +137,7 @@
ALLOCATE(epmatw ( nbnd, nbnd, nrr_k, nmodes))
!
!lrepmatw2 = 2 * nbnd * nbnd * nrr_k * nmodes
#ifdef __MPI
#if defined(__MPI)
! Although this should almost never be problematic (see explaination below)
lrepmatw2 = 2_MPI_OFFSET_KIND * INT( nbnd , kind = MPI_OFFSET_KIND ) * &
INT( nbnd , kind = MPI_OFFSET_KIND ) * &
......@@ -148,7 +148,7 @@
#endif
!
DO ir = ir_start, ir_stop
#ifdef __MPI
#if defined(__MPI)
! DEBUG: print*,'Process ',my_id,' do ',ir,'/ ',ir_stop
!
! Direct read of epmatwp for this ir
......@@ -185,7 +185,7 @@
DEALLOCATE(epmatw)
ENDIF
!
#ifdef __MPI
#if defined(__MPI)
IF (parallel_k) CALL mp_sum(eptmp, world_comm)
IF (.NOT. etf_mem) then
CALL MPI_FILE_CLOSE(iunepmatwp2,ierr)
......
......@@ -50,7 +50,7 @@
ibndmin, ibndmax, lambda_all, dmec, dmef, vmef, &
sigmai_all, sigmai_mode, gamma_all, epsi, zstar, &
efnew
#ifdef __NAG
#if defined(__NAG)
USE f90_unix_io, ONLY : flush
#endif
USE mp, ONLY : mp_barrier, mp_bcast, mp_sum
......@@ -1101,7 +1101,7 @@
USE io_files, ONLY : prefix, diropn
USE io_epw, ONLY : epwdata, iundmedata, iunvmedata, iunksdata, iunepmatwp
USE constants_epw, ONLY : czero
#ifdef __NAG
#if defined(__NAG)
USE f90_unix_io,ONLY : flush
#endif
USE io_global, ONLY : ionode_id
......
......@@ -170,7 +170,7 @@
IF(.not. ALLOCATED(igk_k_all) ) ALLOCATE(igk_k_all( npwx, nkstot))
IF(.not. ALLOCATED(ngk_all) ) ALLOCATE(ngk_all(nkstot))
!
#ifdef __MPI
#if defined(__MPI)
!
CALL poolgather_int (npwx, nkstot, nks, igk_k(:,1:nks), igk_k_all )
CALL poolgather_int1 (nkstot, nks, ngk(1:nks), ngk_all )
......
......@@ -68,7 +68,7 @@
USE constants, ONLY : AMU_RY
USE control_lr, ONLY : lgamma
USE mp_global, ONLY : my_pool_id, me_pool
#ifdef __NAG
#if defined(__NAG)
USE F90_UNIX_ENV, ONLY : iargc, getarg
#endif
!
......@@ -425,7 +425,7 @@
!
! reading the namelist inputepw
!
#ifdef CRAYY
#if defined(__CRAYY)
! The Cray does not accept "err" and "iostat" together with a namelist
READ (5, inputepw)
ios = 0
......@@ -604,7 +604,7 @@
! nbnd comes out of readfile
IF (nbndsub.eq.0) nbndsub = nbnd
!
#ifdef __MPI
#if defined(__MPI)
IF (.not.(me_pool /=0 .or. my_pool_id /=0)) THEN
nk1 = nk1tmp
nk2 = nk2tmp
......
......@@ -28,7 +28,7 @@
USE lr_symm_base, ONLY : irotmq, minus_q, nsymq, irgq
USE control_flags, ONLY : iverbosity
USE fft_base, ONLY : dfftp, dffts
#ifdef __NAG
#if defined(__NAG)
USE f90_unix_io, ONLY : flush
#endif
implicit none
......
......@@ -21,7 +21,7 @@
integer :: ik0
integer :: nkl, nkr, iks
!
#ifdef __MPI
#if defined(__MPI)
!
! number of kpoint blocks, kpoints per pool and reminder
!
......@@ -65,7 +65,7 @@
! input: nktot k-points splited over pools
! output : lower_bnd, upper_bnd lower and upper bound for each pool
!
#ifdef __MPI
#if defined(__MPI)
!
INTEGER :: nkl, nkr
!
......
......@@ -127,7 +127,7 @@
! In the parallel case we have to find the corresponding pool
! and index in the pool
!
#ifdef __MPI
#if defined(__MPI)
!
npool = nproc_image/nproc_pool
!
......@@ -177,7 +177,7 @@ subroutine ckbounds(lower, upper)
implicit none
integer, intent(out):: lower, upper
!
#ifdef __MPI
#if defined(__MPI)
!
integer :: nkst, nkstott, rest
!
......@@ -215,7 +215,7 @@ subroutine para_bounds(lower, upper, total)
integer, intent(out):: lower, upper
integer, intent(in):: total
!
#ifdef __MPI
#if defined(__MPI)
!
integer :: rest, nrst
!
......
......@@ -176,7 +176,7 @@ SUBROUTINE loadkmesh_para
ENDIF
ENDIF
!
#ifdef __MPI
#if defined(__MPI)
CALL mp_bcast (nkqtotf, ionode_id, inter_pool_comm)
!
! scatter the k points of the fine mesh across the pools
......
......@@ -122,7 +122,7 @@ SUBROUTINE loadqmesh_para
ENDIF
ENDIF
!
#ifdef __MPI
#if defined(__MPI)
CALL mp_bcast (nqtotf, ionode_id, inter_pool_comm)
!
! scatter the q points of the fine mesh across the pools
......
......@@ -29,7 +29,7 @@
wkf, xqf, wqf, nkqf, &
nkf, nkqtotf, xqf
USE constants_epw, ONLY : ryd2ev, two, pi
#ifdef __NAG
#if defined(__NAG)
USE f90_unix_io, ONLY : flush
#endif
USE mp, ONLY : mp_barrier,mp_sum
......@@ -210,7 +210,7 @@
wkf, xqf, wqf, nkqf, nqf, nqtotf, &
nkqtotf, xqf, gamma_nest
USE constants_epw, ONLY : ryd2ev, two, pi, zero
#ifdef __NAG
#if defined(__NAG)
USE f90_unix_io, ONLY : flush
#endif
USE mp, ONLY : mp_barrier,mp_sum, mp_bcast
......@@ -368,7 +368,7 @@
xqf_all(:,:) = zero
wqf_all(:,:) = zero
!
#ifdef __MPI
#if defined(__MPI)
!
! note that poolgather2 works with the doubled grid (k and k+q)
!
......
......@@ -106,7 +106,7 @@
IF ( .not. ALLOCATED(xkf_all) ) ALLOCATE ( xkf_all( 3, nkqtotf))
IF ( .not. ALLOCATED(etf_all) ) ALLOCATE (etf_all( nbndsub, nkqtotf))
!
#ifdef __MPI
#if defined(__MPI)
CALL poolgather2( 3, nkqtotf, nkqf, xkf, xkf_all )
CALL poolgather2( nbndsub, nkqtotf, nkqf, etf, etf_all )
CALL mp_barrier(inter_pool_comm)
......
......@@ -35,7 +35,7 @@
REAL (KIND=DP), INTENT (out) :: f_out(nsize,nkstot)
!! output ( contains values for all k-point )
!
#ifdef __MPI
#if defined(__MPI)
INTEGER :: rest, nbase
! the rest of the integer division nkstot / npo
! the position in the original list
......@@ -86,7 +86,7 @@
REAL (KIND=DP), INTENT (out) :: f_out(nsize,nkstot)
! output ( contains values for all k-point )
!
#ifdef __MPI
#if defined(__MPI)
INTEGER :: rest, nbase, nkst
! the rest of the integer division nkstot / npo
! the position in the original list
......@@ -138,7 +138,7 @@
INTEGER, INTENT (out) :: f_out(nkstot)
!! output ( contains values for all k-point )
!
#ifdef __MPI
#if defined(__MPI)
INTEGER :: rest, nbase
! the rest of the integer division nkstot / npo
! the position in the original list
......@@ -189,7 +189,7 @@
INTEGER, INTENT (out) :: f_out(nsize,nkstot)
!! output ( contains values for all k-point )
!
#ifdef __MPI
#if defined(__MPI)
INTEGER :: rest, nbase
! the rest of the integer division nkstot / npo
! the position in the original list
......
......@@ -597,7 +597,7 @@ SUBROUTINE compute_amn_para
USE noncollin_module,ONLY : noncolin, npol
USE constants_epw, ONLY : czero, eps6
USE mp_global, ONLY : my_pool_id
#ifdef __NAG
#if defined(__NAG)
USE f90_unix_io, ONLY : flush
#endif
USE mp_global, ONLY : npool, intra_pool_comm, inter_pool_comm
......@@ -636,7 +636,7 @@ SUBROUTINE compute_amn_para
CALL init_us_1
ENDIF
!
#ifdef __MPI
#if defined(__MPI)
WRITE(stdout,'(6x,a,i5,a,i4,a)') 'k points = ',iknum, ' in ', npool, ' pools'
#endif
!
......@@ -789,7 +789,7 @@ SUBROUTINE compute_mmn_para
USE wannier, ONLY : m_mat, num_bands, nnb, iknum, g_kpb, kpb, ig_, &
excluded_band
USE constants_epw, ONLY : czero, twopi
#ifdef __NAG
#if defined(__NAG)
USE f90_unix_io, ONLY : flush
#endif
USE mp, ONLY : mp_sum
......@@ -911,7 +911,7 @@ SUBROUTINE compute_mmn_para
!
ALLOCATE( Mkb(nbnd,nbnd) )
!
#ifdef __MPI
#if defined(__MPI)
WRITE(stdout,'(6x,a,i5,a,i4,a)') 'k points = ',iknum, ' in ', npool, ' pools'
#endif
! get the first k-point in this pool
......@@ -1580,7 +1580,7 @@ SUBROUTINE write_plot
COMPLEX(DP),allocatable :: psic_small(:)
real(kind=DP) :: zero_vect(3)
!-------------------------------------------!
#ifdef __MPI
#if defined(__MPI)
integer nxxs
COMPLEX(DP),allocatable :: psic_all(:)
nxxs = dffts%nr1x * dffts%nr2x * dffts%nr3x
......@@ -1636,7 +1636,7 @@ SUBROUTINE write_plot
IF (gamma_only) psic(nlsm(igk_k (1:npw,ik) ) ) = conjg(evc (1:npw, ibnd))
CALL invfft ('Wave', psic, dffts)
IF (reduce_unk) pos=0
#ifdef __MPI
#if defined(__MPI)
CALL gather_grid(dffts,psic,psic_all)
!
IF (reduce_unk) THEN
......@@ -1698,7 +1698,7 @@ SUBROUTINE write_plot
!
IF (reduce_unk) DEALLOCATE(psic_small)
!
#ifdef __MPI
#if defined(__MPI)
DEALLOCATE( psic_all )
#endif
!
......
......@@ -30,12 +30,12 @@
USE epwcom, ONLY : dvscf_dir
USE noncollin_module, ONLY : nspin_mag
USE io_epw, ONLY : iudvscf
#ifdef __NAG
#if defined(__NAG)
USE,INTRINSIC :: f90_unix_file, ONLY:fstat, stat_t
#endif
!
implicit none
#ifdef __NAG
#if defined(__NAG)
TYPE(stat_t) :: statb
#endif
#ifndef __NAG
......@@ -81,7 +81,7 @@ integer :: fstat,statb(13)
!
! check that the binary file is long enough
! this is tricky to track through error dumps
#ifdef __NAG
#if defined(__NAG)
CALL fstat( iudvscf, statb, errno=ios)
IF (recn * unf_recl .gt. statb%st_size) call errore('readdvscf', &
trim(tempfile)//' too short, check ecut', iudvscf)
......
......@@ -72,7 +72,7 @@
!
ENDDO
!
#ifdef __MPI
#if defined(__MPI)
tmp = dble (ngxx)
CALL mp_max(tmp,inter_pool_comm)
ngxx = nint (tmp)
......
......@@ -47,7 +47,7 @@
# define DIRECT_IO_FACTOR 8
#endif
#ifdef __MPI
#if defined(__MPI)
tempfile = trim(tmp_dir) // trim(prefix) // '.wfc' // nd_nmbr0
# else
tempfile = trim(tmp_dir) // trim(prefix) // '.wfc'
......
......@@ -328,7 +328,7 @@
xkf_all(:,:) = zero
etf_all(:,:) = zero
!
#ifdef __MPI
#if defined(__MPI)
!
! note that poolgather2 works with the doubled grid (k and k+q)
!
......
......@@ -286,7 +286,7 @@
xkf_all(:,:) = zero
etf_all(:,:) = zero
!
#ifdef __MPI
#if defined(__MPI)
!
! note that poolgather2 works with the doubled grid (k and k+q)
!
......
......@@ -171,7 +171,7 @@
! write the e-ph matrix elements in the Bloch representation on the fine mesh
! in .ephmat files (one for each pool)
!
#ifdef __MPI
#if defined(__MPI)
CALL set_ndnmbr(0,my_pool_id+1,1,npool,filelab)
filephmat = trim(tmp_dir) // trim(prefix) // '.ephmat' // filelab
#else
......
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