mirror of
https://github.com/TREX-CoE/Sherman-Morrison.git
synced 2025-01-12 14:08:34 +01:00
Trying to fix linking against QMCkl.
This commit is contained in:
parent
8961f78ea2
commit
b7764bb229
4
Makefile
4
Makefile
@ -1,6 +1,6 @@
|
|||||||
## Compilers, compiler flags & external libs
|
## Compilers, compiler flags & external libs
|
||||||
ifeq ($(ENV),INTEL)
|
ifeq ($(ENV),INTEL)
|
||||||
CXX = icpx
|
CXX = icpc
|
||||||
FC = ifort
|
FC = ifort
|
||||||
ARCH = -march=native
|
ARCH = -march=native
|
||||||
OPT = -O3
|
OPT = -O3
|
||||||
@ -51,7 +51,7 @@ DEPS_F = $(DEPS_CXX) \
|
|||||||
$(OBJ_DIR)/helpers_mod.o
|
$(OBJ_DIR)/helpers_mod.o
|
||||||
|
|
||||||
## QMCkl includes and linking
|
## 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
|
QMCKLLFLAGS = -L$(SMROOT)/qmckl/build/lib -lqmckl
|
||||||
|
|
||||||
|
|
||||||
|
1
libqmckl.a
Symbolic link
1
libqmckl.a
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
qmckl/build/lib/libqmckl.a
|
1
libqmckl.la
Symbolic link
1
libqmckl.la
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
qmckl/build/lib/libqmckl.la
|
1
libqmckl.so
Symbolic link
1
libqmckl.so
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
qmckl/build/lib/libqmckl.so
|
1
libqmckl.so.0
Symbolic link
1
libqmckl.so.0
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
qmckl/build/lib/libqmckl.so.0
|
1
libqmckl.so.0.0.0
Symbolic link
1
libqmckl.so.0.0.0
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
qmckl/build/lib/libqmckl.so.0.0.0
|
28
main.cpp
Normal file
28
main.cpp
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#include "qmckl.h"
|
||||||
|
#include "assert.h"
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
#include <math.h>
|
||||||
|
#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;
|
||||||
|
}
|
2
qmckl
2
qmckl
@ -1 +1 @@
|
|||||||
Subproject commit 7b2a8caeabadb7724b9d7c8b0498e7ea71b7b992
|
Subproject commit 04d2ec2d7098f2ac3f8e1539ab139aa35dfabe45
|
@ -27,9 +27,9 @@ export SMROOT
|
|||||||
case $ENV in
|
case $ENV in
|
||||||
intel)
|
intel)
|
||||||
echo "* SM build environment set to 'intel'"
|
echo "* SM build environment set to 'intel'"
|
||||||
export HDF5_CXX=icpx
|
export HDF5_CXX=icpc
|
||||||
export HDF5_CXXLINKER=icpx
|
export HDF5_CXXLINKER=icpc
|
||||||
export HDF5_CLINKER=icpx
|
export HDF5_CLINKER=icpc
|
||||||
export ENV=INTEL
|
export ENV=INTEL
|
||||||
;;
|
;;
|
||||||
llvm)
|
llvm)
|
||||||
|
@ -1,37 +1,41 @@
|
|||||||
#include "hdf5/serial/H5Cpp.h"
|
#include "hdf5/serial/H5Cpp.h"
|
||||||
#include "hdf5/serial/hdf5.h"
|
#include "hdf5/serial/hdf5.h"
|
||||||
|
|
||||||
|
#include "Helpers.hpp"
|
||||||
#include "qmckl.h"
|
#include "qmckl.h"
|
||||||
|
#include "assert.h"
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
#include <math.h>
|
||||||
|
#ifndef THRESHOLD
|
||||||
|
#define THRESHOLD 1e-3
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "cstring"
|
#include "cstring"
|
||||||
#include "iostream"
|
#include "iostream"
|
||||||
|
|
||||||
#include "Helpers.hpp"
|
|
||||||
|
|
||||||
#define PERF
|
#define PERF
|
||||||
|
|
||||||
#ifdef PERF
|
#ifdef PERF
|
||||||
unsigned int repetition_number;
|
unsigned int repetition_number;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using namespace H5;
|
|
||||||
|
|
||||||
// #define DEBUG
|
|
||||||
|
|
||||||
const H5std_string FILE_NAME("dataset.hdf5");
|
const H5std_string FILE_NAME("dataset.hdf5");
|
||||||
|
|
||||||
void read_int(H5File file, std::string key, uint64_t *data) {
|
void read_int(H5::H5File file, std::string key, uint64_t *data) {
|
||||||
DataSet ds = file.openDataSet(key);
|
H5::DataSet ds = file.openDataSet(key);
|
||||||
ds.read(data, PredType::STD_U32LE);
|
ds.read(data, H5::PredType::STD_U32LE);
|
||||||
ds.close();
|
ds.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void read_double(H5File file, std::string key, double *data) {
|
void read_double(H5::H5File file, std::string key, double *data) {
|
||||||
DataSet ds = file.openDataSet(key);
|
H5::DataSet ds = file.openDataSet(key);
|
||||||
ds.read(data, PredType::IEEE_F64LE);
|
ds.read(data, H5::PredType::IEEE_F64LE);
|
||||||
ds.close();
|
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 */
|
/* 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++) {
|
for (unsigned int i = 0; i < repetition_number; i++) {
|
||||||
memcpy(slater_inverse_nonpersistent, slater_inverse,
|
memcpy(slater_inverse_nonpersistent, slater_inverse,
|
||||||
dim * dim * sizeof(double));
|
dim * dim * sizeof(double));
|
||||||
qmckl_exit_code sherman_morrison_exit;
|
|
||||||
qmckl_context context;
|
qmckl_context context;
|
||||||
sherman_morrison_exit = qmckl_sherman_morrison_c(context,
|
context = qmckl_context_create();
|
||||||
dim,
|
qmckl_exit_code rc;
|
||||||
nupdates,
|
// const uint64_t cdim = dim;
|
||||||
u,
|
// const uint64_t cnupdates = nupdates;
|
||||||
col_update_index,
|
// const uint64_t* ccol_update_index = col_update_index;
|
||||||
slater_inverse_nonpersistent);
|
// 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 {
|
else {
|
||||||
@ -148,7 +170,7 @@ int main(int argc, char **argv) {
|
|||||||
int start_cycle = std::stoi(argv[2]);
|
int start_cycle = std::stoi(argv[2]);
|
||||||
int stop_cycle = std::stoi(argv[3]);
|
int stop_cycle = std::stoi(argv[3]);
|
||||||
double tolerance = std::stod(argv[4]);
|
double tolerance = std::stod(argv[4]);
|
||||||
H5File file(FILE_NAME, H5F_ACC_RDONLY);
|
H5::H5File file(FILE_NAME, H5F_ACC_RDONLY);
|
||||||
|
|
||||||
#ifdef PERF
|
#ifdef PERF
|
||||||
repetition_number = std::stoi(argv[5]);
|
repetition_number = std::stoi(argv[5]);
|
||||||
|
Loading…
Reference in New Issue
Block a user