Added Woodbury 2x2 to QMCkl test program tests/qmckl_test_h5.cpp. For now it crashes with a segmentation fault when run on a cycle with 2 updates (qmckl_test_h5 wb2 3 3 1e-3 1) .

This commit is contained in:
Francois Coppens 2021-07-21 17:37:21 +02:00
parent d4cb4afb85
commit e314987bb7

View File

@ -79,12 +79,19 @@ int test_cycle(H5::H5File file, int cycle, std::string version, double tolerance
qmckl_context context; qmckl_context context;
context = qmckl_context_create(); context = qmckl_context_create();
qmckl_exit_code rc; qmckl_exit_code rc;
const uint64_t cdim = dim; rc = qmckl_sherman_morrison_c(context, dim, nupdates,
const uint64_t cnupdates = nupdates; u, col_update_index, slater_inverse_nonpersistent);
const uint64_t* ccol_update_index = col_update_index; }
const double* cu = u; }
rc = qmckl_sherman_morrison_c(context, cdim, cnupdates, else if (version == "wb2") {
cu, ccol_update_index, slater_inverse_nonpersistent); for (unsigned int i = 0; i < repetition_number; i++) {
memcpy(slater_inverse_nonpersistent, slater_inverse,
dim * dim * sizeof(double));
qmckl_context context;
context = qmckl_context_create();
qmckl_exit_code rc;
rc = qmckl_woodbury_2_c(context, dim,
u, col_update_index, slater_inverse_nonpersistent);
} }
} }
else { else {
@ -99,12 +106,15 @@ int test_cycle(H5::H5File file, int cycle, std::string version, double tolerance
qmckl_context context; qmckl_context context;
context = qmckl_context_create(); context = qmckl_context_create();
qmckl_exit_code rc; qmckl_exit_code rc;
const uint64_t cdim = dim; rc = qmckl_sherman_morrison_c(context, dim, nupdates,
const uint64_t cnupdates = nupdates; u, col_update_index, slater_inverse);
const uint64_t* ccol_update_index = col_update_index; }
const double* cu = u; else if (version == "wb2") {
rc = qmckl_sherman_morrison_c(context, cdim, cnupdates, qmckl_context context;
cu, ccol_update_index, slater_inverse_nonpersistent); context = qmckl_context_create();
qmckl_exit_code rc;
rc = qmckl_woodbury_2_c(context, dim,
u, col_update_index, slater_inverse);
} }
else { else {
std::cerr << "Unknown version " << version << std::endl; std::cerr << "Unknown version " << version << std::endl;