IF(diag_solver<0)CALLjuDFT_error("You selected a solver for the eigenvalue problem that is not available",hint="You most probably did not provide the appropriate libraries for compilation/linking")
IF(ANY((/diag_lapack,diag_magma,diag_cusolver/)==diag_solver).AND.parallel)CALLjudft_error("You selected an eigensolver that does not support distributed memory parallism",hint="Try scalapack,elpa or another supported solver for parallel matrices")
IF(ANY((/diag_elpa,diag_elemental,diag_scalapack/)==diag_solver).AND..NOT.parallel)CALLjudft_error("You selected an eigensolver for matrices that are memory distributed",hint="Try lapack, cusolver or another supported solver for non-distributed matrices")
ENDFUNCTIONpriv_select_solver
SUBROUTINEpriv_solver_error(diag_solver,parallel)
IMPLICITNONE
INTEGER,INTENT(IN)::diag_solver
LOGICAL,INTENT(IN)::parallel
SELECTCASE(diag_solver)
CASE(diag_elpa)
IF(parallel)THEN
CALLjuDFT_error("You did not compile with the ELPA solver and hence can not use it")
ELSE
CALLjuDFT_error("The ELPA solver can not be used in serial")
ENDIF
CASE(diag_elemental)
IF(parallel)THEN
CALLjuDFT_error("You did not compile with the ELEMENTAL solver and hence can not use it")
ELSE
CALLjuDFT_error("The ELEMENTAL solver can not be used in serial")
ENDIF
CASE(diag_scalapack)
IF(parallel)THEN
CALLjuDFT_error("You did not compile with the SCALAPACK solver and hence can not use it")
ELSE
CALLjuDFT_error("The SCALAPACK solver can not be used in serial")
ENDIF
CASE(diag_lapack)
IF(parallel)THEN
CALLjuDFT_error("The LAPACK solver can not be used in parallel")
ENDIF
CASE(diag_magma)
CALLjuDFT_error("You have not compiled with MAGMA support")
CASEDEFAULT
CALLjudft_error("You have selected an unkown eigensolver")