Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Fix : Adjugate4 #56

Merged
merged 6 commits into from
Jan 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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])],
Expand Down Expand Up @@ -281,6 +327,7 @@ FC..............: ${FC}
FCLAGS..........: ${FCFLAGS}
LDFLAGS:........: ${LDFLAGS}
LIBS............: ${LIBS}
USE CHAMELEON...: ${with_chameleon}

Package features:
${ARGS}
Expand Down
3 changes: 1 addition & 2 deletions org/qmckl_blas.org
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion org/qmckl_determinant.org
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
14 changes: 0 additions & 14 deletions org/qmckl_local_energy.org
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down