More minor bug fixes

This commit is contained in:
Francois Coppens 2021-09-21 14:20:41 +02:00
parent c9d1abd29d
commit 0614971437
2 changed files with 33 additions and 25 deletions

View File

@ -52,8 +52,8 @@ DEPS_F = $(DEPS_CXX) \
$(OBJ_DIR)/helpers_mod.o
## QMCkl includes and linking
QMCKL_INCLUDE = -I $(SMROOT)/qmckl/build/include
QMCKLLFLAGS = -L$(SMROOT)/qmckl/build/lib -lqmckl
QMCKL_INCLUDE = -I$(SMROOT)/qmckl/include
QMCKLLFLAGS = -L$(SMROOT)/qmckl/src/.libs -lqmckl
## Directory structure
@ -66,6 +66,7 @@ BIN_DIR := bin
EXEC := $(BIN_DIR)/cMaponiA3_test_3x3_3 \
$(BIN_DIR)/test_h5 \
$(BIN_DIR)/fnu_test_h5 \
$(BIN_DIR)/qmckl_test_c \
$(BIN_DIR)/fMaponiA3_test_3x3_3 \
$(BIN_DIR)/fMaponiA3_test_4x4_2 \
$(BIN_DIR)/QMCChem_dataset_test
@ -97,8 +98,13 @@ $(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp $(INC_DIR)/* | $(OBJ_DIR)
## HDF5/C++ objects
$(OBJ_DIR)/%_h5.o: $(TST_DIR)/%_h5.cpp $(INC_DIR)/* | $(OBJ_DIR)
$(H5CXX) $(H5CXXFLAGS) $(INCLUDE) -c -o $@ $<
## HDF5/C++ objects
$(OBJ_DIR)/qmckl_test_c.o: $(TST_DIR)/qmckl_test_c.cpp $(INC_DIR)/* | $(OBJ_DIR)
$(H5CXX) $(H5CXXFLAGS) $(INCLUDE) $(QMCKL_INCLUDE) -c -o $@ $<
## Fortran modules
$(OBJ_DIR)/%_mod.o: $(SRC_DIR)/%_mod.f90 | $(OBJ_DIR)
ifeq ($(ENV),$(filter $(ENV),LLVM GNU))
@ -122,7 +128,7 @@ $(BIN_DIR)/test_h5: $(OBJ_DIR)/test_h5.o $(DEPS_CXX) | $(BIN_DIR)
$(BIN_DIR)/fnu_test_h5: $(OBJ_DIR)/fnu_test_h5.o $(DEPS_CXX) | $(BIN_DIR)
$(H5CXX) $(H5LFLAGS) -o $@ $^
$(BIN_DIR)/qmckl_test_h5: $(OBJ_DIR)/qmckl_test_h5.o | $(BIN_DIR)
$(BIN_DIR)/qmckl_test_c: $(OBJ_DIR)/qmckl_test_c.o | $(BIN_DIR)
$(H5CXX) $(H5LFLAGS) $(QMCKLLFLAGS) -o $@ $^
$(BIN_DIR)/fMaponiA3_test_3x3_3: $(DEPS_F) $(OBJ_DIR)/fMaponiA3_test_3x3_3.o | $(BIN_DIR)

View File

@ -59,6 +59,8 @@ int test_cycle(H5File file, int cycle, std::string version, double tolerance) {
double *u = new double[nupdates * dim];
const double breakdown = 1e-3;
/* Test */
#ifdef DEBUG2
showMatrix(slater_inverse, dim, "OLD Inverse");
@ -88,49 +90,49 @@ int test_cycle(H5File file, int cycle, std::string version, double tolerance) {
for (unsigned int i = 0; i < repetition_number; i++) {
std::memcpy(slater_inverse_nonpersistent, slater_inverse,
dim * dim * sizeof(double));
SM1(slater_inverse_nonpersistent, dim, nupdates, u, col_update_index);
SM1(slater_inverse_nonpersistent, dim, nupdates, u, col_update_index, breakdown);
}
} else if (version == "sm2") {
for (unsigned int i = 0; i < repetition_number; i++) {
std::memcpy(slater_inverse_nonpersistent, slater_inverse,
dim * dim * sizeof(double));
SM2(slater_inverse_nonpersistent, dim, nupdates, u, col_update_index);
SM2(slater_inverse_nonpersistent, dim, nupdates, u, col_update_index, breakdown);
}
} else if (version == "sm3") {
for (unsigned int i = 0; i < repetition_number; i++) {
std::memcpy(slater_inverse_nonpersistent, slater_inverse,
dim * dim * sizeof(double));
SM3(slater_inverse_nonpersistent, dim, nupdates, u, col_update_index);
SM3(slater_inverse_nonpersistent, dim, nupdates, u, col_update_index, breakdown);
}
} else if (version == "sm4") {
for (unsigned int i = 0; i < repetition_number; i++) {
std::memcpy(slater_inverse_nonpersistent, slater_inverse,
dim * dim * sizeof(double));
SM4(slater_inverse_nonpersistent, dim, nupdates, u, col_update_index);
SM4(slater_inverse_nonpersistent, dim, nupdates, u, col_update_index, breakdown);
}
} else if (version == "wb2") {
for (unsigned int i = 0; i < repetition_number; i++) {
std::memcpy(slater_inverse_nonpersistent, slater_inverse,
dim * dim * sizeof(double));
WB2(slater_inverse_nonpersistent, dim, u, col_update_index);
WB2(slater_inverse_nonpersistent, dim, u, col_update_index, breakdown);
}
} else if (version == "wb3") {
for (unsigned int i = 0; i < repetition_number; i++) {
std::memcpy(slater_inverse_nonpersistent, slater_inverse,
dim * dim * sizeof(double));
WB3(slater_inverse_nonpersistent, dim, u, col_update_index);
WB3(slater_inverse_nonpersistent, dim, u, col_update_index, breakdown);
}
} else if (version == "smwb1") {
} else if (version == "wb2s") {
for (unsigned int i = 0; i < repetition_number; i++) {
std::memcpy(slater_inverse_nonpersistent, slater_inverse,
dim * dim * sizeof(double));
SMWB1(slater_inverse_nonpersistent, dim, nupdates, u, col_update_index);
WB2s(slater_inverse_nonpersistent, dim, nupdates, u, col_update_index, breakdown);
}
} else if (version == "smwb2") {
} else if (version == "wb32s") {
for (unsigned int i = 0; i < repetition_number; i++) {
std::memcpy(slater_inverse_nonpersistent, slater_inverse,
dim * dim * sizeof(double));
SMWB2(slater_inverse_nonpersistent, dim, nupdates, u, col_update_index);
WB32s(slater_inverse_nonpersistent, dim, nupdates, u, col_update_index, breakdown);
}
#ifdef MKL
} else if (version == "lapack") {
@ -149,25 +151,25 @@ int test_cycle(H5File file, int cycle, std::string version, double tolerance) {
delete[] slater_inverse_nonpersistent;
#else // No performance measurements repetition
if (version == "maponia3") {
MaponiA3(slater_inverse, dim, nupdates, u, col_update_index);
MaponiA3(slater_inverse, dim, nupdates, u, col_update_index, breakdown);
} else if (version == "maponia3s") {
MaponiA3S(slater_inverse, dim, nupdates, u, col_update_index);
MaponiA3S(slater_inverse, dim, nupdates, u, col_update_index, breakdown;
} else if (version == "sm1") {
SM1(slater_inverse, dim, nupdates, u, col_update_index);
SM1(slater_inverse, dim, nupdates, u, col_update_index, breakdown);
} else if (version == "sm2") {
SM2(slater_inverse, dim, nupdates, u, col_update_index);
SM2(slater_inverse, dim, nupdates, u, col_update_index, breakdown);
} else if (version == "sm3") {
SM3(slater_inverse, dim, nupdates, u, col_update_index);
SM3(slater_inverse, dim, nupdates, u, col_update_index, breakdown);
} else if (version == "sm4") {
SM4(slater_inverse, dim, nupdates, u, col_update_index);
SM4(slater_inverse, dim, nupdates, u, col_update_index, breakdown);
} else if (version == "wb2") {
WB2(slater_inverse, dim, u, col_update_index);
WB2(slater_inverse, dim, u, col_update_index, breakdown);
} else if (version == "wb3") {
WB3(slater_inverse, dim, u, col_update_index);
} else if (version == "smwb1") {
SMWB1(slater_inverse, dim, nupdates, u, col_update_index);
} else if (version == "smwb2") {
SMWB2(slater_inverse, dim, nupdates, u, col_update_index);
WB3(slater_inverse, dim, u, col_update_index, breakdown);
} else if (version == "wb2s") {
WB2s(slater_inverse, dim, nupdates, u, col_update_index, breakdown);
} else if (version == "wb32s") {
WB32s(slater_inverse, dim, nupdates, u, col_update_index, breakdown);
#ifdef MKL
} else if (version == "lapack") {
memcpy(slater_inverse, slater_matrix, dim * dim * sizeof(double));