From 21f40b3a132ed30c2d339f302ff32d65539d467a Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Wed, 21 Feb 2024 16:33:49 +0100 Subject: [PATCH] Fixed gradient of Jastrow in HPC version --- org/qmckl_jastrow_champ.org | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/org/qmckl_jastrow_champ.org b/org/qmckl_jastrow_champ.org index ca4455e..8c69975 100644 --- a/org/qmckl_jastrow_champ.org +++ b/org/qmckl_jastrow_champ.org @@ -6610,7 +6610,6 @@ integer function qmckl_compute_jastrow_champ_factor_een_rescaled_e_gl_f( & ! Prepare table of exponentiated distances raised to appropriate power do nw = 1, walk_num - een_rescaled_e_gl(:,:,:,:,nw) = 0.d0 do j = 1, elec_num do i = 1, j-1 rij_inv = 1.0d0 / ee_distance(i, j, nw) @@ -6632,6 +6631,7 @@ integer function qmckl_compute_jastrow_champ_factor_een_rescaled_e_gl_f( & end do ! prepare the actual een table + een_rescaled_e_gl(:,:,:,0,nw) = 0.d0 do l = 1, cord_num kappa_l = - dble(l) * rescale_factor_ee do j = 1, elec_num @@ -6804,6 +6804,16 @@ qmckl_exit_code qmckl_compute_jastrow_champ_factor_een_rescaled_e_gl_hpc ( } } + for (int64_t j = 0; j < elec_num; ++j) { + double* restrict eegl = &een_rescaled_e_gl[ elec_num * 4 * (j + elec_num * (cord_num + 1) * nw)]; +#ifdef HAVE_OPENMP +#pragma omp simd +#endif + for (int64_t i = 0; i < 4*elec_num; ++i) { + eegl[i] = 0.0; + } + } + for (int64_t l = 1; l <= cord_num; ++l) { double kappa_l = - (double)l * rescale_factor_ee; for (int64_t j = 0; j < elec_num; ++j) {