The Elk Code
 
Loading...
Searching...
No Matches
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
6subroutine genpmat
7use modmain
8use modmpi
9use modomp
10implicit none
11! local variables
12integer ik,nthd
13if (mp_mpi) write(*,*)
14! synchronise MPI processes
15call mpi_barrier(mpicom,ierror)
16call holdthd(nkpt/np_mpi,nthd)
17!$OMP PARALLEL DO DEFAULT(SHARED) &
18!$OMP SCHEDULE(DYNAMIC) &
19!$OMP NUM_THREADS(nthd)
20do 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)
27end do
28!$OMP END PARALLEL DO
29call freethd(nthd)
30! synchronise MPI processes
31call mpi_barrier(mpicom,ierror)
32end subroutine
33
subroutine genpmat
Definition genpmat.f90:7
integer nkpt
Definition modmain.f90:461
integer lp_mpi
Definition modmpi.f90:15
integer ierror
Definition modmpi.f90:19
integer mpicom
Definition modmpi.f90:11
integer np_mpi
Definition modmpi.f90:13
logical mp_mpi
Definition modmpi.f90:17
subroutine holdthd(nloop, nthd)
Definition modomp.f90:78
subroutine freethd(nthd)
Definition modomp.f90:106
subroutine putpmat(ik)
Definition putpmat.f90:7