From e314987bb7265dd407af0f9552f2032b325d0620 Mon Sep 17 00:00:00 2001 From: Francois Coppens Date: Wed, 21 Jul 2021 17:37:21 +0200 Subject: [PATCH] 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) . --- tests/qmckl_test_h5.cpp | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/tests/qmckl_test_h5.cpp b/tests/qmckl_test_h5.cpp index 963a322..99bbaca 100644 --- a/tests/qmckl_test_h5.cpp +++ b/tests/qmckl_test_h5.cpp @@ -79,12 +79,19 @@ int test_cycle(H5::H5File file, int cycle, std::string version, double tolerance qmckl_context context; context = qmckl_context_create(); qmckl_exit_code rc; - const uint64_t cdim = dim; - const uint64_t cnupdates = nupdates; - const uint64_t* ccol_update_index = col_update_index; - const double* cu = u; - rc = qmckl_sherman_morrison_c(context, cdim, cnupdates, - cu, ccol_update_index, slater_inverse_nonpersistent); + rc = qmckl_sherman_morrison_c(context, dim, nupdates, + u, col_update_index, slater_inverse_nonpersistent); + } + } + else if (version == "wb2") { + 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 { @@ -99,12 +106,15 @@ int test_cycle(H5::H5File file, int cycle, std::string version, double tolerance qmckl_context context; context = qmckl_context_create(); qmckl_exit_code rc; - const uint64_t cdim = dim; - const uint64_t cnupdates = nupdates; - const uint64_t* ccol_update_index = col_update_index; - const double* cu = u; - rc = qmckl_sherman_morrison_c(context, cdim, cnupdates, - cu, ccol_update_index, slater_inverse_nonpersistent); + rc = qmckl_sherman_morrison_c(context, dim, nupdates, + u, col_update_index, slater_inverse); + } + else if (version == "wb2") { + qmckl_context context; + context = qmckl_context_create(); + qmckl_exit_code rc; + rc = qmckl_woodbury_2_c(context, dim, + u, col_update_index, slater_inverse); } else { std::cerr << "Unknown version " << version << std::endl;