diff --git a/Makefile b/Makefile index cb34485..f4b999b 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ ## Compilers, compiler flags & external libs ifeq ($(ENV),INTEL) - CXX = icpx + CXX = icpc FC = ifort ARCH = -march=native OPT = -O3 @@ -51,7 +51,7 @@ DEPS_F = $(DEPS_CXX) \ $(OBJ_DIR)/helpers_mod.o ## QMCkl includes and linking -QMCKL_INCLUDE = -I $(SMROOT)/qmckl/build/include/ +QMCKL_INCLUDE = -I $(SMROOT)/qmckl/build/include QMCKLLFLAGS = -L$(SMROOT)/qmckl/build/lib -lqmckl diff --git a/libqmckl.a b/libqmckl.a new file mode 120000 index 0000000..817f721 --- /dev/null +++ b/libqmckl.a @@ -0,0 +1 @@ +qmckl/build/lib/libqmckl.a \ No newline at end of file diff --git a/libqmckl.la b/libqmckl.la new file mode 120000 index 0000000..a0ff7a3 --- /dev/null +++ b/libqmckl.la @@ -0,0 +1 @@ +qmckl/build/lib/libqmckl.la \ No newline at end of file diff --git a/libqmckl.so b/libqmckl.so new file mode 120000 index 0000000..bf1bb5e --- /dev/null +++ b/libqmckl.so @@ -0,0 +1 @@ +qmckl/build/lib/libqmckl.so \ No newline at end of file diff --git a/libqmckl.so.0 b/libqmckl.so.0 new file mode 120000 index 0000000..04ce1b0 --- /dev/null +++ b/libqmckl.so.0 @@ -0,0 +1 @@ +qmckl/build/lib/libqmckl.so.0 \ No newline at end of file diff --git a/libqmckl.so.0.0.0 b/libqmckl.so.0.0.0 new file mode 120000 index 0000000..b0fee51 --- /dev/null +++ b/libqmckl.so.0.0.0 @@ -0,0 +1 @@ +qmckl/build/lib/libqmckl.so.0.0.0 \ No newline at end of file diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..1cfc478 --- /dev/null +++ b/main.cpp @@ -0,0 +1,28 @@ +#include "qmckl.h" +#include "assert.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include +#ifndef THRESHOLD +#define THRESHOLD 1e-3 +#endif + +int main() { + qmckl_context context; + context = qmckl_context_create(); + + qmckl_exit_code rc; + +const uint64_t Dim = 2; +const uint64_t N_updates = 2; +const uint64_t Updates_index[2] = {0, 0}; +const double Updates[4] = {0.0, 0.0, 0.0, 0.0}; +double Slater_inv[4] = {0.0, 0.0, 0.0, 0.0}; + +rc = qmckl_sherman_morrison_c(context, Dim, N_updates, Updates, Updates_index, Slater_inv); +assert(rc == QMCKL_SUCCESS); + +assert (qmckl_context_destroy(context) == QMCKL_SUCCESS); + return 0; +} diff --git a/qmckl b/qmckl index 7b2a8ca..04d2ec2 160000 --- a/qmckl +++ b/qmckl @@ -1 +1 @@ -Subproject commit 7b2a8caeabadb7724b9d7c8b0498e7ea71b7b992 +Subproject commit 04d2ec2d7098f2ac3f8e1539ab139aa35dfabe45 diff --git a/qmckl.h b/qmckl.h new file mode 120000 index 0000000..be9fbea --- /dev/null +++ b/qmckl.h @@ -0,0 +1 @@ +qmckl/build/include/qmckl.h \ No newline at end of file diff --git a/smvars.sh b/smvars.sh index 4f24e7b..05174bc 100644 --- a/smvars.sh +++ b/smvars.sh @@ -27,9 +27,9 @@ export SMROOT case $ENV in intel) echo "* SM build environment set to 'intel'" - export HDF5_CXX=icpx - export HDF5_CXXLINKER=icpx - export HDF5_CLINKER=icpx + export HDF5_CXX=icpc + export HDF5_CXXLINKER=icpc + export HDF5_CLINKER=icpc export ENV=INTEL ;; llvm) diff --git a/tests/qmckl_test_h5.cpp b/tests/qmckl_test_h5.cpp index 6c594dc..584824a 100644 --- a/tests/qmckl_test_h5.cpp +++ b/tests/qmckl_test_h5.cpp @@ -1,37 +1,41 @@ #include "hdf5/serial/H5Cpp.h" #include "hdf5/serial/hdf5.h" +#include "Helpers.hpp" #include "qmckl.h" +#include "assert.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include +#ifndef THRESHOLD +#define THRESHOLD 1e-3 +#endif + #include "cstring" #include "iostream" -#include "Helpers.hpp" - #define PERF #ifdef PERF unsigned int repetition_number; #endif -using namespace H5; - -// #define DEBUG - const H5std_string FILE_NAME("dataset.hdf5"); -void read_int(H5File file, std::string key, uint64_t *data) { - DataSet ds = file.openDataSet(key); - ds.read(data, PredType::STD_U32LE); +void read_int(H5::H5File file, std::string key, uint64_t *data) { + H5::DataSet ds = file.openDataSet(key); + ds.read(data, H5::PredType::STD_U32LE); ds.close(); } -void read_double(H5File file, std::string key, double *data) { - DataSet ds = file.openDataSet(key); - ds.read(data, PredType::IEEE_F64LE); +void read_double(H5::H5File file, std::string key, double *data) { + H5::DataSet ds = file.openDataSet(key); + ds.read(data, H5::PredType::IEEE_F64LE); ds.close(); } -int test_cycle(H5File file, int cycle, std::string version, double tolerance) { +int test_cycle(H5::H5File file, int cycle, std::string version, double tolerance) { /* Read the data */ @@ -76,14 +80,32 @@ int test_cycle(H5File file, int cycle, std::string version, double tolerance) { for (unsigned int i = 0; i < repetition_number; i++) { memcpy(slater_inverse_nonpersistent, slater_inverse, dim * dim * sizeof(double)); - qmckl_exit_code sherman_morrison_exit; qmckl_context context; - sherman_morrison_exit = qmckl_sherman_morrison_c(context, - dim, - nupdates, - u, - col_update_index, - slater_inverse_nonpersistent); + 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); + const uint64_t Dim = 2; + const uint64_t N_updates = 2; + const uint64_t Updates_index[2] = {0, 0}; + const double Updates[4] = {0.0, 0.0, 0.0, 0.0}; + double Slater_inv[4] = {0.0, 0.0, 0.0, 0.0}; + rc = qmckl_sherman_morrison_c(context, + Dim, + N_updates, + Updates, + Updates_index, + Slater_inv); + assert(rc == QMCKL_SUCCESS); } } else { @@ -148,7 +170,7 @@ int main(int argc, char **argv) { int start_cycle = std::stoi(argv[2]); int stop_cycle = std::stoi(argv[3]); double tolerance = std::stod(argv[4]); - H5File file(FILE_NAME, H5F_ACC_RDONLY); + H5::H5File file(FILE_NAME, H5F_ACC_RDONLY); #ifdef PERF repetition_number = std::stoi(argv[5]);