LCOV - code coverage report
Current view: top level - mpi - mpi_dist_forcetheorem.F90 (source / functions) Hit Total Coverage
Test: combined.info Lines: 11 22 50.0 %
Date: 2019-09-08 04:53:50 Functions: 1 1 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_dist_forcetheorem
       8             : CONTAINS
       9             : #ifndef CPP_OLDINTEL
      10          76 :   SUBROUTINE mpi_dist_forcetheorem(mpi,forcetheo)
      11             :     USE m_types_mpi
      12             :     USE m_types_forcetheo, ONLY: t_forcetheo
      13             :     USE m_types_forcetheo_extended
      14             :     IMPLICIT NONE
      15             :     TYPE(t_mpi),INTENT(in)::mpi
      16             :     CLASS(t_forcetheo),ALLOCATABLE,INTENT(INOUT)::forcetheo
      17             : 
      18             :     INTEGER::t,ierr
      19             : #ifdef CPP_MPI
      20             :     INCLUDE 'mpif.h'
      21             :     
      22          76 :     IF (mpi%irank==0) THEN
      23             :        SELECT TYPE(forcetheo)
      24             :        TYPE IS (t_forcetheo)
      25          38 :           t=1
      26             :        TYPE IS (t_forcetheo_mae)
      27           0 :           t=2
      28             :        TYPE IS (t_forcetheo_ssdisp)
      29           0 :           t=3
      30             :        TYPE IS (t_forcetheo_dmi)
      31           0 :           t=4
      32             :        TYPE IS (t_forcetheo_jij)
      33           0 :           t=5
      34             :        END SELECT
      35             :     ENDIF   
      36          76 :     CALL MPI_BCAST(t,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
      37          76 :     IF (mpi%irank.NE.0) THEN
      38          38 :        IF (ALLOCATED(forcetheo)) DEALLOCATE(forcetheo)
      39          38 :        SELECT CASE (t)
      40             :        CASE(1)
      41          38 :           ALLOCATE(t_forcetheo::forcetheo)
      42             :        CASE(2)
      43           0 :           ALLOCATE(t_forcetheo_mae::forcetheo)
      44             :        CASE(3)
      45           0 :           ALLOCATE(t_forcetheo_ssdisp::forcetheo)
      46             :        CASE(4)
      47           0 :           ALLOCATE(t_forcetheo_dmi::forcetheo)
      48             :        CASE(5)
      49          38 :           ALLOCATE(t_forcetheo_jij::forcetheo)
      50             :        END SELECT
      51             :     END IF
      52             : 
      53             :     !now we have the correct type, now we have to distribute the data
      54             :     SELECT TYPE(forcetheo)
      55             :     TYPE IS (t_forcetheo_mae)
      56           0 :        CALL forcetheo%dist(mpi)
      57             :     TYPE IS (t_forcetheo_ssdisp)
      58           0 :        CALL forcetheo%dist(mpi)
      59             :     TYPE IS (t_forcetheo_dmi)
      60           0 :        CALL forcetheo%dist(mpi)
      61             :     TYPE IS (t_forcetheo_jij)
      62           0 :        CALL forcetheo%dist(mpi)
      63             :     END SELECT
      64             : #endif
      65          76 :   END SUBROUTINE mpi_dist_forcetheorem
      66             : #else
      67             : #endif
      68             : 
      69         152 : END MODULE m_mpi_dist_forcetheorem

Generated by: LCOV version 1.13