LCOV - code coverage report
Current view: top level - mpi - mpi_bc_potden.F90 (source / functions) Hit Total Coverage
Test: combined.info Lines: 33 34 97.1 %
Date: 2019-09-08 04:53:50 Functions: 1 1 100.0 %

          Line data    Source code
       1             : !--------------------------------------------------------------------------------
       2             : ! Copyright (c) 2017 Peter Grünberg Institut, Forschungszentrum Jülich, Germany
       3             : ! This file is part of FLEUR and available as free software under the conditions
       4             : ! of the MIT license as expressed in the LICENSE file in more detail.
       5             : !--------------------------------------------------------------------------------
       6             : 
       7             : MODULE m_mpi_bc_potden
       8             : CONTAINS
       9        2030 :    SUBROUTINE mpi_bc_potden(mpi,stars,sphhar,atoms,input,vacuum,oneD,noco,potden)
      10             : 
      11             :    USE m_types
      12             :    USE m_constants
      13             :    IMPLICIT NONE
      14             :    INCLUDE 'mpif.h'
      15             : 
      16             :    TYPE(t_mpi),INTENT(IN)        :: mpi
      17             :    TYPE(t_input),INTENT(IN)      :: input
      18             :    TYPE(t_vacuum),INTENT(IN)     :: vacuum
      19             :    TYPE(t_stars),INTENT(IN)      :: stars
      20             :    TYPE(t_sphhar),INTENT(IN)     :: sphhar
      21             :    TYPE(t_atoms),INTENT(IN)      :: atoms
      22             :    TYPE(t_noco),INTENT(IN)       :: noco
      23             :    TYPE(t_oneD),INTENT(IN)       :: oneD
      24             :    TYPE(t_potden),INTENT(INOUT)  :: potden
      25             : 
      26             :    INTEGER :: n, ierr(3)
      27             :    LOGICAL :: l_nocoAlloc, l_denMatAlloc, l_vaczAlloc, l_pw_wAlloc
      28             : 
      29        2030 :    CALL MPI_BCAST(potden%iter,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
      30        2030 :    CALL MPI_BCAST(potden%potdenType,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
      31             : 
      32        2030 :    l_nocoAlloc = .FALSE.
      33        2030 :    l_denMatAlloc = .FALSE.
      34        2030 :    l_vaczAlloc = .FALSE.
      35        2030 :    l_pw_wAlloc = .FALSE.
      36        2030 :    IF(mpi%irank.EQ.0) THEN
      37        1015 :       IF (ALLOCATED(potden%mmpMat)) l_denMatAlloc = .TRUE.
      38        1015 :       IF (ALLOCATED(potden%vacz)) l_vaczAlloc = .TRUE.
      39        1015 :       IF (ALLOCATED(potden%pw_w)) l_pw_wAlloc = .TRUE.
      40             :    END IF
      41        2030 :    CALL MPI_BCAST(l_nocoAlloc,1,MPI_LOGICAL,0,mpi%mpi_comm,ierr)
      42        2030 :    CALL MPI_BCAST(l_denMatAlloc,1,MPI_LOGICAL,0,mpi%mpi_comm,ierr)
      43        2030 :    CALL MPI_BCAST(l_vaczAlloc,1,MPI_LOGICAL,0,mpi%mpi_comm,ierr)
      44        2030 :    CALL MPI_BCAST(l_pw_wAlloc,1,MPI_LOGICAL,0,mpi%mpi_comm,ierr)
      45        2030 :    IF((mpi%irank.NE.0).AND.l_denMatAlloc) THEN
      46        1015 :       IF(.NOT.ALLOCATED(potden%mmpMat)) THEN
      47           0 :          ALLOCATE(potDen%mmpMat(-lmaxU_const:lmaxU_const,-lmaxU_const:lmaxU_const,MAX(1,atoms%n_u),input%jspins))
      48             :       END IF
      49             :    END IF
      50             : 
      51        2030 :    n = stars%ng3 * SIZE(potden%pw,2)
      52        2030 :    CALL MPI_BCAST(potden%pw,n,MPI_DOUBLE_COMPLEX,0,mpi%mpi_comm,ierr)
      53             : 
      54        2030 :    n = atoms%jmtd * (sphhar%nlhd+1) * atoms%ntype * input%jspins
      55        2030 :    CALL MPI_BCAST(potden%mt,n,MPI_DOUBLE_PRECISION,0,mpi%mpi_comm,ierr)
      56             : 
      57        2030 :    IF (l_pw_wAlloc) THEN
      58        1360 :       n = stars%ng3 * SIZE(potden%pw_w,2)
      59        1360 :       CALL MPI_BCAST(potden%pw_w,n,MPI_DOUBLE_COMPLEX,0,mpi%mpi_comm,ierr)
      60             :    END IF
      61             : 
      62        2030 :    IF (l_vaczAlloc) THEN
      63        2030 :       n = vacuum%nmzd * 2 * SIZE(potden%vacz,3)
      64        2030 :       CALL MPI_BCAST(potden%vacz,n,MPI_DOUBLE_PRECISION,0,mpi%mpi_comm,ierr)
      65             : 
      66        2030 :       n = vacuum%nmzxyd * (stars%ng2-1) * 2 * SIZE(potden%vacxy,4)
      67        2030 :       CALL MPI_BCAST(potden%vacxy,n,MPI_DOUBLE_COMPLEX,0,mpi%mpi_comm,ierr)
      68             :    END IF
      69             : 
      70        2030 :    IF (l_denMatAlloc) THEN
      71        2030 :       n = SIZE(potden%mmpMat,1) * SIZE(potden%mmpMat,2) * SIZE(potden%mmpMat,3) * SIZE(potden%mmpMat,4)
      72        2030 :       CALL MPI_BCAST(potden%mmpMat,n,MPI_DOUBLE_COMPLEX,0,mpi%mpi_comm,ierr)
      73             :    END IF
      74             : 
      75        2030 :    END SUBROUTINE mpi_bc_potden
      76             : END MODULE m_mpi_bc_potden

Generated by: LCOV version 1.13