From d3ac2a01e539dc18cf43deccf08ddf0c59b424b6 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Sat, 14 Dec 2024 15:33:34 +0100 Subject: [PATCH] Fixing HPC version of jast grad only --- org/qmckl_jastrow_champ.org | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/org/qmckl_jastrow_champ.org b/org/qmckl_jastrow_champ.org index 0bc74df1..284daa88 100644 --- a/org/qmckl_jastrow_champ.org +++ b/org/qmckl_jastrow_champ.org @@ -11767,7 +11767,8 @@ qmckl_compute_jastrow_champ_factor_een_grad_hpc(const qmckl_context context, #pragma omp parallel for #endif for (size_t nw = 0; nw < (size_t) walk_num; ++nw) { - memset(&factor_een_grad[elec_num*3*nw], 0, elec_num*3*sizeof(double)); + double* const restrict factor_een_grad_0nw = &(factor_een_grad[elec_num*3*nw]); + memset(factor_een_grad_0nw, 0, elec_num*3*sizeof(double)); } return QMCKL_SUCCESS; } @@ -11779,6 +11780,7 @@ qmckl_compute_jastrow_champ_factor_een_grad_hpc(const qmckl_context context, #endif for (size_t nw = 0; nw < (size_t) walk_num; ++nw) { double* const restrict factor_een_grad_0nw = &(factor_een_grad[elec_num*3*nw]); + memset(factor_een_grad_0nw, 0, elec_num*3*sizeof(double)); for (size_t n = 0; n < (size_t) dim_c_vector; ++n) { const size_t l = lkpm_combined_index[n]; const size_t k = lkpm_combined_index[n+ dim_c_vector]; @@ -12972,6 +12974,7 @@ assert(qmckl_jastrow_champ_provided(context)); if (fabs(total_j_grad[k][m][e] - total_j_deriv[k][m][e]) > 1e-12) { printf("%ld %ld %ld\n", k, m, e); printf("total_j_grad = %20.15e\n", total_j_grad[k][m][e]); + fflush(stdout); } assert (fabs(total_j_deriv[k][m][e] - total_j_grad[k][m][e]) < 1.e-12); }