mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2024-12-23 12:57:20 +01:00
Fixed cppcheck
This commit is contained in:
parent
6fb261d635
commit
c7dd46da05
1
.github/workflows/test-build.yml
vendored
1
.github/workflows/test-build.yml
vendored
@ -4,7 +4,6 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ master ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
x86_ubuntu:
|
x86_ubuntu:
|
||||||
|
@ -2634,9 +2634,10 @@ qmckl_exit_code qmckl_finalize_basis(qmckl_context context) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = QMCKL_SUCCESS;
|
|
||||||
#ifdef HAVE_HPC
|
#ifdef HAVE_HPC
|
||||||
rc = qmckl_finalize_basis_hpc(context);
|
rc = qmckl_finalize_basis_hpc(context);
|
||||||
|
#else
|
||||||
|
rc = QMCKL_SUCCESS;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
@ -84,8 +84,8 @@ are not intended to be passed to external codes.
|
|||||||
|
|
||||||
#+begin_src c :comments org :tangle (eval h_private_type) :exports none
|
#+begin_src c :comments org :tangle (eval h_private_type) :exports none
|
||||||
typedef struct qmckl_vector {
|
typedef struct qmckl_vector {
|
||||||
int64_t size;
|
|
||||||
double* restrict data;
|
double* restrict data;
|
||||||
|
int64_t size;
|
||||||
} qmckl_vector;
|
} qmckl_vector;
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
@ -160,8 +160,8 @@ qmckl_vector_free( qmckl_context context,
|
|||||||
|
|
||||||
#+begin_src c :comments org :tangle (eval h_private_type) :exports none
|
#+begin_src c :comments org :tangle (eval h_private_type) :exports none
|
||||||
typedef struct qmckl_matrix {
|
typedef struct qmckl_matrix {
|
||||||
int64_t size[2];
|
|
||||||
double* restrict data;
|
double* restrict data;
|
||||||
|
int64_t size[2];
|
||||||
} qmckl_matrix;
|
} qmckl_matrix;
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
@ -245,9 +245,9 @@ qmckl_matrix_free( qmckl_context context,
|
|||||||
#define QMCKL_TENSOR_ORDER_MAX 16
|
#define QMCKL_TENSOR_ORDER_MAX 16
|
||||||
|
|
||||||
typedef struct qmckl_tensor {
|
typedef struct qmckl_tensor {
|
||||||
|
double* restrict data;
|
||||||
int64_t order;
|
int64_t order;
|
||||||
int64_t size[QMCKL_TENSOR_ORDER_MAX];
|
int64_t size[QMCKL_TENSOR_ORDER_MAX];
|
||||||
double* restrict data;
|
|
||||||
} qmckl_tensor;
|
} qmckl_tensor;
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
@ -837,7 +837,7 @@ qmckl_set_jastrow_type_nucl_vector(qmckl_context context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->jastrow.type_nucl_vector != NULL) {
|
if (ctx->jastrow.type_nucl_vector != NULL) {
|
||||||
qmckl_exit_code rc = qmckl_free(context, ctx->jastrow.type_nucl_vector);
|
rc = qmckl_free(context, ctx->jastrow.type_nucl_vector);
|
||||||
if (rc != QMCKL_SUCCESS) {
|
if (rc != QMCKL_SUCCESS) {
|
||||||
return qmckl_failwith( context, rc,
|
return qmckl_failwith( context, rc,
|
||||||
"qmckl_set_type_nucl_vector",
|
"qmckl_set_type_nucl_vector",
|
||||||
@ -896,7 +896,7 @@ qmckl_set_jastrow_aord_vector(qmckl_context context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->jastrow.aord_vector != NULL) {
|
if (ctx->jastrow.aord_vector != NULL) {
|
||||||
qmckl_exit_code rc = qmckl_free(context, ctx->jastrow.aord_vector);
|
rc = qmckl_free(context, ctx->jastrow.aord_vector);
|
||||||
if (rc != QMCKL_SUCCESS) {
|
if (rc != QMCKL_SUCCESS) {
|
||||||
return qmckl_failwith( context, rc,
|
return qmckl_failwith( context, rc,
|
||||||
"qmckl_set_ord_vector",
|
"qmckl_set_ord_vector",
|
||||||
@ -959,7 +959,7 @@ qmckl_set_jastrow_bord_vector(qmckl_context context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->jastrow.bord_vector != NULL) {
|
if (ctx->jastrow.bord_vector != NULL) {
|
||||||
qmckl_exit_code rc = qmckl_free(context, ctx->jastrow.bord_vector);
|
rc = qmckl_free(context, ctx->jastrow.bord_vector);
|
||||||
if (rc != QMCKL_SUCCESS) {
|
if (rc != QMCKL_SUCCESS) {
|
||||||
return qmckl_failwith( context, rc,
|
return qmckl_failwith( context, rc,
|
||||||
"qmckl_set_ord_vector",
|
"qmckl_set_ord_vector",
|
||||||
@ -1029,7 +1029,7 @@ qmckl_set_jastrow_cord_vector(qmckl_context context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->jastrow.cord_vector != NULL) {
|
if (ctx->jastrow.cord_vector != NULL) {
|
||||||
qmckl_exit_code rc = qmckl_free(context, ctx->jastrow.cord_vector);
|
rc = qmckl_free(context, ctx->jastrow.cord_vector);
|
||||||
if (rc != QMCKL_SUCCESS) {
|
if (rc != QMCKL_SUCCESS) {
|
||||||
return qmckl_failwith( context, rc,
|
return qmckl_failwith( context, rc,
|
||||||
"qmckl_set_ord_vector",
|
"qmckl_set_ord_vector",
|
||||||
@ -1388,12 +1388,11 @@ qmckl_exit_code qmckl_provide_asymp_jasb(qmckl_context context)
|
|||||||
ctx->jastrow.asymp_jasb = asymp_jasb;
|
ctx->jastrow.asymp_jasb = asymp_jasb;
|
||||||
}
|
}
|
||||||
|
|
||||||
qmckl_exit_code rc =
|
rc = qmckl_compute_asymp_jasb(context,
|
||||||
qmckl_compute_asymp_jasb(context,
|
ctx->jastrow.bord_num,
|
||||||
ctx->jastrow.bord_num,
|
ctx->jastrow.bord_vector,
|
||||||
ctx->jastrow.bord_vector,
|
rescale_factor_kappa_ee,
|
||||||
rescale_factor_kappa_ee,
|
ctx->jastrow.asymp_jasb);
|
||||||
ctx->jastrow.asymp_jasb);
|
|
||||||
if (rc != QMCKL_SUCCESS) {
|
if (rc != QMCKL_SUCCESS) {
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -1470,10 +1469,6 @@ qmckl_exit_code qmckl_compute_asymp_jasb (
|
|||||||
const double rescale_factor_kappa_ee,
|
const double rescale_factor_kappa_ee,
|
||||||
double* const asymp_jasb ) {
|
double* const asymp_jasb ) {
|
||||||
|
|
||||||
double kappa_inv, x, asym_one;
|
|
||||||
|
|
||||||
kappa_inv = 1.0 / rescale_factor_kappa_ee;
|
|
||||||
|
|
||||||
if (context == QMCKL_NULL_CONTEXT){
|
if (context == QMCKL_NULL_CONTEXT){
|
||||||
return QMCKL_INVALID_CONTEXT;
|
return QMCKL_INVALID_CONTEXT;
|
||||||
}
|
}
|
||||||
@ -1482,14 +1477,15 @@ qmckl_exit_code qmckl_compute_asymp_jasb (
|
|||||||
return QMCKL_INVALID_ARG_2;
|
return QMCKL_INVALID_ARG_2;
|
||||||
}
|
}
|
||||||
|
|
||||||
asym_one = bord_vector[0] * kappa_inv / (1.0 + bord_vector[1] * kappa_inv);
|
const double kappa_inv = 1.0 / rescale_factor_kappa_ee;
|
||||||
|
const double asym_one = bord_vector[0] * kappa_inv / (1.0 + bord_vector[1] * kappa_inv);
|
||||||
asymp_jasb[0] = asym_one;
|
asymp_jasb[0] = asym_one;
|
||||||
asymp_jasb[1] = 0.5 * asym_one;
|
asymp_jasb[1] = 0.5 * asym_one;
|
||||||
|
|
||||||
for (int i = 0 ; i <= 1; ++i) {
|
for (int i = 0 ; i <= 1; ++i) {
|
||||||
x = kappa_inv;
|
double x = kappa_inv;
|
||||||
for (int p = 1; p < bord_num; ++p){
|
for (int p = 1; p < bord_num; ++p){
|
||||||
x = x * kappa_inv;
|
x *= kappa_inv;
|
||||||
asymp_jasb[i] = asymp_jasb[i] + bord_vector[p + 1] * x;
|
asymp_jasb[i] = asymp_jasb[i] + bord_vector[p + 1] * x;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1672,16 +1668,15 @@ qmckl_exit_code qmckl_provide_factor_ee(qmckl_context context)
|
|||||||
ctx->jastrow.factor_ee = factor_ee;
|
ctx->jastrow.factor_ee = factor_ee;
|
||||||
}
|
}
|
||||||
|
|
||||||
qmckl_exit_code rc =
|
rc = qmckl_compute_factor_ee(context,
|
||||||
qmckl_compute_factor_ee(context,
|
ctx->electron.walk_num,
|
||||||
ctx->electron.walk_num,
|
ctx->electron.num,
|
||||||
ctx->electron.num,
|
ctx->electron.up_num,
|
||||||
ctx->electron.up_num,
|
ctx->jastrow.bord_num,
|
||||||
ctx->jastrow.bord_num,
|
ctx->jastrow.bord_vector,
|
||||||
ctx->jastrow.bord_vector,
|
ctx->electron.ee_distance_rescaled,
|
||||||
ctx->electron.ee_distance_rescaled,
|
ctx->jastrow.asymp_jasb,
|
||||||
ctx->jastrow.asymp_jasb,
|
ctx->jastrow.factor_ee);
|
||||||
ctx->jastrow.factor_ee);
|
|
||||||
if (rc != QMCKL_SUCCESS) {
|
if (rc != QMCKL_SUCCESS) {
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -2014,17 +2009,16 @@ qmckl_exit_code qmckl_provide_factor_ee_deriv_e(qmckl_context context)
|
|||||||
ctx->jastrow.factor_ee_deriv_e = factor_ee_deriv_e;
|
ctx->jastrow.factor_ee_deriv_e = factor_ee_deriv_e;
|
||||||
}
|
}
|
||||||
|
|
||||||
qmckl_exit_code rc =
|
rc = qmckl_compute_factor_ee_deriv_e(context,
|
||||||
qmckl_compute_factor_ee_deriv_e(context,
|
ctx->electron.walk_num,
|
||||||
ctx->electron.walk_num,
|
ctx->electron.num,
|
||||||
ctx->electron.num,
|
ctx->electron.up_num,
|
||||||
ctx->electron.up_num,
|
ctx->jastrow.bord_num,
|
||||||
ctx->jastrow.bord_num,
|
ctx->jastrow.bord_vector,
|
||||||
ctx->jastrow.bord_vector,
|
ctx->electron.ee_distance_rescaled,
|
||||||
ctx->electron.ee_distance_rescaled,
|
ctx->electron.ee_distance_rescaled_deriv_e,
|
||||||
ctx->electron.ee_distance_rescaled_deriv_e,
|
ctx->jastrow.asymp_jasb,
|
||||||
ctx->jastrow.asymp_jasb,
|
ctx->jastrow.factor_ee_deriv_e);
|
||||||
ctx->jastrow.factor_ee_deriv_e);
|
|
||||||
if (rc != QMCKL_SUCCESS) {
|
if (rc != QMCKL_SUCCESS) {
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -2437,17 +2431,16 @@ qmckl_exit_code qmckl_provide_factor_en(qmckl_context context)
|
|||||||
ctx->jastrow.factor_en = factor_en;
|
ctx->jastrow.factor_en = factor_en;
|
||||||
}
|
}
|
||||||
|
|
||||||
qmckl_exit_code rc =
|
rc = qmckl_compute_factor_en(context,
|
||||||
qmckl_compute_factor_en(context,
|
ctx->electron.walk_num,
|
||||||
ctx->electron.walk_num,
|
ctx->electron.num,
|
||||||
ctx->electron.num,
|
ctx->nucleus.num,
|
||||||
ctx->nucleus.num,
|
ctx->jastrow.type_nucl_num,
|
||||||
ctx->jastrow.type_nucl_num,
|
ctx->jastrow.type_nucl_vector,
|
||||||
ctx->jastrow.type_nucl_vector,
|
ctx->jastrow.aord_num,
|
||||||
ctx->jastrow.aord_num,
|
ctx->jastrow.aord_vector,
|
||||||
ctx->jastrow.aord_vector,
|
ctx->electron.en_distance_rescaled,
|
||||||
ctx->electron.en_distance_rescaled,
|
ctx->jastrow.factor_en);
|
||||||
ctx->jastrow.factor_en);
|
|
||||||
if (rc != QMCKL_SUCCESS) {
|
if (rc != QMCKL_SUCCESS) {
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -2784,18 +2777,17 @@ qmckl_exit_code qmckl_provide_factor_en_deriv_e(qmckl_context context)
|
|||||||
ctx->jastrow.factor_en_deriv_e = factor_en_deriv_e;
|
ctx->jastrow.factor_en_deriv_e = factor_en_deriv_e;
|
||||||
}
|
}
|
||||||
|
|
||||||
qmckl_exit_code rc =
|
rc = qmckl_compute_factor_en_deriv_e(context,
|
||||||
qmckl_compute_factor_en_deriv_e(context,
|
ctx->electron.walk_num,
|
||||||
ctx->electron.walk_num,
|
ctx->electron.num,
|
||||||
ctx->electron.num,
|
ctx->nucleus.num,
|
||||||
ctx->nucleus.num,
|
ctx->jastrow.type_nucl_num,
|
||||||
ctx->jastrow.type_nucl_num,
|
ctx->jastrow.type_nucl_vector,
|
||||||
ctx->jastrow.type_nucl_vector,
|
ctx->jastrow.aord_num,
|
||||||
ctx->jastrow.aord_num,
|
ctx->jastrow.aord_vector,
|
||||||
ctx->jastrow.aord_vector,
|
ctx->electron.en_distance_rescaled,
|
||||||
ctx->electron.en_distance_rescaled,
|
ctx->electron.en_distance_rescaled_deriv_e,
|
||||||
ctx->electron.en_distance_rescaled_deriv_e,
|
ctx->jastrow.factor_en_deriv_e);
|
||||||
ctx->jastrow.factor_en_deriv_e);
|
|
||||||
if (rc != QMCKL_SUCCESS) {
|
if (rc != QMCKL_SUCCESS) {
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -3203,14 +3195,13 @@ qmckl_exit_code qmckl_provide_een_rescaled_e(qmckl_context context)
|
|||||||
ctx->jastrow.een_rescaled_e = een_rescaled_e;
|
ctx->jastrow.een_rescaled_e = een_rescaled_e;
|
||||||
}
|
}
|
||||||
|
|
||||||
qmckl_exit_code rc =
|
rc = qmckl_compute_een_rescaled_e(context,
|
||||||
qmckl_compute_een_rescaled_e(context,
|
ctx->electron.walk_num,
|
||||||
ctx->electron.walk_num,
|
ctx->electron.num,
|
||||||
ctx->electron.num,
|
ctx->jastrow.cord_num,
|
||||||
ctx->jastrow.cord_num,
|
ctx->electron.rescale_factor_kappa_ee,
|
||||||
ctx->electron.rescale_factor_kappa_ee,
|
ctx->electron.ee_distance,
|
||||||
ctx->electron.ee_distance,
|
ctx->jastrow.een_rescaled_e);
|
||||||
ctx->jastrow.een_rescaled_e);
|
|
||||||
if (rc != QMCKL_SUCCESS) {
|
if (rc != QMCKL_SUCCESS) {
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -3537,16 +3528,15 @@ qmckl_exit_code qmckl_provide_een_rescaled_e_deriv_e(qmckl_context context)
|
|||||||
ctx->jastrow.een_rescaled_e_deriv_e = een_rescaled_e_deriv_e;
|
ctx->jastrow.een_rescaled_e_deriv_e = een_rescaled_e_deriv_e;
|
||||||
}
|
}
|
||||||
|
|
||||||
qmckl_exit_code rc =
|
rc = qmckl_compute_factor_een_rescaled_e_deriv_e(context,
|
||||||
qmckl_compute_factor_een_rescaled_e_deriv_e(context,
|
ctx->electron.walk_num,
|
||||||
ctx->electron.walk_num,
|
ctx->electron.num,
|
||||||
ctx->electron.num,
|
ctx->jastrow.cord_num,
|
||||||
ctx->jastrow.cord_num,
|
ctx->electron.rescale_factor_kappa_ee,
|
||||||
ctx->electron.rescale_factor_kappa_ee,
|
ctx->electron.coord_new.data,
|
||||||
ctx->electron.coord_new.data,
|
ctx->electron.ee_distance,
|
||||||
ctx->electron.ee_distance,
|
ctx->jastrow.een_rescaled_e,
|
||||||
ctx->jastrow.een_rescaled_e,
|
ctx->jastrow.een_rescaled_e_deriv_e);
|
||||||
ctx->jastrow.een_rescaled_e_deriv_e);
|
|
||||||
if (rc != QMCKL_SUCCESS) {
|
if (rc != QMCKL_SUCCESS) {
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -3917,15 +3907,14 @@ qmckl_exit_code qmckl_provide_een_rescaled_n(qmckl_context context)
|
|||||||
ctx->jastrow.een_rescaled_n = een_rescaled_n;
|
ctx->jastrow.een_rescaled_n = een_rescaled_n;
|
||||||
}
|
}
|
||||||
|
|
||||||
qmckl_exit_code rc =
|
rc = qmckl_compute_een_rescaled_n(context,
|
||||||
qmckl_compute_een_rescaled_n(context,
|
ctx->electron.walk_num,
|
||||||
ctx->electron.walk_num,
|
ctx->electron.num,
|
||||||
ctx->electron.num,
|
ctx->nucleus.num,
|
||||||
ctx->nucleus.num,
|
ctx->jastrow.cord_num,
|
||||||
ctx->jastrow.cord_num,
|
ctx->electron.rescale_factor_kappa_en,
|
||||||
ctx->electron.rescale_factor_kappa_en,
|
ctx->electron.en_distance,
|
||||||
ctx->electron.en_distance,
|
ctx->jastrow.een_rescaled_n);
|
||||||
ctx->jastrow.een_rescaled_n);
|
|
||||||
if (rc != QMCKL_SUCCESS) {
|
if (rc != QMCKL_SUCCESS) {
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -4256,18 +4245,17 @@ qmckl_exit_code qmckl_provide_een_rescaled_n_deriv_e(qmckl_context context)
|
|||||||
ctx->jastrow.een_rescaled_n_deriv_e = een_rescaled_n_deriv_e;
|
ctx->jastrow.een_rescaled_n_deriv_e = een_rescaled_n_deriv_e;
|
||||||
}
|
}
|
||||||
|
|
||||||
qmckl_exit_code rc =
|
rc = qmckl_compute_factor_een_rescaled_n_deriv_e(context,
|
||||||
qmckl_compute_factor_een_rescaled_n_deriv_e(context,
|
ctx->electron.walk_num,
|
||||||
ctx->electron.walk_num,
|
ctx->electron.num,
|
||||||
ctx->electron.num,
|
ctx->nucleus.num,
|
||||||
ctx->nucleus.num,
|
ctx->jastrow.cord_num,
|
||||||
ctx->jastrow.cord_num,
|
ctx->electron.rescale_factor_kappa_en,
|
||||||
ctx->electron.rescale_factor_kappa_en,
|
ctx->electron.coord_new.data,
|
||||||
ctx->electron.coord_new.data,
|
ctx->nucleus.coord.data,
|
||||||
ctx->nucleus.coord.data,
|
ctx->electron.en_distance,
|
||||||
ctx->electron.en_distance,
|
ctx->jastrow.een_rescaled_n,
|
||||||
ctx->jastrow.een_rescaled_n,
|
ctx->jastrow.een_rescaled_n_deriv_e);
|
||||||
ctx->jastrow.een_rescaled_n_deriv_e);
|
|
||||||
if (rc != QMCKL_SUCCESS) {
|
if (rc != QMCKL_SUCCESS) {
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -4758,14 +4746,13 @@ qmckl_exit_code qmckl_provide_cord_vect_full(qmckl_context context)
|
|||||||
ctx->jastrow.cord_vect_full = cord_vect_full;
|
ctx->jastrow.cord_vect_full = cord_vect_full;
|
||||||
}
|
}
|
||||||
|
|
||||||
qmckl_exit_code rc =
|
rc = qmckl_compute_cord_vect_full(context,
|
||||||
qmckl_compute_cord_vect_full(context,
|
ctx->nucleus.num,
|
||||||
ctx->nucleus.num,
|
ctx->jastrow.dim_cord_vect,
|
||||||
ctx->jastrow.dim_cord_vect,
|
ctx->jastrow.type_nucl_num,
|
||||||
ctx->jastrow.type_nucl_num,
|
ctx->jastrow.type_nucl_vector,
|
||||||
ctx->jastrow.type_nucl_vector,
|
ctx->jastrow.cord_vector,
|
||||||
ctx->jastrow.cord_vector,
|
ctx->jastrow.cord_vect_full);
|
||||||
ctx->jastrow.cord_vect_full);
|
|
||||||
if (rc != QMCKL_SUCCESS) {
|
if (rc != QMCKL_SUCCESS) {
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -4809,11 +4796,10 @@ qmckl_exit_code qmckl_provide_lkpm_combined_index(qmckl_context context)
|
|||||||
ctx->jastrow.lkpm_combined_index = lkpm_combined_index;
|
ctx->jastrow.lkpm_combined_index = lkpm_combined_index;
|
||||||
}
|
}
|
||||||
|
|
||||||
qmckl_exit_code rc =
|
rc = qmckl_compute_lkpm_combined_index(context,
|
||||||
qmckl_compute_lkpm_combined_index(context,
|
ctx->jastrow.cord_num,
|
||||||
ctx->jastrow.cord_num,
|
ctx->jastrow.dim_cord_vect,
|
||||||
ctx->jastrow.dim_cord_vect,
|
ctx->jastrow.lkpm_combined_index);
|
||||||
ctx->jastrow.lkpm_combined_index);
|
|
||||||
if (rc != QMCKL_SUCCESS) {
|
if (rc != QMCKL_SUCCESS) {
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -4858,15 +4844,14 @@ qmckl_exit_code qmckl_provide_tmp_c(qmckl_context context)
|
|||||||
ctx->jastrow.tmp_c = tmp_c;
|
ctx->jastrow.tmp_c = tmp_c;
|
||||||
}
|
}
|
||||||
|
|
||||||
qmckl_exit_code rc =
|
rc = qmckl_compute_tmp_c(context,
|
||||||
qmckl_compute_tmp_c(context,
|
ctx->jastrow.cord_num,
|
||||||
ctx->jastrow.cord_num,
|
ctx->electron.num,
|
||||||
ctx->electron.num,
|
ctx->nucleus.num,
|
||||||
ctx->nucleus.num,
|
ctx->electron.walk_num,
|
||||||
ctx->electron.walk_num,
|
ctx->jastrow.een_rescaled_e,
|
||||||
ctx->jastrow.een_rescaled_e,
|
ctx->jastrow.een_rescaled_n,
|
||||||
ctx->jastrow.een_rescaled_n,
|
ctx->jastrow.tmp_c);
|
||||||
ctx->jastrow.tmp_c);
|
|
||||||
if (rc != QMCKL_SUCCESS) {
|
if (rc != QMCKL_SUCCESS) {
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -4899,7 +4884,7 @@ qmckl_exit_code qmckl_provide_dtmp_c(qmckl_context context)
|
|||||||
|
|
||||||
qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero;
|
qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero;
|
||||||
mem_info.size = (ctx->jastrow.cord_num) * (ctx->jastrow.cord_num + 1)
|
mem_info.size = (ctx->jastrow.cord_num) * (ctx->jastrow.cord_num + 1)
|
||||||
* 4 * ctx->electron.num * ctx->nucleus.num * ctx->electron.walk_num * sizeof(double);
|
,* 4 * ctx->electron.num * ctx->nucleus.num * ctx->electron.walk_num * sizeof(double);
|
||||||
double* dtmp_c = (double*) qmckl_malloc(context, mem_info);
|
double* dtmp_c = (double*) qmckl_malloc(context, mem_info);
|
||||||
|
|
||||||
if (dtmp_c == NULL) {
|
if (dtmp_c == NULL) {
|
||||||
@ -4911,15 +4896,14 @@ qmckl_exit_code qmckl_provide_dtmp_c(qmckl_context context)
|
|||||||
ctx->jastrow.dtmp_c = dtmp_c;
|
ctx->jastrow.dtmp_c = dtmp_c;
|
||||||
}
|
}
|
||||||
|
|
||||||
qmckl_exit_code rc =
|
rc = qmckl_compute_dtmp_c(context,
|
||||||
qmckl_compute_dtmp_c(context,
|
ctx->jastrow.cord_num,
|
||||||
ctx->jastrow.cord_num,
|
ctx->electron.num,
|
||||||
ctx->electron.num,
|
ctx->nucleus.num,
|
||||||
ctx->nucleus.num,
|
ctx->electron.walk_num,
|
||||||
ctx->electron.walk_num,
|
ctx->jastrow.een_rescaled_e_deriv_e,
|
||||||
ctx->jastrow.een_rescaled_e_deriv_e,
|
ctx->jastrow.een_rescaled_n,
|
||||||
ctx->jastrow.een_rescaled_n,
|
ctx->jastrow.dtmp_c);
|
||||||
ctx->jastrow.dtmp_c);
|
|
||||||
if (rc != QMCKL_SUCCESS) {
|
if (rc != QMCKL_SUCCESS) {
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -5943,18 +5927,17 @@ qmckl_exit_code qmckl_provide_factor_een(qmckl_context context)
|
|||||||
ctx->jastrow.factor_een = factor_een;
|
ctx->jastrow.factor_een = factor_een;
|
||||||
}
|
}
|
||||||
|
|
||||||
qmckl_exit_code rc =
|
rc = qmckl_compute_factor_een(context,
|
||||||
qmckl_compute_factor_een(context,
|
ctx->electron.walk_num,
|
||||||
ctx->electron.walk_num,
|
ctx->electron.num,
|
||||||
ctx->electron.num,
|
ctx->nucleus.num,
|
||||||
ctx->nucleus.num,
|
ctx->jastrow.cord_num,
|
||||||
ctx->jastrow.cord_num,
|
ctx->jastrow.dim_cord_vect,
|
||||||
ctx->jastrow.dim_cord_vect,
|
ctx->jastrow.cord_vect_full,
|
||||||
ctx->jastrow.cord_vect_full,
|
ctx->jastrow.lkpm_combined_index,
|
||||||
ctx->jastrow.lkpm_combined_index,
|
ctx->jastrow.tmp_c,
|
||||||
ctx->jastrow.tmp_c,
|
ctx->jastrow.een_rescaled_n,
|
||||||
ctx->jastrow.een_rescaled_n,
|
ctx->jastrow.factor_een);
|
||||||
ctx->jastrow.factor_een);
|
|
||||||
if (rc != QMCKL_SUCCESS) {
|
if (rc != QMCKL_SUCCESS) {
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -6456,20 +6439,19 @@ qmckl_exit_code qmckl_provide_factor_een_deriv_e(qmckl_context context)
|
|||||||
ctx->jastrow.factor_een_deriv_e = factor_een_deriv_e;
|
ctx->jastrow.factor_een_deriv_e = factor_een_deriv_e;
|
||||||
}
|
}
|
||||||
|
|
||||||
qmckl_exit_code rc =
|
rc = qmckl_compute_factor_een_deriv_e(context,
|
||||||
qmckl_compute_factor_een_deriv_e(context,
|
ctx->electron.walk_num,
|
||||||
ctx->electron.walk_num,
|
ctx->electron.num,
|
||||||
ctx->electron.num,
|
ctx->nucleus.num,
|
||||||
ctx->nucleus.num,
|
ctx->jastrow.cord_num,
|
||||||
ctx->jastrow.cord_num,
|
ctx->jastrow.dim_cord_vect,
|
||||||
ctx->jastrow.dim_cord_vect,
|
ctx->jastrow.cord_vect_full,
|
||||||
ctx->jastrow.cord_vect_full,
|
ctx->jastrow.lkpm_combined_index,
|
||||||
ctx->jastrow.lkpm_combined_index,
|
ctx->jastrow.tmp_c,
|
||||||
ctx->jastrow.tmp_c,
|
ctx->jastrow.dtmp_c,
|
||||||
ctx->jastrow.dtmp_c,
|
ctx->jastrow.een_rescaled_n,
|
||||||
ctx->jastrow.een_rescaled_n,
|
ctx->jastrow.een_rescaled_n_deriv_e,
|
||||||
ctx->jastrow.een_rescaled_n_deriv_e,
|
ctx->jastrow.factor_een_deriv_e);
|
||||||
ctx->jastrow.factor_een_deriv_e);
|
|
||||||
if (rc != QMCKL_SUCCESS) {
|
if (rc != QMCKL_SUCCESS) {
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@ -849,13 +849,13 @@ qmckl_compute_mo_basis_mo_vgl_hpc (const qmckl_context context,
|
|||||||
|
|
||||||
int64_t n0 = nidx-4;
|
int64_t n0 = nidx-4;
|
||||||
n0 = n0 < 0 ? 0 : n0;
|
n0 = n0 < 0 ? 0 : n0;
|
||||||
for (int64_t n=n0 ; n < nidx ; n+=1) {
|
for (int64_t m=n0 ; m < nidx ; m+=1) {
|
||||||
const double* restrict ck = coef_normalized_t + idx[n]*mo_num;
|
const double* restrict ck = coef_normalized_t + idx[m]*mo_num;
|
||||||
const double a1 = av1[n];
|
const double a1 = av1[m];
|
||||||
const double a2 = av2[n];
|
const double a2 = av2[m];
|
||||||
const double a3 = av3[n];
|
const double a3 = av3[m];
|
||||||
const double a4 = av4[n];
|
const double a4 = av4[m];
|
||||||
const double a5 = av5[n];
|
const double a5 = av5[m];
|
||||||
|
|
||||||
#ifdef HAVE_OPENMP
|
#ifdef HAVE_OPENMP
|
||||||
#pragma omp simd
|
#pragma omp simd
|
||||||
|
@ -965,7 +965,7 @@ qmckl_exit_code qmckl_sherman_morrison_smw32s(const qmckl_context context,
|
|||||||
rc = qmckl_woodbury_3(context, LDS, Dim, Updates_3block, Updates_index_3block, breakdown, Slater_inv, determinant);
|
rc = qmckl_woodbury_3(context, LDS, Dim, Updates_3block, Updates_index_3block, breakdown, Slater_inv, determinant);
|
||||||
if (rc != 0) { // Send the entire block to slagel_splitting
|
if (rc != 0) { // Send the entire block to slagel_splitting
|
||||||
uint64_t l = 0;
|
uint64_t l = 0;
|
||||||
rc = qmckl_slagel_splitting(LDS, Dim, 3, Updates_3block, Updates_index_3block,
|
(void) qmckl_slagel_splitting(LDS, Dim, 3, Updates_3block, Updates_index_3block,
|
||||||
breakdown, Slater_inv, later_updates + (Dim * later), later_index + later, &l, determinant);
|
breakdown, Slater_inv, later_updates + (Dim * later), later_index + later, &l, determinant);
|
||||||
later = later + l;
|
later = later + l;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user