mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2024-06-13 08:45:36 +02:00
Compare commits
2 Commits
e0abd84059
...
fd9ce7ed5e
Author | SHA1 | Date | |
---|---|---|---|
fd9ce7ed5e | |||
574cde88e5 |
|
@ -2,4 +2,4 @@
|
||||||
|
|
||||||
export srcdir="."
|
export srcdir="."
|
||||||
python3 ${srcdir}/tools/build_makefile.py
|
python3 ${srcdir}/tools/build_makefile.py
|
||||||
autoreconf -i -Wall --no-recursive
|
autoreconf -vi -Wall --no-recursive
|
||||||
|
|
|
@ -1903,8 +1903,6 @@ qmckl_exit_code qmckl_provide_jastrow_champ_asymp_jasb(qmckl_context context)
|
||||||
function qmckl_compute_jastrow_champ_asymp_jasb_doc(context, &
|
function qmckl_compute_jastrow_champ_asymp_jasb_doc(context, &
|
||||||
bord_num, b_vector, rescale_factor_ee, spin_independent, asymp_jasb) &
|
bord_num, b_vector, rescale_factor_ee, spin_independent, asymp_jasb) &
|
||||||
bind(C) result(info)
|
bind(C) result(info)
|
||||||
use, intrinsic :: iso_c_binding
|
|
||||||
|
|
||||||
use qmckl
|
use qmckl
|
||||||
implicit none
|
implicit none
|
||||||
|
|
||||||
|
@ -2347,8 +2345,6 @@ function qmckl_compute_jastrow_champ_factor_ee_doc(context, &
|
||||||
walk_num, elec_num, up_num, bord_num, b_vector, &
|
walk_num, elec_num, up_num, bord_num, b_vector, &
|
||||||
ee_distance_rescaled, asymp_jasb, spin_independent, factor_ee) &
|
ee_distance_rescaled, asymp_jasb, spin_independent, factor_ee) &
|
||||||
bind(C) result(info)
|
bind(C) result(info)
|
||||||
use, intrinsic :: iso_c_binding
|
|
||||||
|
|
||||||
use qmckl
|
use qmckl
|
||||||
implicit none
|
implicit none
|
||||||
|
|
||||||
|
@ -2824,8 +2820,6 @@ function qmckl_compute_jastrow_champ_factor_ee_gl_doc( &
|
||||||
b_vector, ee_distance_rescaled, ee_distance_rescaled_gl, &
|
b_vector, ee_distance_rescaled, ee_distance_rescaled_gl, &
|
||||||
spin_independent, factor_ee_gl) &
|
spin_independent, factor_ee_gl) &
|
||||||
bind(C) result(info)
|
bind(C) result(info)
|
||||||
use, intrinsic :: iso_c_binding
|
|
||||||
|
|
||||||
use qmckl
|
use qmckl
|
||||||
implicit none
|
implicit none
|
||||||
|
|
||||||
|
@ -3383,7 +3377,6 @@ function qmckl_compute_ee_distance_rescaled_doc(context, &
|
||||||
elec_num, rescale_factor_ee, walk_num, &
|
elec_num, rescale_factor_ee, walk_num, &
|
||||||
coord, ee_distance_rescaled) &
|
coord, ee_distance_rescaled) &
|
||||||
bind(C) result(info)
|
bind(C) result(info)
|
||||||
use, intrinsic :: iso_c_binding
|
|
||||||
use qmckl
|
use qmckl
|
||||||
implicit none
|
implicit none
|
||||||
|
|
||||||
|
@ -3709,7 +3702,6 @@ qmckl_exit_code qmckl_provide_ee_distance_rescaled_gl(qmckl_context context)
|
||||||
function qmckl_compute_ee_distance_rescaled_gl_doc(context, &
|
function qmckl_compute_ee_distance_rescaled_gl_doc(context, &
|
||||||
elec_num, rescale_factor_ee, walk_num, coord, ee_distance_rescaled_gl) &
|
elec_num, rescale_factor_ee, walk_num, coord, ee_distance_rescaled_gl) &
|
||||||
bind(C) result(info)
|
bind(C) result(info)
|
||||||
use, intrinsic :: iso_c_binding
|
|
||||||
use qmckl
|
use qmckl
|
||||||
implicit none
|
implicit none
|
||||||
|
|
||||||
|
@ -4325,7 +4317,6 @@ function qmckl_compute_jastrow_champ_factor_en_doc( &
|
||||||
type_nucl_vector, aord_num, a_vector, &
|
type_nucl_vector, aord_num, a_vector, &
|
||||||
en_distance_rescaled, asymp_jasa, factor_en) &
|
en_distance_rescaled, asymp_jasa, factor_en) &
|
||||||
bind(C) result(info)
|
bind(C) result(info)
|
||||||
use, intrinsic :: iso_c_binding
|
|
||||||
use qmckl
|
use qmckl
|
||||||
implicit none
|
implicit none
|
||||||
|
|
||||||
|
@ -4746,7 +4737,6 @@ function qmckl_compute_jastrow_champ_factor_en_gl_doc( &
|
||||||
type_nucl_vector, aord_num, a_vector, &
|
type_nucl_vector, aord_num, a_vector, &
|
||||||
en_distance_rescaled, en_distance_rescaled_gl, factor_en_gl) &
|
en_distance_rescaled, en_distance_rescaled_gl, factor_en_gl) &
|
||||||
bind(C) result(info)
|
bind(C) result(info)
|
||||||
use, intrinsic :: iso_c_binding
|
|
||||||
use qmckl
|
use qmckl
|
||||||
implicit none
|
implicit none
|
||||||
|
|
||||||
|
@ -5270,7 +5260,6 @@ function qmckl_compute_en_distance_rescaled_doc(context, &
|
||||||
type_nucl_vector, rescale_factor_en, walk_num, elec_coord, &
|
type_nucl_vector, rescale_factor_en, walk_num, elec_coord, &
|
||||||
nucl_coord, en_distance_rescaled) &
|
nucl_coord, en_distance_rescaled) &
|
||||||
bind(C) result(info)
|
bind(C) result(info)
|
||||||
use, intrinsic :: iso_c_binding
|
|
||||||
use qmckl
|
use qmckl
|
||||||
implicit none
|
implicit none
|
||||||
integer (qmckl_context), intent(in), value :: context
|
integer (qmckl_context), intent(in), value :: context
|
||||||
|
|
|
@ -365,11 +365,11 @@ qmckl_exit_code qmckl_sm_naive_hpc(
|
||||||
const uint64_t LDS,
|
const uint64_t LDS,
|
||||||
const uint64_t Dim,
|
const uint64_t Dim,
|
||||||
const uint64_t N_updates,
|
const uint64_t N_updates,
|
||||||
const double* __restrict Updates,
|
const double* restrict Updates,
|
||||||
const uint64_t* __restrict Updates_index,
|
const uint64_t* restrict Updates_index,
|
||||||
const double breakdown,
|
const double breakdown,
|
||||||
double* __restrict Slater_inv,
|
double* restrict Slater_inv,
|
||||||
double* __restrict determinant) {
|
double* restrict determinant) {
|
||||||
|
|
||||||
if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
|
if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
|
||||||
return qmckl_failwith( context,
|
return qmckl_failwith( context,
|
||||||
|
@ -435,11 +435,11 @@ qmckl_exit_code qmckl_sm_naive_hpc(
|
||||||
static inline qmckl_exit_code qmckl_sm_naive_{Dim}(
|
static inline qmckl_exit_code qmckl_sm_naive_{Dim}(
|
||||||
const qmckl_context context,
|
const qmckl_context context,
|
||||||
const uint64_t N_updates,
|
const uint64_t N_updates,
|
||||||
const double* __restrict Updates,
|
const double* restrict Updates,
|
||||||
const uint64_t* __restrict Updates_index,
|
const uint64_t* restrict Updates_index,
|
||||||
const double breakdown,
|
const double breakdown,
|
||||||
double* __restrict Slater_inv,
|
double* restrict Slater_inv,
|
||||||
double* __restrict determinant) {
|
double* restrict determinant) {
|
||||||
|
|
||||||
if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
|
if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
|
||||||
return qmckl_failwith(context,
|
return qmckl_failwith(context,
|
||||||
|
@ -561,13 +561,14 @@ qmckl_exit_code qmckl_sm_naive(const qmckl_context context,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_HPC
|
#ifdef HAVE_HPC__BROKEN_WITH_CRAY
|
||||||
if (LDS == (1+(Dim-1)/SIMD_LENGTH)*SIMD_LENGTH) { // Most cases
|
if (LDS == (1+(Dim-1)/SIMD_LENGTH)*SIMD_LENGTH) { // Most cases
|
||||||
switch (Dim) {
|
switch (Dim) {
|
||||||
<<naive_switch-case_generator()>>
|
<<naive_switch-case_generator()>>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else { // Updating smaller sub-matrix
|
else
|
||||||
|
{ // Updating smaller sub-matrix
|
||||||
return qmckl_sm_naive_hpc(
|
return qmckl_sm_naive_hpc(
|
||||||
context,
|
context,
|
||||||
LDS,
|
LDS,
|
||||||
|
@ -1033,14 +1034,14 @@ qmckl_exit_code qmckl_sm_splitting_core_hpc(
|
||||||
uint64_t LDS,
|
uint64_t LDS,
|
||||||
uint64_t Dim,
|
uint64_t Dim,
|
||||||
uint64_t N_updates,
|
uint64_t N_updates,
|
||||||
const double* __restrict Updates,
|
const double* restrict Updates,
|
||||||
const uint64_t* __restrict Updates_index,
|
const uint64_t* restrict Updates_index,
|
||||||
const double breakdown,
|
const double breakdown,
|
||||||
double* __restrict Slater_inv,
|
double* restrict Slater_inv,
|
||||||
double* __restrict later_updates,
|
double* restrict later_updates,
|
||||||
uint64_t* __restrict later_index,
|
uint64_t* restrict later_index,
|
||||||
uint64_t* __restrict later,
|
uint64_t* restrict later,
|
||||||
double* __restrict determinant) {
|
double* restrict determinant) {
|
||||||
|
|
||||||
if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
|
if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
|
||||||
return qmckl_failwith(
|
return qmckl_failwith(
|
||||||
|
@ -1117,14 +1118,14 @@ qmckl_exit_code qmckl_sm_splitting_core_hpc(
|
||||||
static inline qmckl_exit_code qmckl_sm_splitting_core_{Dim}(
|
static inline qmckl_exit_code qmckl_sm_splitting_core_{Dim}(
|
||||||
const qmckl_context context,
|
const qmckl_context context,
|
||||||
uint64_t N_updates,
|
uint64_t N_updates,
|
||||||
const double* __restrict Updates,
|
const double* restrict Updates,
|
||||||
const uint64_t* __restrict Updates_index,
|
const uint64_t* restrict Updates_index,
|
||||||
const double breakdown,
|
const double breakdown,
|
||||||
double* __restrict Slater_inv,
|
double* restrict Slater_inv,
|
||||||
double* __restrict later_updates,
|
double* restrict later_updates,
|
||||||
uint64_t* __restrict later_index,
|
uint64_t* restrict later_index,
|
||||||
uint64_t* __restrict later,
|
uint64_t* restrict later,
|
||||||
double* __restrict determinant) {
|
double* restrict determinant) {
|
||||||
|
|
||||||
if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
|
if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
|
||||||
return qmckl_failwith(
|
return qmckl_failwith(
|
||||||
|
@ -1252,7 +1253,7 @@ qmckl_exit_code qmckl_sm_splitting_core(
|
||||||
uint64_t* later,
|
uint64_t* later,
|
||||||
double* determinant) {
|
double* determinant) {
|
||||||
|
|
||||||
#ifdef HAVE_HPC
|
#ifdef HAVE_HPC__BROKEN_WITH_CRAY
|
||||||
if (LDS == (1+(Dim-1)/SIMD_LENGTH)*SIMD_LENGTH) { // Most cases
|
if (LDS == (1+(Dim-1)/SIMD_LENGTH)*SIMD_LENGTH) { // Most cases
|
||||||
switch (Dim) {
|
switch (Dim) {
|
||||||
<<slagel_splitting_switch-case_generator()>>
|
<<slagel_splitting_switch-case_generator()>>
|
||||||
|
@ -1662,11 +1663,11 @@ qmckl_exit_code qmckl_woodbury_2x2_doc (
|
||||||
qmckl_exit_code qmckl_woodbury_2x2_hpc(const qmckl_context context,
|
qmckl_exit_code qmckl_woodbury_2x2_hpc(const qmckl_context context,
|
||||||
const uint64_t LDS,
|
const uint64_t LDS,
|
||||||
const uint64_t Dim,
|
const uint64_t Dim,
|
||||||
const double* __restrict Updates,
|
const double* restrict Updates,
|
||||||
const uint64_t* __restrict Updates_index,
|
const uint64_t* restrict Updates_index,
|
||||||
const double breakdown,
|
const double breakdown,
|
||||||
double* __restrict Slater_inv,
|
double* restrict Slater_inv,
|
||||||
double* __restrict determinant) {
|
double* restrict determinant) {
|
||||||
/*
|
/*
|
||||||
C := S^{-1} * U, dim x 2
|
C := S^{-1} * U, dim x 2
|
||||||
B := 1 + V * C, 2 x 2
|
B := 1 + V * C, 2 x 2
|
||||||
|
@ -1688,8 +1689,6 @@ qmckl_exit_code qmckl_woodbury_2x2_hpc(const qmckl_context context,
|
||||||
for (uint64_t i = 0; i < Dim; i++) {
|
for (uint64_t i = 0; i < Dim; i++) {
|
||||||
C[i * 2] = 0;
|
C[i * 2] = 0;
|
||||||
C[i * 2 + 1] = 0;
|
C[i * 2 + 1] = 0;
|
||||||
IVDEP
|
|
||||||
ALIGNED
|
|
||||||
for (uint64_t k = 0; k < LDS; k++) {
|
for (uint64_t k = 0; k < LDS; k++) {
|
||||||
C[i * 2] += Slater_inv[i * LDS + k] * Updates[k];
|
C[i * 2] += Slater_inv[i * LDS + k] * Updates[k];
|
||||||
C[i * 2 + 1] += Slater_inv[i * LDS + k] * Updates[LDS + k];
|
C[i * 2 + 1] += Slater_inv[i * LDS + k] * Updates[LDS + k];
|
||||||
|
@ -1723,8 +1722,6 @@ qmckl_exit_code qmckl_woodbury_2x2_hpc(const qmckl_context context,
|
||||||
double __attribute__((aligned(8))) tmp[2 * LDS];
|
double __attribute__((aligned(8))) tmp[2 * LDS];
|
||||||
double* r1dim = &(Slater_inv[row1 * LDS]);
|
double* r1dim = &(Slater_inv[row1 * LDS]);
|
||||||
double* r2dim = &(Slater_inv[row2 * LDS]);
|
double* r2dim = &(Slater_inv[row2 * LDS]);
|
||||||
IVDEP
|
|
||||||
ALIGNED
|
|
||||||
for (uint64_t j = 0; j < LDS; j++) {
|
for (uint64_t j = 0; j < LDS; j++) {
|
||||||
tmp[j] = Binv[0] * r1dim[j] + Binv[1] * r2dim[j];
|
tmp[j] = Binv[0] * r1dim[j] + Binv[1] * r2dim[j];
|
||||||
tmp[LDS + j] = Binv[2] * r1dim[j] + Binv[3] * r2dim[j];
|
tmp[LDS + j] = Binv[2] * r1dim[j] + Binv[3] * r2dim[j];
|
||||||
|
@ -1732,8 +1729,6 @@ qmckl_exit_code qmckl_woodbury_2x2_hpc(const qmckl_context context,
|
||||||
|
|
||||||
// Compute (S^T)^{-1} - C * tmp : Dim x LDS
|
// Compute (S^T)^{-1} - C * tmp : Dim x LDS
|
||||||
for (uint64_t i = 0; i < Dim; i++) {
|
for (uint64_t i = 0; i < Dim; i++) {
|
||||||
IVDEP
|
|
||||||
ALIGNED
|
|
||||||
for (uint64_t j = 0; j < LDS; j++) {
|
for (uint64_t j = 0; j < LDS; j++) {
|
||||||
Slater_inv[i * LDS + j] -= C[i * 2] * tmp[j];
|
Slater_inv[i * LDS + j] -= C[i * 2] * tmp[j];
|
||||||
Slater_inv[i * LDS + j] -= C[i * 2 + 1] * tmp[LDS + j];
|
Slater_inv[i * LDS + j] -= C[i * 2 + 1] * tmp[LDS + j];
|
||||||
|
@ -1748,11 +1743,11 @@ qmckl_exit_code qmckl_woodbury_2x2_hpc(const qmckl_context context,
|
||||||
#+begin_src c
|
#+begin_src c
|
||||||
static inline qmckl_exit_code qmckl_woodbury_2x2_{Dim}(
|
static inline qmckl_exit_code qmckl_woodbury_2x2_{Dim}(
|
||||||
const qmckl_context context,
|
const qmckl_context context,
|
||||||
const double* __restrict Updates,
|
const double* restrict Updates,
|
||||||
const uint64_t* __restrict Updates_index,
|
const uint64_t* restrict Updates_index,
|
||||||
const double breakdown,
|
const double breakdown,
|
||||||
double* __restrict Slater_inv,
|
double* restrict Slater_inv,
|
||||||
double* __restrict determinant) {
|
double* restrict determinant) {
|
||||||
/*
|
/*
|
||||||
C := S^{-1} * U, dim x 2
|
C := S^{-1} * U, dim x 2
|
||||||
B := 1 + V * C, 2 x 2
|
B := 1 + V * C, 2 x 2
|
||||||
|
@ -1883,7 +1878,7 @@ qmckl_exit_code qmckl_woodbury_2x2(const qmckl_context context,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_HPC
|
#ifdef HAVE_HPC__BROKEN_WITH_CRAY
|
||||||
if (LDS == (1+(Dim-1)/SIMD_LENGTH)*SIMD_LENGTH) { // Most cases
|
if (LDS == (1+(Dim-1)/SIMD_LENGTH)*SIMD_LENGTH) { // Most cases
|
||||||
switch (Dim) {
|
switch (Dim) {
|
||||||
<<woodbury_2x2_switch-case_generator()>>
|
<<woodbury_2x2_switch-case_generator()>>
|
||||||
|
@ -2314,11 +2309,11 @@ qmckl_exit_code qmckl_woodbury_3x3_doc (
|
||||||
qmckl_exit_code qmckl_woodbury_3x3_hpc(const qmckl_context context,
|
qmckl_exit_code qmckl_woodbury_3x3_hpc(const qmckl_context context,
|
||||||
const uint64_t LDS,
|
const uint64_t LDS,
|
||||||
const uint64_t Dim,
|
const uint64_t Dim,
|
||||||
const double* __restrict Updates,
|
const double* restrict Updates,
|
||||||
const uint64_t* __restrict Updates_index,
|
const uint64_t* restrict Updates_index,
|
||||||
const double breakdown,
|
const double breakdown,
|
||||||
double* __restrict Slater_inv,
|
double* restrict Slater_inv,
|
||||||
double* __restrict determinant) {
|
double* restrict determinant) {
|
||||||
/*
|
/*
|
||||||
C := S^{-1} * U, dim x 3
|
C := S^{-1} * U, dim x 3
|
||||||
B := 1 + V * C, 3 x 3
|
B := 1 + V * C, 3 x 3
|
||||||
|
@ -2420,11 +2415,11 @@ qmckl_exit_code qmckl_woodbury_3x3_hpc(const qmckl_context context,
|
||||||
#+begin_src c
|
#+begin_src c
|
||||||
static inline qmckl_exit_code qmckl_woodbury_3x3_{Dim}(
|
static inline qmckl_exit_code qmckl_woodbury_3x3_{Dim}(
|
||||||
const qmckl_context context,
|
const qmckl_context context,
|
||||||
const double* __restrict Updates,
|
const double* restrict Updates,
|
||||||
const uint64_t* __restrict Updates_index,
|
const uint64_t* restrict Updates_index,
|
||||||
const double breakdown,
|
const double breakdown,
|
||||||
double* __restrict Slater_inv,
|
double* restrict Slater_inv,
|
||||||
double* __restrict determinant) {
|
double* restrict determinant) {
|
||||||
/*
|
/*
|
||||||
C := S^{-1} * U, dim x 3
|
C := S^{-1} * U, dim x 3
|
||||||
B := 1 + V * C, 3 x 3
|
B := 1 + V * C, 3 x 3
|
||||||
|
@ -2575,7 +2570,7 @@ qmckl_exit_code qmckl_woodbury_3x3(const qmckl_context context,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_HPC
|
#ifdef HAVE_HPC__BROKEN_WITH_CRAY
|
||||||
if (LDS == (1+(Dim-1)/SIMD_LENGTH)*SIMD_LENGTH) { // Most cases
|
if (LDS == (1+(Dim-1)/SIMD_LENGTH)*SIMD_LENGTH) { // Most cases
|
||||||
switch (Dim) {
|
switch (Dim) {
|
||||||
<<woodbury_3x3_switch-case_generator()>>
|
<<woodbury_3x3_switch-case_generator()>>
|
||||||
|
@ -3037,7 +3032,7 @@ qmckl_exit_code qmckl_sm_splitting(
|
||||||
"qmckl_sm_splitting",
|
"qmckl_sm_splitting",
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
#ifdef HAVE_HPC
|
#ifdef HAVE_HPC__BROKEN_WITH_CRAY
|
||||||
return qmckl_sm_splitting_hpc(
|
return qmckl_sm_splitting_hpc(
|
||||||
context,
|
context,
|
||||||
LDS,
|
LDS,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user