mirror of
https://github.com/TREX-CoE/Sherman-Morrison.git
synced 2024-08-25 06:31:44 +02:00
Cleanup 1
This commit is contained in:
parent
08e4e56e50
commit
2a39aabaf0
4
Makefile
4
Makefile
@ -1,6 +1,6 @@
|
||||
## Compilers, compiler flags & external libs
|
||||
ifeq ($(ENV),INTEL)
|
||||
CXX = icpc
|
||||
CXX = icpx
|
||||
FC = ifort
|
||||
ARCH = -march=native
|
||||
OPT = -O3
|
||||
@ -15,7 +15,7 @@ else ifeq ($(ENV),GNU)
|
||||
CXX = g++
|
||||
FC = gfortran
|
||||
ARCH = -mavx
|
||||
OPT = -O0
|
||||
OPT = -O3
|
||||
DEBUG = -g
|
||||
else
|
||||
$(error No valid compiler environment set in $$ENV. \
|
||||
|
@ -4,18 +4,8 @@ void SMWB1(double *Slater_inv, const unsigned int Dim,
|
||||
const unsigned int N_updates, double *Updates,
|
||||
unsigned int *Updates_index);
|
||||
|
||||
// // Sherman-Morrison-Woodbury kernel 2
|
||||
// // WB2, WB3, SM3 mixing scheme
|
||||
// void SMWB2(double *Slater_inv, unsigned int Dim, unsigned int N_updates,
|
||||
// double *Updates, unsigned int *Updates_index);
|
||||
|
||||
// // Sherman-Morrison-Woodbury kernel 3
|
||||
// // WB2, WB3, SM4 mixing scheme
|
||||
// void SMWB3(double *Slater_inv, unsigned int Dim, unsigned int N_updates,
|
||||
// double *Updates, unsigned int *Updates_index);
|
||||
|
||||
// Sherman-Morrison-Woodbury kernel 4
|
||||
// Sherman-Morrison-Woodbury kernel 2
|
||||
// WB2, SM2 mixing scheme
|
||||
void SMWB4(double *Slater_inv, const unsigned int Dim,
|
||||
void SMWB2(double *Slater_inv, const unsigned int Dim,
|
||||
const unsigned int N_updates, double *Updates,
|
||||
unsigned int *Updates_index);
|
||||
|
@ -27,20 +27,23 @@ export SMROOT
|
||||
case $ENV in
|
||||
intel)
|
||||
echo "* SM build environment set to 'intel'"
|
||||
export HDF5_CXX=icpc
|
||||
export HDF5_CXXLINKER=icpc
|
||||
export HDF5_CXX=icpx
|
||||
export HDF5_CXXLINKER=icpx
|
||||
export HDF5_CLINKER=icpx
|
||||
export ENV=INTEL
|
||||
;;
|
||||
llvm)
|
||||
echo "* SM build environment set to 'llvm'"
|
||||
export HDF5_CXX=clang++
|
||||
export HDF5_CXXLINKER=clang++
|
||||
export HDF5_CLINKER=clang++
|
||||
export ENV=LLVM
|
||||
;;
|
||||
vfc)
|
||||
echo "* SM build environment set to 'vfc'"
|
||||
export HDF5_CXX=clang++
|
||||
export HDF5_CXXLINKER=clang++
|
||||
export HDF5_CLINKER=clang++
|
||||
export ENV=LLVM
|
||||
export VFC_BACKENDS="libinterflop_ieee.so --count-op"
|
||||
;;
|
||||
@ -48,6 +51,7 @@ case $ENV in
|
||||
echo "* SM build environment set to 'gnu'"
|
||||
export HDF5_CXX=g++
|
||||
export HDF5_CXXLINKER=g++
|
||||
export HDF5_CLINKER=g++
|
||||
export ENV=GNU
|
||||
;;
|
||||
*)
|
||||
|
@ -80,9 +80,9 @@ void SMWB1(double *Slater_inv, const unsigned int Dim,
|
||||
}
|
||||
}
|
||||
|
||||
// Sherman-Morrison-Woodbury kernel 4
|
||||
// Sherman-Morrison-Woodbury kernel 2
|
||||
// WB2, SM2 mixing scheme
|
||||
void SMWB4(double *Slater_inv, const unsigned int Dim,
|
||||
void SMWB2(double *Slater_inv, const unsigned int Dim,
|
||||
const unsigned int N_updates, double *Updates,
|
||||
unsigned int *Updates_index) {
|
||||
#ifdef DEBUG2
|
||||
@ -144,8 +144,8 @@ void SMWB1_f(double **linSlater_inv, unsigned int *Dim, unsigned int *N_updates,
|
||||
double **linUpdates, unsigned int **Updates_index) {
|
||||
SMWB1(*linSlater_inv, *Dim, *N_updates, *linUpdates, *Updates_index);
|
||||
}
|
||||
void SMWB4_f(double **linSlater_inv, unsigned int *Dim, unsigned int *N_updates,
|
||||
void SMWB2_f(double **linSlater_inv, unsigned int *Dim, unsigned int *N_updates,
|
||||
double **linUpdates, unsigned int **Updates_index) {
|
||||
SMWB4(*linSlater_inv, *Dim, *N_updates, *linUpdates, *Updates_index);
|
||||
SMWB2(*linSlater_inv, *Dim, *N_updates, *linUpdates, *Updates_index);
|
||||
}
|
||||
}
|
||||
|
@ -134,8 +134,8 @@ bool WB3(double *Slater_inv, const unsigned int Dim, double *Updates,
|
||||
|
||||
// Check if determinant of B is not too close to zero
|
||||
double det;
|
||||
det = B0 * (B4 * B8 - B5 * B7) -
|
||||
B1 * (B3 * B8 - B5 * B6) + B2 * (B3 * B7 - B4 * B6);
|
||||
det = B0 * (B4 * B8 - B5 * B7) - B1 * (B3 * B8 - B5 * B6) +
|
||||
B2 * (B3 * B7 - B4 * B6);
|
||||
#ifdef DEBUG2
|
||||
std::cerr << "Determinant of B = " << det << std::endl;
|
||||
#endif
|
||||
@ -198,10 +198,14 @@ bool WB3(double *Slater_inv, const unsigned int Dim, double *Updates,
|
||||
extern "C" {
|
||||
bool WB2_f(double **linSlater_inv, unsigned int *Dim, double **linUpdates,
|
||||
unsigned int **Updates_index) {
|
||||
WB2(*linSlater_inv, *Dim, *linUpdates, *Updates_index);
|
||||
bool ok;
|
||||
ok = WB2(*linSlater_inv, *Dim, *linUpdates, *Updates_index);
|
||||
return ok;
|
||||
}
|
||||
bool WB3_f(double **linSlater_inv, unsigned int *Dim, double **linUpdates,
|
||||
unsigned int **Updates_index) {
|
||||
WB3(*linSlater_inv, *Dim, *linUpdates, *Updates_index);
|
||||
bool ok;
|
||||
ok = WB3(*linSlater_inv, *Dim, *linUpdates, *Updates_index);
|
||||
return ok;
|
||||
}
|
||||
}
|
||||
|
@ -126,11 +126,11 @@ int test_cycle(H5File file, int cycle, std::string version, double tolerance) {
|
||||
dim * dim * sizeof(double));
|
||||
SMWB1(slater_inverse_nonpersistent, dim, nupdates, u, col_update_index);
|
||||
}
|
||||
} else if (version == "smwb4") {
|
||||
} else if (version == "smwb2") {
|
||||
for (unsigned int i = 0; i < repetition_number; i++) {
|
||||
std::memcpy(slater_inverse_nonpersistent, slater_inverse,
|
||||
dim * dim * sizeof(double));
|
||||
SMWB4(slater_inverse_nonpersistent, dim, nupdates, u, col_update_index);
|
||||
SMWB2(slater_inverse_nonpersistent, dim, nupdates, u, col_update_index);
|
||||
}
|
||||
#ifdef MKL
|
||||
} else if (version == "lapack") {
|
||||
@ -170,8 +170,8 @@ int test_cycle(H5File file, int cycle, std::string version, double tolerance) {
|
||||
// SMWB2(slater_inverse, dim, nupdates, u, col_update_index);
|
||||
// } else if (version == "smwb3") {
|
||||
// SMWB3(slater_inverse, dim, nupdates, u, col_update_index);
|
||||
} else if (version == "smwb4") {
|
||||
SMWB4(slater_inverse, dim, nupdates, u, col_update_index);
|
||||
} else if (version == "smwb2") {
|
||||
SMWB2(slater_inverse, dim, nupdates, u, col_update_index);
|
||||
#ifdef MKL
|
||||
} else if (version == "lapack") {
|
||||
memcpy(slater_inverse, slater_matrix, dim * dim * sizeof(double));
|
||||
|
@ -104,14 +104,8 @@ int test_cycle(H5File file, int cycle, std::string version, double tolerance) {
|
||||
WB3(slater_inverse_nonpersistent, dim, u, col_update_index);
|
||||
} else if (version == "smwb1") {
|
||||
SMWB1(slater_inverse_nonpersistent, dim, nupdates, u, col_update_index);
|
||||
// } else if (version == "smwb2") {
|
||||
// SMWB2(slater_inverse_nonpersistent, dim, nupdates, u,
|
||||
// col_update_index);
|
||||
// } else if (version == "smwb3") {
|
||||
// SMWB3(slater_inverse_nonpersistent, dim, nupdates, u,
|
||||
// col_update_index);
|
||||
} else if (version == "smwb4") {
|
||||
SMWB4(slater_inverse_nonpersistent, dim, nupdates, u, col_update_index);
|
||||
} else if (version == "smwb2") {
|
||||
SMWB2(slater_inverse_nonpersistent, dim, nupdates, u, col_update_index);
|
||||
#ifdef MKL
|
||||
} else if (version == "lapack") {
|
||||
memcpy(slater_inverse_nonpersistent, slater_matrix,
|
||||
@ -145,10 +139,6 @@ int test_cycle(H5File file, int cycle, std::string version, double tolerance) {
|
||||
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);
|
||||
// } else if (version == "smwb3") {
|
||||
// SMWB3(slater_inverse, dim, nupdates, u, col_update_index);
|
||||
} else if (version == "smwb4") {
|
||||
SMWB4(slater_inverse, dim, nupdates, u, col_update_index);
|
||||
#ifdef MKL
|
||||
|
Loading…
Reference in New Issue
Block a user