Skip to content

Commit 243e937

Browse files
committed
Fixed memset
1 parent 11f89e1 commit 243e937

File tree

1 file changed

+8
-77
lines changed

1 file changed

+8
-77
lines changed

org/qmckl_jastrow_champ.org

Lines changed: 8 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -11503,8 +11503,8 @@ qmckl_compute_jastrow_champ_factor_een_gl_hpc(const qmckl_context context,
1150311503
#pragma omp parallel for
1150411504
#endif
1150511505
for (size_t nw = 0; nw < (size_t) walk_num; ++nw) {
11506-
bool touched = false;
1150711506
double* const restrict factor_een_gl_0nw = &(factor_een_gl[elec_num*4*nw]);
11507+
memset(factor_een_gl_0nw, 0, elec_num*4*sizeof(double));
1150811508
for (size_t n = 0; n < (size_t) dim_c_vector; ++n) {
1150911509
const size_t l = lkpm_combined_index[n];
1151011510
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,
1156111561

1156211562
double tmp3[elec_num];
1156311563

11564-
if (touched) {
1156511564
#ifdef HAVE_OPENMP
1156611565
#pragma omp simd
1156711566
#endif
11568-
for (size_t j = 0; j < (size_t) elec_num; ++j) {
11567+
for (size_t j = 0; j < (size_t) elec_num; ++j) {
1156911568

1157011569
factor_een_gl_0nw[j] = factor_een_gl_0nw[j] + cn * (
1157111570
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,
1157611575
tmp3[j] =
1157711576
dtmp_c_0amknw [j] * een_rescaled_n_gl_0amlnw[j] +
1157811577
dtmp_c_0amlknw[j] * een_rescaled_n_gl_0amnw [j];
11579-
}
11578+
}
1158011579

1158111580
#ifdef HAVE_OPENMP
1158211581
#pragma omp simd
1158311582
#endif
11584-
for (size_t j = 0; j < (size_t) elec_num; ++j) {
11583+
for (size_t j = 0; j < (size_t) elec_num; ++j) {
1158511584

1158611585
factor_een_gl_1nw[j] = factor_een_gl_1nw[j] + cn * (
1158711586
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,
1159211591
tmp3[j] = tmp3[j] +
1159311592
dtmp_c_1amknw [j] * een_rescaled_n_gl_1amlnw[j] +
1159411593
dtmp_c_1amlknw[j] * een_rescaled_n_gl_1amnw [j];
11595-
}
11594+
}
1159611595

1159711596
#ifdef HAVE_OPENMP
1159811597
#pragma omp simd
1159911598
#endif
11600-
for (size_t j = 0; j < (size_t) elec_num; ++j) {
11599+
for (size_t j = 0; j < (size_t) elec_num; ++j) {
1160111600

1160211601
factor_een_gl_2nw[j] = factor_een_gl_2nw[j] + cn * (
1160311602
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,
1160811607
tmp3[j] = tmp3[j] +
1160911608
dtmp_c_2amknw [j] * een_rescaled_n_gl_2amlnw[j] +
1161011609
dtmp_c_2amlknw[j] * een_rescaled_n_gl_2amnw [j];
11611-
}
11610+
}
1161211611

1161311612
#ifdef HAVE_OPENMP
1161411613
#pragma omp simd
1161511614
#endif
11616-
for (size_t j = 0; j < (size_t) elec_num; ++j) {
11615+
for (size_t j = 0; j < (size_t) elec_num; ++j) {
1161711616
factor_een_gl_3nw[j] = factor_een_gl_3nw[j] + cn * (
1161811617
dtmp_c_3amknw [j] * een_rescaled_n_amlnw[j] +
1161911618
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,
1162211621
tmp3[j]*2.0);
1162311622
}
1162411623

11625-
} else {
11626-
11627-
touched = true;
11628-
11629-
#ifdef HAVE_OPENMP
11630-
#pragma omp simd
11631-
#endif
11632-
for (size_t j = 0; j < (size_t) elec_num; ++j) {
11633-
11634-
factor_een_gl_0nw[j] = cn * (
11635-
dtmp_c_0amknw [j] * een_rescaled_n_amlnw[j] +
11636-
dtmp_c_0amlknw[j] * een_rescaled_n_amnw [j] +
11637-
tmp_c_amkn [j] * een_rescaled_n_gl_0amlnw[j] +
11638-
tmp_c_amlkn[j] * een_rescaled_n_gl_0amnw [j]);
11639-
11640-
tmp3[j] =
11641-
dtmp_c_0amknw [j] * een_rescaled_n_gl_0amlnw[j] +
11642-
dtmp_c_0amlknw[j] * een_rescaled_n_gl_0amnw [j];
11643-
}
11644-
11645-
#ifdef HAVE_OPENMP
11646-
#pragma omp simd
11647-
#endif
11648-
for (size_t j = 0; j < (size_t) elec_num; ++j) {
11649-
11650-
factor_een_gl_1nw[j] = cn * (
11651-
dtmp_c_1amknw [j] * een_rescaled_n_amlnw[j] +
11652-
dtmp_c_1amlknw[j] * een_rescaled_n_amnw [j] +
11653-
tmp_c_amkn [j] * een_rescaled_n_gl_1amlnw[j] +
11654-
tmp_c_amlkn[j] * een_rescaled_n_gl_1amnw [j]);
11655-
11656-
tmp3[j] = tmp3[j] +
11657-
dtmp_c_1amknw [j] * een_rescaled_n_gl_1amlnw[j] +
11658-
dtmp_c_1amlknw[j] * een_rescaled_n_gl_1amnw [j];
11659-
}
11660-
11661-
#ifdef HAVE_OPENMP
11662-
#pragma omp simd
11663-
#endif
11664-
for (size_t j = 0; j < (size_t) elec_num; ++j) {
11665-
11666-
factor_een_gl_2nw[j] = cn * (
11667-
dtmp_c_2amknw [j] * een_rescaled_n_amlnw[j] +
11668-
dtmp_c_2amlknw[j] * een_rescaled_n_amnw [j] +
11669-
tmp_c_amkn [j] * een_rescaled_n_gl_2amlnw[j] +
11670-
tmp_c_amlkn[j] * een_rescaled_n_gl_2amnw [j]);
11671-
11672-
tmp3[j] = tmp3[j] +
11673-
dtmp_c_2amknw[j] * een_rescaled_n_gl_2amlnw[j] +
11674-
dtmp_c_2amlknw[j] * een_rescaled_n_gl_2amnw[j];
11675-
}
11676-
11677-
#ifdef HAVE_OPENMP
11678-
#pragma omp simd
11679-
#endif
11680-
for (size_t j = 0; j < (size_t) elec_num; ++j) {
11681-
factor_een_gl_3nw[j] = cn * (
11682-
dtmp_c_3amknw [j] * een_rescaled_n_amlnw[j] +
11683-
dtmp_c_3amlknw[j] * een_rescaled_n_amnw [j] +
11684-
tmp_c_amkn [j] * een_rescaled_n_gl_3amlnw[j] +
11685-
tmp_c_amlkn[j] * een_rescaled_n_gl_3amnw [j] +
11686-
tmp3[j]*2.0);
11687-
}
11688-
11689-
}
1169011624
}
1169111625
}
11692-
if (!touched) {
11693-
memset(factor_een_gl_0nw, 0, elec_num*4*sizeof(double));
11694-
}
1169511626
}
1169611627
return info;
1169711628
}

0 commit comments

Comments
 (0)