LCOV - code coverage report
Current view: top level - diagonalization - eigen_diag.F90 (source / functions) Hit Total Coverage
Test: combined.info Lines: 13 19 68.4 %
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_eigen_diag
       8             :   USE m_juDFT
       9             :   USE m_available_solvers
      10             :   IMPLICIT NONE
      11             :   PRIVATE
      12             :   PUBLIC :: eigen_diag
      13             : 
      14             : CONTAINS
      15             : 
      16        1188 :   SUBROUTINE eigen_diag(solver,hmat,smat,ne,eig,ev,ikpt,jsp,iter)
      17             :     USE m_lapack_diag
      18             :     USE m_magma
      19             :     USE m_elpa
      20             :     USE m_elpa_onenode
      21             :     USE m_scalapack
      22             :     USE m_elemental
      23             : !    USE m_chase_diag
      24             :     USE m_types_mpimat
      25             :     USE m_types_gpumat
      26             : !    USE m_matrix_copy
      27             :     USE m_cusolver_diag
      28             :     USE m_judft_usage
      29             :     USE m_writeout
      30             :     IMPLICIT NONE
      31             :     INTEGER,                   INTENT(INOUT) :: solver
      32             :     CLASS(t_mat),              INTENT(INOUT) :: smat,hmat
      33             :     CLASS(t_mat), ALLOCATABLE, INTENT(OUT)   :: ev         ! eigenvectors
      34             :     INTEGER,                   INTENT(INOUT) :: ne         ! number of eigenpairs to be found
      35             :     REAL,                      INTENT(OUT)   :: eig(:)     ! eigenvalues
      36             : 
      37             :     !Only for chase
      38             :     INTEGER,OPTIONAL,          INTENT(IN)    :: ikpt
      39             :     INTEGER,OPTIONAL,          INTENT(IN)    :: jsp
      40             :     INTEGER,OPTIONAL,          INTENT(IN)    :: iter
      41             : 
      42             :     !Locals  
      43             :     LOGICAL :: parallel
      44             : 
      45             :     SELECT TYPE(smat)
      46             :        CLASS IS (t_mpimat)
      47         884 :        parallel=.TRUE.
      48             :        CLASS default
      49         304 :        parallel=.FALSE.
      50             :     END SELECT
      51             : 
      52        1188 :     solver=select_solver(solver,parallel)
      53             : 
      54        1188 :     CALL timestart("Diagonalization")
      55             :     !Select the solver
      56        1188 :     CALL add_usage_data("diag-solver", solver)
      57        2072 :     SELECT CASE (solver)
      58             :     CASE (diag_elpa)
      59         884 :        CALL elpa_diag(hmat,smat,ne,eig,ev)
      60             :     CASE (diag_elpa_1node)
      61           0 :        CALL elpa_diag_onenode(hmat,smat,ne,eig,ev)
      62             :     CASE (diag_elemental)
      63             :        !CALL ELEMENTAL(hmat,smat,ne,eig,ev)
      64             :     CASE (diag_scalapack)
      65           0 :        CALL scalapack(hmat,smat,ne,eig,ev)
      66             :     CASE (diag_magma)
      67           0 :        CALL magma_diag(hmat,smat,ne,eig,ev)
      68             :     CASE (diag_cusolver)
      69           0 :        CALL cusolver_diag(hmat,smat,ne,eig,ev)
      70             :     CASE (diag_lapack)
      71         304 :        CALL lapack_diag(hmat,smat,ne,eig,ev)
      72             :     CASE (diag_chase)
      73           0 :        IF (.NOT.(PRESENT(ikpt).AND.PRESENT(jsp).AND.PRESENT(iter))) CALL judft_error("Optional arguments must be present for chase in eigen_diag")
      74             : !       CALL chase_diag(hmat,smat,ikpt,jsp,iter,ne,eig,ev)
      75             :     CASE (diag_debugout)
      76           0 :        CALL diag_writeout(smat,hmat)
      77             :     CASE default
      78        1188 :        CALL judft_error("No solver available to diagonalize matrix")
      79             :     END SELECT
      80        1188 :     CALL timestop("Diagonalization")
      81             : 
      82        1188 :   END SUBROUTINE eigen_diag
      83             : 
      84             : 
      85        1188 : END MODULE m_eigen_diag

Generated by: LCOV version 1.13