1
0
mirror of https://github.com/TREX-CoE/qmckl.git synced 2024-11-03 20:54:09 +01:00

Bug Fix : Adjugate4 (#56)

* Added chameleon support.

* Fixed bug in adjugate4.

* Better call to adjugate function.

* Removed debug print.
This commit is contained in:
vijay 2022-01-12 19:20:18 +01:00 committed by GitHub
parent f7ce203db7
commit bb83aa96f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 49 additions and 17 deletions

View File

@ -106,6 +106,52 @@ AC_CHECK_LIB([pthread], [pthread_create])
# CFLAGS="${CFLAGS} ${OPENMP_CFLAGS}"
#fi
# CHAMELEON
AC_ARG_WITH(chameleon,
AS_HELP_STRING([--without-chameleon],
[Do not use Chameleon. Default: auto-detect]), [
case "$with_chameleon" in
no)
: ;;
yes)
PKG_CHECK_MODULES([LIBCHAMELEON],[chameleon >= 1.0.0],
[PKG_CFLAGS="$PKG_CFLAGS $LIBCHAMELEON_CFLAGS"
PKG_LIBS="$PKG_LIBS $LIBCHAMELEON_LIBS"]
,[
## something went wrong.
## try to find the package without pkg-config
## check that the library is actually new enough.
## by testing for a 1.0.0+ function which we use
AC_CHECK_LIB(chameleon,CHAMELEON_finalize,[LIBCHAMELEON_LIBS="-lchameleon"])
])
AH_TEMPLATE(HAVE_CHAMELEON,[Chameleon support is available])
;;
*)
if test ! -d "$withval" ; then
AC_MSG_ERROR([--with-chameleon path does not point to a directory])
fi
LIBCHAMELEON_LIBS="-L$with_chameleon/lib -lchameleon -lchameleon_starpu -lhqr -lcoreblas"
LIBCHAMELEON_CFLAGS="-I$with_chameleon/include $CFLAGS"
LIBCHAMELEON_CPPFLAGS="-I$with_chameleon/include $CPPFLAGS"
esac
])
if test "x$LIBCHAMELEON_LIBS" != "x" ; then
LIBS="$LIBS $LIBCHAMELEON_LIBS"
CFLAGS="$CFLAGS $LIBCHAMELEON_CFLAGS"
CPPFLAGS="$CPPFLAGS $LIBCHAMELEON_CPPFLAGS"
AC_CHECK_HEADERS([chameleon.h], [], [AC_MSG_ERROR("chamelon.h not found")])
AC_DEFINE_UNQUOTED([HAVE_CHAMELEON],1,[CHAMELEON support is available])
fi
#AS_IF([test "x$with_chameleon" != "xno"], [
#])
AC_MSG_NOTICE([CHAMELEON library support: ${with_CHAMELEON:=auto} ${LIBCHAMELEON_PATH} ${LIBCHAMELEON_LIBS}])
# TREXIO
AC_ARG_WITH(trexio, [AS_HELP_STRING([--without-trexio],[disable support for TREXIO])],
@ -281,6 +327,7 @@ FC..............: ${FC}
FCLAGS..........: ${FCFLAGS}
LDFLAGS:........: ${LDFLAGS}
LIBS............: ${LIBS}
USE CHAMELEON...: ${with_chameleon}
Package features:
${ARGS}

View File

@ -443,8 +443,7 @@ subroutine adjugate4(a,LDA,B,LDB,na,det_l)
double precision :: C(4,4)
call cofactor4(A,LDA,B,4_8,na,det_l)
call cofactor4(A,LDA,C,4_8,na,det_l)
B(1,1) = C(1,1)
B(1,2) = C(2,1)
B(1,3) = C(3,1)

View File

@ -1828,7 +1828,7 @@ integer function qmckl_compute_det_inv_matrix_alpha_f(context, &
res = qmckl_adjugate(context, &
alpha_num, matA, LDA, &
det_adj_matrix_alpha(1, 1, iwalk, idet), &
det_adj_matrix_alpha(1:alpha_num, 1:alpha_num, iwalk, idet), &
int(size(det_adj_matrix_alpha,1),8), &
det_l)

View File

@ -438,34 +438,20 @@ integer function qmckl_compute_kinetic_energy_f(context, walk_num, &
do idet = 1, det_num_alpha
do iwalk = 1, walk_num
! Alpha part
tmp_e = 0.0d0
do imo = 1, alpha_num
do ielec = 1, alpha_num
mo_id = mo_index_alpha(imo, iwalk, idet)
e_kin(iwalk) = e_kin(iwalk) - 0.5d0 * det_inv_matrix_alpha(imo, ielec, iwalk, idet) * &
mo_vgl(mo_id, ielec, 5)
!print *,"det alpha = ",det_inv_matrix_alpha(imo,ielec,iwalk,idet)
!print *,mo_vgl(mo_id,ielec,5)
!!print *," det val = ",det_value_alpha(iwalk,idet)
!tmp_e = tmp_e - 0.5d0 * det_inv_matrix_alpha(imo, ielec, iwalk, idet) * &
! mo_vgl(mo_id, ielec, 5)
end do
!print *,"e_kin = ",tmp_e
end do
! Beta part
tmp_e = 0.0d0
do imo = 1, beta_num
do ielec = 1, beta_num
mo_id = mo_index_beta(imo, iwalk, idet)
e_kin(iwalk) = e_kin(iwalk) - 0.5d0 * det_inv_matrix_beta(imo, ielec, iwalk, idet) * &
mo_vgl(mo_id, alpha_num + ielec, 5)
!print *,"det beta = ",det_inv_matrix_beta(imo,ielec,iwalk,idet)
!print *,mo_vgl(mo_id,alpha_num+ielec,5)
!!print *," det val = ",det_value_alpha(iwalk,idet)
!tmp_e = tmp_e - 0.5d0 * det_inv_matrix_beta(imo, ielec, iwalk, idet) * &
! mo_vgl(mo_id, alpha_num + ielec, 5)
end do
!print *,"e_kin = ",tmp_e
end do
end do
end do