1
0
mirror of https://github.com/TREX-CoE/qmckl.git synced 2024-12-22 04:14:49 +01:00

Fixed memset

This commit is contained in:
Anthony Scemama 2024-12-13 18:07:21 +01:00
parent 11f89e1d37
commit 243e937356

View File

@ -11503,8 +11503,8 @@ qmckl_compute_jastrow_champ_factor_een_gl_hpc(const qmckl_context context,
#pragma omp parallel for
#endif
for (size_t nw = 0; nw < (size_t) walk_num; ++nw) {
bool touched = false;
double* const restrict factor_een_gl_0nw = &(factor_een_gl[elec_num*4*nw]);
memset(factor_een_gl_0nw, 0, elec_num*4*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];
@ -11561,11 +11561,10 @@ qmckl_compute_jastrow_champ_factor_een_gl_hpc(const qmckl_context context,
double tmp3[elec_num];
if (touched) {
#ifdef HAVE_OPENMP
#pragma omp simd
#endif
for (size_t j = 0; j < (size_t) elec_num; ++j) {
for (size_t j = 0; j < (size_t) elec_num; ++j) {
factor_een_gl_0nw[j] = factor_een_gl_0nw[j] + cn * (
dtmp_c_0amknw [j] * een_rescaled_n_amlnw[j] +
@ -11576,12 +11575,12 @@ qmckl_compute_jastrow_champ_factor_een_gl_hpc(const qmckl_context context,
tmp3[j] =
dtmp_c_0amknw [j] * een_rescaled_n_gl_0amlnw[j] +
dtmp_c_0amlknw[j] * een_rescaled_n_gl_0amnw [j];
}
}
#ifdef HAVE_OPENMP
#pragma omp simd
#endif
for (size_t j = 0; j < (size_t) elec_num; ++j) {
for (size_t j = 0; j < (size_t) elec_num; ++j) {
factor_een_gl_1nw[j] = factor_een_gl_1nw[j] + cn * (
dtmp_c_1amknw [j] * een_rescaled_n_amlnw[j] +
@ -11592,12 +11591,12 @@ qmckl_compute_jastrow_champ_factor_een_gl_hpc(const qmckl_context context,
tmp3[j] = tmp3[j] +
dtmp_c_1amknw [j] * een_rescaled_n_gl_1amlnw[j] +
dtmp_c_1amlknw[j] * een_rescaled_n_gl_1amnw [j];
}
}
#ifdef HAVE_OPENMP
#pragma omp simd
#endif
for (size_t j = 0; j < (size_t) elec_num; ++j) {
for (size_t j = 0; j < (size_t) elec_num; ++j) {
factor_een_gl_2nw[j] = factor_een_gl_2nw[j] + cn * (
dtmp_c_2amknw [j] * een_rescaled_n_amlnw[j] +
@ -11608,12 +11607,12 @@ qmckl_compute_jastrow_champ_factor_een_gl_hpc(const qmckl_context context,
tmp3[j] = tmp3[j] +
dtmp_c_2amknw [j] * een_rescaled_n_gl_2amlnw[j] +
dtmp_c_2amlknw[j] * een_rescaled_n_gl_2amnw [j];
}
}
#ifdef HAVE_OPENMP
#pragma omp simd
#endif
for (size_t j = 0; j < (size_t) elec_num; ++j) {
for (size_t j = 0; j < (size_t) elec_num; ++j) {
factor_een_gl_3nw[j] = factor_een_gl_3nw[j] + cn * (
dtmp_c_3amknw [j] * een_rescaled_n_amlnw[j] +
dtmp_c_3amlknw[j] * een_rescaled_n_amnw [j] +
@ -11622,76 +11621,8 @@ qmckl_compute_jastrow_champ_factor_een_gl_hpc(const qmckl_context context,
tmp3[j]*2.0);
}
} else {
touched = true;
#ifdef HAVE_OPENMP
#pragma omp simd
#endif
for (size_t j = 0; j < (size_t) elec_num; ++j) {
factor_een_gl_0nw[j] = cn * (
dtmp_c_0amknw [j] * een_rescaled_n_amlnw[j] +
dtmp_c_0amlknw[j] * een_rescaled_n_amnw [j] +
tmp_c_amkn [j] * een_rescaled_n_gl_0amlnw[j] +
tmp_c_amlkn[j] * een_rescaled_n_gl_0amnw [j]);
tmp3[j] =
dtmp_c_0amknw [j] * een_rescaled_n_gl_0amlnw[j] +
dtmp_c_0amlknw[j] * een_rescaled_n_gl_0amnw [j];
}
#ifdef HAVE_OPENMP
#pragma omp simd
#endif
for (size_t j = 0; j < (size_t) elec_num; ++j) {
factor_een_gl_1nw[j] = cn * (
dtmp_c_1amknw [j] * een_rescaled_n_amlnw[j] +
dtmp_c_1amlknw[j] * een_rescaled_n_amnw [j] +
tmp_c_amkn [j] * een_rescaled_n_gl_1amlnw[j] +
tmp_c_amlkn[j] * een_rescaled_n_gl_1amnw [j]);
tmp3[j] = tmp3[j] +
dtmp_c_1amknw [j] * een_rescaled_n_gl_1amlnw[j] +
dtmp_c_1amlknw[j] * een_rescaled_n_gl_1amnw [j];
}
#ifdef HAVE_OPENMP
#pragma omp simd
#endif
for (size_t j = 0; j < (size_t) elec_num; ++j) {
factor_een_gl_2nw[j] = cn * (
dtmp_c_2amknw [j] * een_rescaled_n_amlnw[j] +
dtmp_c_2amlknw[j] * een_rescaled_n_amnw [j] +
tmp_c_amkn [j] * een_rescaled_n_gl_2amlnw[j] +
tmp_c_amlkn[j] * een_rescaled_n_gl_2amnw [j]);
tmp3[j] = tmp3[j] +
dtmp_c_2amknw[j] * een_rescaled_n_gl_2amlnw[j] +
dtmp_c_2amlknw[j] * een_rescaled_n_gl_2amnw[j];
}
#ifdef HAVE_OPENMP
#pragma omp simd
#endif
for (size_t j = 0; j < (size_t) elec_num; ++j) {
factor_een_gl_3nw[j] = cn * (
dtmp_c_3amknw [j] * een_rescaled_n_amlnw[j] +
dtmp_c_3amlknw[j] * een_rescaled_n_amnw [j] +
tmp_c_amkn [j] * een_rescaled_n_gl_3amlnw[j] +
tmp_c_amlkn[j] * een_rescaled_n_gl_3amnw [j] +
tmp3[j]*2.0);
}
}
}
}
if (!touched) {
memset(factor_een_gl_0nw, 0, elec_num*4*sizeof(double));
}
}
return info;
}