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

          Line data    Source code
       1             : !--------------------------------------------------------------------------------
       2             : ! Copyright (c) 2016 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_st
       8             :   !**********************************************************************
       9             :   !     mpi_bc_st :  broadcast all information for qpw_to_nmt
      10             :   !     mpi_col_st:  collect the density from pe's 
      11             :   !**********************************************************************
      12             : CONTAINS
      13         172 :   SUBROUTINE mpi_bc_st(mpi,stars,qpwc)
      14             :     !
      15             :     USE m_types
      16             :     IMPLICIT NONE
      17             : 
      18             :     TYPE(t_mpi),INTENT(IN)     :: mpi
      19             :     TYPE(t_stars),INTENT(IN)   :: stars
      20             :     !     ..
      21             :     !     .. Array Arguments ..
      22             :     COMPLEX :: qpwc(stars%ng3)
      23             :     !     ..
      24             :     !     ..
      25             :     !     .. Local Arrays ..
      26             :     INTEGER ierr(3)
      27             :     !     ..
      28             :     !     .. External Subroutines.. 
      29             :     EXTERNAL MPI_BCAST
      30             :     !     ..
      31             :     INCLUDE 'mpif.h'
      32             :     !
      33             :     !
      34             :     ! -> Broadcast the arrays:
      35             : 
      36         172 :     CALL MPI_BCAST(qpwc,stars%ng3,MPI_DOUBLE_COMPLEX,0,mpi%mpi_comm,ierr)
      37             : 
      38         172 :   END SUBROUTINE mpi_bc_st
      39             :   !*********************************************************************
      40         172 :   SUBROUTINE mpi_col_st(mpi,atoms,sphhar,rho)
      41             :     !
      42             : #include"cpp_double.h"
      43             :     USE m_types
      44             :     IMPLICIT NONE
      45             : 
      46             :     TYPE(t_mpi),INTENT(IN)     :: mpi
      47             :     TYPE(t_sphhar),INTENT(IN)  :: sphhar
      48             :     TYPE(t_atoms),INTENT(IN)   :: atoms
      49             :     INCLUDE 'mpif.h'
      50             :     EXTERNAL MPI_REDUCE
      51             :     !     ..
      52             :     !     .. Scalar Arguments ..
      53             :     REAL, INTENT (INOUT) :: rho(atoms%jmtd,0:sphhar%nlhd,atoms%ntype)
      54             : 
      55             :     INTEGER n
      56             :     INTEGER ierr(3)
      57             :     REAL, ALLOCATABLE :: r_b(:)
      58             : 
      59         172 :     n = atoms%jmtd*(sphhar%nlhd+1)*atoms%ntype
      60         172 :     ALLOCATE(r_b(n))
      61             :     CALL MPI_REDUCE(rho,r_b,n,MPI_DOUBLE_PRECISION,MPI_SUM,0,&
      62         172 :          &                                       mpi%mpi_comm,ierr)
      63         172 :     IF (mpi%irank == 0) rho=reshape(r_b,(/atoms%jmtd,1+sphhar%nlhd,atoms%ntype/))
      64             : 
      65         172 :     DEALLOCATE(r_b) 
      66             : 
      67         172 :   END SUBROUTINE mpi_col_st
      68             :   !*********************************************************************
      69             : END MODULE m_mpi_bc_st

Generated by: LCOV version 1.13