The Elk Code
genpmat.f90
Go to the documentation of this file.
1 
2 ! Copyright (C) 2015 J. K. Dewhurst, S. Sharma and E. K. U. Gross.
3 ! This file is distributed under the terms of the GNU General Public License.
4 ! See the file COPYING for license details.
5 
6 subroutine genpmat
7 use modmain
8 use modmpi
9 use modomp
10 implicit none
11 ! local variables
12 integer ik,nthd
13 if (mp_mpi) write(*,*)
14 ! synchronise MPI processes
15 call mpi_barrier(mpicom,ierror)
16 call holdthd(nkpt/np_mpi,nthd)
17 !$OMP PARALLEL DO DEFAULT(SHARED) &
18 !$OMP SCHEDULE(DYNAMIC) &
19 !$OMP NUM_THREADS(nthd)
20 do ik=1,nkpt
21 ! distribute among MPI processes
22  if (mod(ik-1,np_mpi) /= lp_mpi) cycle
23 !$OMP CRITICAL(genpmat_)
24  write(*,'("Info(genpmat): ",I6," of ",I6," k-points")') ik,nkpt
25 !$OMP END CRITICAL(genpmat_)
26  call putpmat(ik)
27 end do
28 !$OMP END PARALLEL DO
29 call freethd(nthd)
30 ! synchronise MPI processes
31 call mpi_barrier(mpicom,ierror)
32 end subroutine
33 
logical mp_mpi
Definition: modmpi.f90:17
integer nkpt
Definition: modmain.f90:461
Definition: modomp.f90:6
integer np_mpi
Definition: modmpi.f90:13
subroutine putpmat(ik)
Definition: putpmat.f90:7
Definition: modmpi.f90:6
subroutine genpmat
Definition: genpmat.f90:7
integer lp_mpi
Definition: modmpi.f90:15
subroutine freethd(nthd)
Definition: modomp.f90:106
subroutine holdthd(nloop, nthd)
Definition: modomp.f90:78
integer mpicom
Definition: modmpi.f90:11
integer ierror
Definition: modmpi.f90:19