Count how many subcommunicators will be created
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fieldmat_type), | intent(inout) | :: | self |
subroutine fm_count_subcom(self)
use mp, only: iproc, barrier, nproc
implicit none
class(fieldmat_type), intent(inout) :: self
integer :: ik, is, ip
integer :: nsub_tot, nsub_proc
!Initialise
nsub_tot=2 !Subcom belonging to fieldmat object
nsub_proc=nsub_tot
!Now get children
do ik=1,self%naky
nsub_tot=nsub_tot+2
if(self%kyb(ik)%is_local) nsub_proc=nsub_proc+2
do is=1,self%kyb(ik)%nsupercell
nsub_tot=nsub_tot+2
if(self%kyb(ik)%supercells(is)%is_local) nsub_proc=nsub_proc+2
enddo
enddo
!Now report
if(iproc==0) write(dlun,'("Total number of subcommunicators is ",I0)') nsub_tot
do ip=0,nproc-1
if(ip==iproc) write(dlun,'("Number of subcommunicators on ",I0," is ",I0)') iproc, nsub_proc
call barrier
enddo
if(iproc==0)write(dlun,'()')
end subroutine fm_count_subcom