LCOV - code coverage report
Current view: top level - global - matrix_copy.F90 (source / functions) Hit Total Coverage
Test: combined.info Lines: 0 16 0.0 %
Date: 2019-09-08 04:53:50 Functions: 0 1 0.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             : !<@brief
       7             :   !<This matrix_copy module is needed to copy a distributed into a non-distributed matrix or vice versa
       8             :   !<It calls the usual matrix-copy routines in other cases
       9             : MODULE m_matrix_copy
      10             :   IMPLICIT NONE
      11             : CONTAINS
      12           0 :   SUBROUTINE matrix_copy(mat_in,mat_out)
      13             :     USE m_types
      14             :     USE m_types_mpimat
      15             : 
      16             :     CLASS(t_mat),INTENT(IN)   ::mat_in
      17             :     CLASS(t_mat),INTENT(INOUT)::mat_out
      18             : 
      19           0 :     TYPE(t_mpimat)::tmp_mat
      20             : 
      21             : #ifdef CPP_MPI
      22             :     INCLUDE 'mpif.h'
      23             : #else
      24             :     INTEGER:: MPI_COMM_SELF
      25             : #endif
      26             :     
      27             :     SELECT TYPE(mat_in)
      28             :     CLASS is(t_mpimat)
      29             :        SELECT TYPE(mat_out)
      30             :        CLASS is(t_mpimat)
      31           0 :           CALL mat_out%copy(mat_in,1,1)
      32             :        CLASS is(t_mat)
      33             :           !Copy from t_mpimat to t_mat
      34           0 :           CALL tmp_mat%init(mat_in%l_real,mat_in%global_size1,mat_in%global_size2,MPI_COMM_SELF)
      35           0 :           CALL tmp_mat%copy(mat_in,1,1) !redistribute to single matrix
      36           0 :           IF (tmp_mat%l_real) THEN
      37           0 :              CALL move_ALLOC(tmp_mat%data_r,mat_out%data_r)
      38             :           ELSE
      39           0 :              CALL move_ALLOC(tmp_mat%data_r,mat_out%data_r)
      40             :           ENDIF
      41             :        END SELECT
      42             :     CLASS is (t_mat)
      43             :        SELECT TYPE(mat_out)
      44             :        CLASS is(t_mpimat)
      45             :           !Copy from non-distributed t_mat to t_mpimat
      46           0 :           CALL tmp_mat%init(mat_in%l_real,mat_in%matsize1,mat_in%matsize1,MPI_COMM_SELF)
      47           0 :           IF (tmp_mat%l_real) THEN
      48           0 :              tmp_mat%data_r=mat_in%data_r
      49             :           ELSE
      50           0 :              tmp_mat%data_c=mat_in%data_c
      51             :           ENDIF
      52           0 :           CALL mat_out%copy(tmp_mat,1,1)
      53             :        CLASS is(t_mat)
      54           0 :           CALL mat_out%copy(mat_in,1,1)
      55             :        END SELECT
      56             :     END SELECT
      57           0 :   END SUBROUTINE matrix_copy
      58           0 : END MODULE m_matrix_copy

Generated by: LCOV version 1.13