Commit a273eb8d authored by Daniel Wortmann's avatar Daniel Wortmann

Updates for GPU version&Magma

parent fbcfc476
#First check if we can compile with ELPA #First check if we can compile with MAGMA
if ($ENV{FLEUR_USE_MAGMA})
message("Set FLEUR_USE_MAGMA to environment, skipping test")
set(FLEUR_USE_MAGMA $ENV{FLEUR_USE_MAGMA})
else()
try_compile(FLEUR_USE_MAGMA ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_MAGMA.f90 try_compile(FLEUR_USE_MAGMA ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_MAGMA.f90
LINK_LIBRARIES ${FLEUR_LIBRARIES} LINK_LIBRARIES ${FLEUR_LIBRARIES}
) )
endif()
message("MAGMA Library found:${FLEUR_USE_MAGMA}") message("MAGMA Library found:${FLEUR_USE_MAGMA}")
if (FLEUR_USE_MAGMA) if (FLEUR_USE_MAGMA)
......
...@@ -15,7 +15,7 @@ CONTAINS ...@@ -15,7 +15,7 @@ CONTAINS
SUBROUTINE magma_diag(nsize,eig,ne,a_r,b_r,z_r,a_c,b_c,z_c) SUBROUTINE magma_diag(nsize,eig,ne,a_r,b_r,z_r,a_c,b_c,z_c)
use m_packed_to_full use m_packed_to_full
#ifdef CPP_MAGMA #ifdef CPP_MAGMA
use magma ! use magma
#endif #endif
#include"cpp_double.h" #include"cpp_double.h"
IMPLICIT NONE IMPLICIT NONE
...@@ -76,7 +76,7 @@ CONTAINS ...@@ -76,7 +76,7 @@ CONTAINS
allocate(work(1),rwork(1),iwork(1)) allocate(work(1),rwork(1),iwork(1))
print *,"Magma workspace query" print *,"Magma workspace query"
call flush() call flush()
call magmaf_zhegvdx_2stage_m(NGPU_CONST,1,MagmaVec,MagmaRangeI,MagmaLower,nsize,largea_c,nsize,largeb_c,nsize,& call magmaf_zhegvdx_2stage_m(NGPU_CONST,1,'v','i','l',nsize,largea_c,nsize,largeb_c,nsize,&
0.0,0.0,1,ne,mout,eigTemp,work,-1,rwork,-1,iwork,-1,err) 0.0,0.0,1,ne,mout,eigTemp,work,-1,rwork,-1,iwork,-1,err)
lwork=work(1) lwork=work(1)
lrwork=rwork(1) lrwork=rwork(1)
...@@ -88,7 +88,7 @@ CONTAINS ...@@ -88,7 +88,7 @@ CONTAINS
!Now the diagonalization !Now the diagonalization
print *,"Magma diagonalization" print *,"Magma diagonalization"
print *,nsize,shape(largea_c),shape(eigTemp),ne print *,nsize,shape(largea_c),shape(eigTemp),ne
call magmaf_zhegvdx_2stage_m(NGPU_CONST,1,MagmaVec,MagmaRangeI,MagmaLower,nsize,largea_c,nsize,largeb_c,nsize,& call magmaf_zhegvdx_2stage_m(NGPU_CONST,1,'v','i','l',nsize,largea_c,nsize,largeb_c,nsize,&
0.0,0.0,1,ne,mout,eigTemp,work,lwork,rwork,lrwork,iwork,liwork,err) 0.0,0.0,1,ne,mout,eigTemp,work,lwork,rwork,lrwork,iwork,liwork,err)
print*,"MAGMA info:",err print*,"MAGMA info:",err
if (err/=0) call juDFT_error("Magma failed to diagonalize Hamiltonian") if (err/=0) call juDFT_error("Magma failed to diagonalize Hamiltonian")
......
...@@ -78,7 +78,7 @@ CONTAINS ...@@ -78,7 +78,7 @@ CONTAINS
call nvtxStartRange("hsmt_nonsph",1) !call nvtxStartRange("hsmt_nonsph",1)
lnonsphd=MAXVAL(atoms%lnonsph)*(MAXVAL(atoms%lnonsph)+2) lnonsphd=MAXVAL(atoms%lnonsph)*(MAXVAL(atoms%lnonsph)+2)
ALLOCATE(dtd(0:lnonsphd,0:lnonsphd),utd(0:lnonsphd,0:lnonsphd),dtu(0:lnonsphd,0:lnonsphd),utu(0:lnonsphd,0:lnonsphd)) ALLOCATE(dtd(0:lnonsphd,0:lnonsphd),utd(0:lnonsphd,0:lnonsphd),dtu(0:lnonsphd,0:lnonsphd),utu(0:lnonsphd,0:lnonsphd))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment