2021-02-27 12:25:55 +01:00
|
|
|
## Compilers
|
2021-03-15 14:01:38 +01:00
|
|
|
ARCH =
|
|
|
|
CXX = clang++
|
|
|
|
FC = flang-7
|
2021-03-12 12:38:50 +01:00
|
|
|
H5CXX = h5c++
|
2021-02-04 18:52:26 +01:00
|
|
|
|
2021-02-27 12:25:55 +01:00
|
|
|
## Compiler flags
|
2021-03-15 14:01:38 +01:00
|
|
|
CXXFLAGS = -O0
|
2021-03-12 12:38:50 +01:00
|
|
|
FFLAGS = $(CXXFLAGS)
|
|
|
|
H5CXXFLAGS = $(CXXFLAGS) -fPIC
|
|
|
|
FLIBS = -lstdc++
|
The algorithm now works for the following 4x4 example with 2 updates:
S = [1,0,1,-1; 0,1,1,0; -1,0,-1,0; 1,1,1,1]
S_inv = [1,-1,1,1; 1,0,2,1; -1,1,-2,-1; -1,0,-1,0]
u1 = [0,-2,0,0]
u2 = [0,-1,0,0]
upd_idx = [2,4]
To go from Maponi's examples where the number of updates is always equal
to the the dimension of the matrix, and the decomposition is always
diagonal, to cases with a non-diagonal decomposition and a number of
updates unequal to its size, the following changed needed to be made:
* in the calculation of the {y0k} an extra inner for-loop needs to be
added to make it a full matrix-vector multiplication due to the fact
that A0 is not a diagonal matrix
* in some places the use of the update-order vector p needs
the be replaced with that of upd_idx to make sure the correct
component of the ylk is selected and the proper rank-1 matrices are
constructed
* when a matrix is passed from Fortran to C++ with 2D adressing, it is
passed in colum-major order. The passed matrix needs to be transposed
before passing to C++. Doing this inside the algorithm will break
compatibility with called from C/C++.
2021-02-21 18:28:08 +01:00
|
|
|
|
2021-02-27 12:25:55 +01:00
|
|
|
INCLUDE = -I $(INC_DIR)/
|
2021-03-05 17:00:48 +01:00
|
|
|
DEPS_CXX = $(OBJ_DIR)/SM_MaponiA3.o $(OBJ_DIR)/SM_Standard.o
|
2021-02-27 12:25:55 +01:00
|
|
|
DEPS_F = $(DEPS_CXX) $(OBJ_DIR)/SM_MaponiA3_mod.o $(OBJ_DIR)/Helpers_mod.o
|
The algorithm now works for the following 4x4 example with 2 updates:
S = [1,0,1,-1; 0,1,1,0; -1,0,-1,0; 1,1,1,1]
S_inv = [1,-1,1,1; 1,0,2,1; -1,1,-2,-1; -1,0,-1,0]
u1 = [0,-2,0,0]
u2 = [0,-1,0,0]
upd_idx = [2,4]
To go from Maponi's examples where the number of updates is always equal
to the the dimension of the matrix, and the decomposition is always
diagonal, to cases with a non-diagonal decomposition and a number of
updates unequal to its size, the following changed needed to be made:
* in the calculation of the {y0k} an extra inner for-loop needs to be
added to make it a full matrix-vector multiplication due to the fact
that A0 is not a diagonal matrix
* in some places the use of the update-order vector p needs
the be replaced with that of upd_idx to make sure the correct
component of the ylk is selected and the proper rank-1 matrices are
constructed
* when a matrix is passed from Fortran to C++ with 2D adressing, it is
passed in colum-major order. The passed matrix needs to be transposed
before passing to C++. Doing this inside the algorithm will break
compatibility with called from C/C++.
2021-02-21 18:28:08 +01:00
|
|
|
|
2021-02-27 12:25:55 +01:00
|
|
|
SRC_DIR := src
|
|
|
|
TST_DIR := tests
|
|
|
|
INC_DIR := include
|
|
|
|
OBJ_DIR := build
|
|
|
|
BIN_DIR := bin
|
The algorithm now works for the following 4x4 example with 2 updates:
S = [1,0,1,-1; 0,1,1,0; -1,0,-1,0; 1,1,1,1]
S_inv = [1,-1,1,1; 1,0,2,1; -1,1,-2,-1; -1,0,-1,0]
u1 = [0,-2,0,0]
u2 = [0,-1,0,0]
upd_idx = [2,4]
To go from Maponi's examples where the number of updates is always equal
to the the dimension of the matrix, and the decomposition is always
diagonal, to cases with a non-diagonal decomposition and a number of
updates unequal to its size, the following changed needed to be made:
* in the calculation of the {y0k} an extra inner for-loop needs to be
added to make it a full matrix-vector multiplication due to the fact
that A0 is not a diagonal matrix
* in some places the use of the update-order vector p needs
the be replaced with that of upd_idx to make sure the correct
component of the ylk is selected and the proper rank-1 matrices are
constructed
* when a matrix is passed from Fortran to C++ with 2D adressing, it is
passed in colum-major order. The passed matrix needs to be transposed
before passing to C++. Doing this inside the algorithm will break
compatibility with called from C/C++.
2021-02-21 18:28:08 +01:00
|
|
|
|
2021-02-27 12:25:55 +01:00
|
|
|
EXEC := $(BIN_DIR)/cMaponiA3_test_3x3_3 \
|
2021-02-28 09:28:42 +01:00
|
|
|
$(BIN_DIR)/test_internal_h5 \
|
|
|
|
$(BIN_DIR)/test_external_h5 \
|
2021-02-27 12:25:55 +01:00
|
|
|
$(BIN_DIR)/fMaponiA3_test_3x3_3 \
|
|
|
|
$(BIN_DIR)/fMaponiA3_test_4x4_2 \
|
|
|
|
$(BIN_DIR)/QMCChem_dataset_test
|
The algorithm now works for the following 4x4 example with 2 updates:
S = [1,0,1,-1; 0,1,1,0; -1,0,-1,0; 1,1,1,1]
S_inv = [1,-1,1,1; 1,0,2,1; -1,1,-2,-1; -1,0,-1,0]
u1 = [0,-2,0,0]
u2 = [0,-1,0,0]
upd_idx = [2,4]
To go from Maponi's examples where the number of updates is always equal
to the the dimension of the matrix, and the decomposition is always
diagonal, to cases with a non-diagonal decomposition and a number of
updates unequal to its size, the following changed needed to be made:
* in the calculation of the {y0k} an extra inner for-loop needs to be
added to make it a full matrix-vector multiplication due to the fact
that A0 is not a diagonal matrix
* in some places the use of the update-order vector p needs
the be replaced with that of upd_idx to make sure the correct
component of the ylk is selected and the proper rank-1 matrices are
constructed
* when a matrix is passed from Fortran to C++ with 2D adressing, it is
passed in colum-major order. The passed matrix needs to be transposed
before passing to C++. Doing this inside the algorithm will break
compatibility with called from C/C++.
2021-02-21 18:28:08 +01:00
|
|
|
|
2021-02-04 18:52:26 +01:00
|
|
|
## Build tagets
|
2021-02-04 13:12:34 +01:00
|
|
|
.PHONY: all clean distclean
|
|
|
|
|
2021-02-27 12:25:55 +01:00
|
|
|
all: $(EXEC)
|
|
|
|
|
2021-02-04 13:12:34 +01:00
|
|
|
clean:
|
2021-02-26 17:28:52 +01:00
|
|
|
@rm -vrf $(OBJ_DIR)
|
2021-02-09 13:40:52 +01:00
|
|
|
|
2021-02-04 13:12:34 +01:00
|
|
|
distclean: clean
|
2021-02-26 17:28:52 +01:00
|
|
|
@rm -vrf $(BIN_DIR) \
|
|
|
|
Slater* Updates.dat
|
The algorithm now works for the following 4x4 example with 2 updates:
S = [1,0,1,-1; 0,1,1,0; -1,0,-1,0; 1,1,1,1]
S_inv = [1,-1,1,1; 1,0,2,1; -1,1,-2,-1; -1,0,-1,0]
u1 = [0,-2,0,0]
u2 = [0,-1,0,0]
upd_idx = [2,4]
To go from Maponi's examples where the number of updates is always equal
to the the dimension of the matrix, and the decomposition is always
diagonal, to cases with a non-diagonal decomposition and a number of
updates unequal to its size, the following changed needed to be made:
* in the calculation of the {y0k} an extra inner for-loop needs to be
added to make it a full matrix-vector multiplication due to the fact
that A0 is not a diagonal matrix
* in some places the use of the update-order vector p needs
the be replaced with that of upd_idx to make sure the correct
component of the ylk is selected and the proper rank-1 matrices are
constructed
* when a matrix is passed from Fortran to C++ with 2D adressing, it is
passed in colum-major order. The passed matrix needs to be transposed
before passing to C++. Doing this inside the algorithm will break
compatibility with called from C/C++.
2021-02-21 18:28:08 +01:00
|
|
|
|
2021-02-04 13:12:34 +01:00
|
|
|
|
2021-02-27 12:25:55 +01:00
|
|
|
#### COMPILING
|
|
|
|
$(BIN_DIR) $(OBJ_DIR):
|
|
|
|
mkdir -p $@
|
2021-02-04 11:39:00 +01:00
|
|
|
|
2021-02-27 12:25:55 +01:00
|
|
|
### IMPLICIT BUILD RULES
|
|
|
|
## C++ objects
|
|
|
|
$(OBJ_DIR)/%.o: $(TST_DIR)/%.cpp $(INC_DIR)/* | $(OBJ_DIR)
|
|
|
|
$(CXX) $(CXXFLAGS) $(ARCH) $(INCLUDE) -c -o $@ $<
|
2021-02-12 12:04:21 +01:00
|
|
|
|
2021-02-27 12:25:55 +01:00
|
|
|
## HDF5/C++ objects
|
|
|
|
$(OBJ_DIR)/%_h5.o: $(TST_DIR)/%_h5.cpp $(INC_DIR)/* | $(OBJ_DIR)
|
|
|
|
$(H5CXX) $(H5CXXFLAGS) $(INCLUDE) -c -o $@ $<
|
2021-02-16 10:49:15 +01:00
|
|
|
|
2021-02-27 12:25:55 +01:00
|
|
|
## Fortran modules
|
|
|
|
$(OBJ_DIR)/%_mod.o: $(SRC_DIR)/%_mod.f90 | $(OBJ_DIR)
|
2021-03-01 16:08:14 +01:00
|
|
|
$(FC) $(FFLAGS) $(ARCH) -J$(OBJ_DIR)/ -c -o $@ $<
|
2021-02-22 10:51:07 +01:00
|
|
|
|
2021-02-27 12:25:55 +01:00
|
|
|
## Fortran objects
|
|
|
|
$(OBJ_DIR)/%.o: $(TST_DIR)/%.f90 | $(OBJ_DIR)
|
|
|
|
$(FC) $(FFLAGS) $(ARCH) -I $(OBJ_DIR)/ -c -o $@ $<
|
2021-02-26 17:28:52 +01:00
|
|
|
|
2021-02-27 12:25:55 +01:00
|
|
|
### EXPLICIT BUILD RULES
|
|
|
|
## special compiler flag -fPIC otherwise h5c++ builds fail
|
|
|
|
$(OBJ_DIR)/SM_MaponiA3.o: $(SRC_DIR)/SM_MaponiA3.cpp $(INC_DIR)/* | $(OBJ_DIR)
|
|
|
|
$(CXX) $(CXXFLAGS) -fPIC $(ARCH) $(INCLUDE) -c -o $@ $<
|
|
|
|
|
2021-03-05 17:00:48 +01:00
|
|
|
$(OBJ_DIR)/SM_Standard.o: $(SRC_DIR)/SM_Standard.cpp $(INC_DIR)/* | $(OBJ_DIR)
|
|
|
|
$(CXX) $(CXXFLAGS) -fPIC $(ARCH) $(INCLUDE) -c -o $@ $<
|
2021-02-27 12:25:55 +01:00
|
|
|
|
|
|
|
|
|
|
|
#### LINKING
|
|
|
|
$(BIN_DIR)/cMaponiA3_test_3x3_3: $(OBJ_DIR)/cMaponiA3_test_3x3_3.o $(DEPS_CXX) | $(BIN_DIR)
|
|
|
|
$(CXX) -o $@ $^
|
|
|
|
|
2021-02-28 09:28:42 +01:00
|
|
|
$(BIN_DIR)/test_internal_h5: $(OBJ_DIR)/test_internal_h5.o $(DEPS_CXX) | $(BIN_DIR)
|
|
|
|
$(H5CXX) -o $@ $^
|
|
|
|
$(BIN_DIR)/test_external_h5: $(OBJ_DIR)/test_external_h5.o $(DEPS_CXX) | $(BIN_DIR)
|
2021-02-27 12:25:55 +01:00
|
|
|
$(H5CXX) -o $@ $^
|
|
|
|
|
|
|
|
$(BIN_DIR)/fMaponiA3_test_3x3_3: $(DEPS_F) $(OBJ_DIR)/fMaponiA3_test_3x3_3.o | $(BIN_DIR)
|
|
|
|
$(FC) $(FLIBS) -o $@ $^
|
|
|
|
|
|
|
|
$(BIN_DIR)/fMaponiA3_test_4x4_2: $(DEPS_F) $(OBJ_DIR)/fMaponiA3_test_4x4_2.o | $(BIN_DIR)
|
|
|
|
$(FC) $(FLIBS) -o $@ $^
|
|
|
|
|
|
|
|
$(BIN_DIR)/QMCChem_dataset_test: $(DEPS_F) $(OBJ_DIR)/QMCChem_dataset_test.o | $(BIN_DIR)
|
|
|
|
$(FC) $(FLIBS) -o $@ $^
|