-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from xuqimen/patch
add makefile for IBM machines; modify scalapack.h; abs type issues
- Loading branch information
Showing
9 changed files
with
145 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
MACHINE = IBM | ||
# Options for MACHOPT: sequential, scalapack, scalapack_essl | ||
MACHOPT = scalapack | ||
# Choose whether to use MKL or ScaLAPACK or neither | ||
# Warning: don't turn on USE_MKL and USE_SCALAPACK simultaneously | ||
# Set USE_MKL = 1 to compile with MKL BLAS, LAPACK, and ScaLAPACK | ||
# Set USE_MKL = 0 otherwise | ||
USE_MKL = 0 | ||
# Set USE_SCALAPACK = 1 to compile with non-MKL BLAS, LAPACK, and ScaLAPACK | ||
# Set USE_SCALAPACK = 0 to compile with non-MKL BLAS and LAPACK only | ||
USE_SCALAPACK = 0 | ||
USE_SCALAPACK_ESSL = 0 | ||
ifeq ($(MACHINE),IBM) | ||
ifeq ($(MACHOPT),scalapack) | ||
USE_SCALAPACK = 1 | ||
else ifeq ($(MACHOPT),scalapack_essl) | ||
USE_SCALAPACK_ESSL = 1 | ||
endif # $(MACHOPT) | ||
endif # $(MACHINE) | ||
|
||
# Set USE_DP_SUBEIG = 1 to use SPARC rather than ScaLAPACK routines for matrix data distribution | ||
# (Required if not using ScaLAPACK) | ||
# Set USE_DP_SUBEIG = 0 to use ScaLAPACK rather than SPARC routines | ||
USE_DP_SUBEIG = 0 | ||
# Set DEBUG_MODE = 1 to run with debug mode and print debug output | ||
DEBUG_MODE = 0 | ||
|
||
# Specify the path MKLROOT if it's not already set to compile with MKL, e.g, | ||
# MKLROOT = /opt/intel/compilers_and_libraries_2017.4.196/linux/mkl | ||
#MKLROOT = /usr/tce/packages/mkl/mkl-2020.0/compilers_and_libraries/linux/mkl | ||
|
||
# Specify the path to ScaLAPACK, LAPACK and BLAS if necessary, and | ||
# add to LDFLAGS. Note that sometimes LDFLAGS already contains the default | ||
# path to these libraries, or the libraries are located in the default search | ||
# path. In those cases, the following is not needed. | ||
# SCALAPACKROOT = /nv/hp27/qxu78/data/scalapack-2.0.2 | ||
SCALAPACKROOT = /usr/tcetmp/packages/lapack/lapack-3.8.0-xl-2019.08.20 | ||
ESSLLIBROOT = ${ESSLLIBDIR64} | ||
ESSLINCROOT = ${ESSLHEADERDIR} | ||
# LDFLAGS += -L$(SCALAPACKROOT) | ||
# LAPACKROOT = /usr/local/pacerepov1/lapack/3.6.0 | ||
# LDFLAGS += -L$(LAPACKROOT) | ||
# BLASROOT = /usr/lib64 | ||
# LDFLAGS += -L$(BLASROOT) | ||
|
||
CPPFLAGS = -Iinclude/ | ||
LDLIBS = -lrt | ||
|
||
ifeq ($(USE_MKL), 1) | ||
#CPPFLAGS += -m64 -I${MKLROOT}/include -DUSE_MKL | ||
CPPFLAGS += -I${MKLROOT}/include -DUSE_MKL | ||
LDFLAGS = -L${MKLROOT}/lib/intel64 | ||
#LDLIBS += -Wl,--no-as-needed -lmkl_scalapack_lp64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lmkl_blacs_intelmpi_lp64 -lpthread -lm -ldl | ||
LDLIBS += -Wl,-rpath=${MKLROOT}/lib/intel64 -lmkl_scalapack_lp64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lmkl_blacs_intelmpi_lp64 -lpthread -lm -ldl | ||
else ifeq ($(USE_SCALAPACK), 1) | ||
CPPFLAGS += -I${SCALAPACKROOT}/include -DUSE_SCALAPACK -DIBM | ||
LDFLAGS = -L${SCALAPACKROOT}/lib -L${LAPACK_DIR} | ||
LDLIBS += -L${LAPACK_DIR} -lcblas -llapacke -llapack -lscalapack | ||
else ifeq ($(USE_SCALAPACK_ESSL), 1) | ||
CPPFLAGS += -I${SCALAPACKROOT}/include -DUSE_SCALAPACK -DUSE_ESSL -DIBM | ||
LDLIBS += -L${ESSLLIBDIR64} -L${LAPACK_DIR} -lessl -llapackforessl -lscalapack | ||
else | ||
CPPFLAGS += -I${SCALAPACKROOT}/include | ||
LDFLAGS = -L${LAPACK_DIR} -lcblas -llapacke -llapack | ||
endif | ||
|
||
# if MKL is not used, link BLAS and LAPACK directly | ||
ifeq ($(USE_MKL), 0) | ||
# if you are using BLAS instead of OpenBLAS, change -lopenblas to -lblas | ||
# and move it to after -llapack | ||
#LDLIBS += -lopenblas -llapacke -llapack -lm | ||
LDLIBS += -llapacke -lm | ||
endif | ||
|
||
# To use domain parallelization + LAPACK for solving sobspace eigen problem | ||
ifeq ($(USE_DP_SUBEIG), 1) | ||
CPPFLAGS += -DUSE_DP_SUBEIG | ||
endif | ||
|
||
# to compile with DEBUG mode | ||
ifeq ($(DEBUG_MODE), 1) | ||
CPPFLAGS += -Wall -g -DDEBUG | ||
endif | ||
|
||
# for old Intel compiler, use -qopenmp instead of -fopenmp. ICC 17 and later also accepts -fopenmp. | ||
#CFLAGS = -std=gnu99 -O3 -fopenmp | ||
#CFLAGS = -std=gnu99 -O3 -fopenmp | ||
CFLAGS = -std=gnu99 -fopenmp | ||
|
||
OBJSC = main.o initialization.o readfiles.o atomdata.o parallelization.o relax.o tools.o md.o \ | ||
electrostatics.o electronicGroundState.o electronDensity.o orbitalElecDensInit.o \ | ||
occupation.o lapVecRoutines.o gradVecRoutines.o gradVecRoutinesKpt.o nlocVecRoutines.o \ | ||
hamiltonianVecRoutines.o lapVecOrth.o lapVecOrthKpt.o lapVecNonOrth.o lapVecNonOrthKpt.o \ | ||
linearSolver.o mixing.o exchangeCorrelation.o eigenSolver.o eigenSolverKpt.o energy.o \ | ||
forces.o stress.o pressure.o finalization.o | ||
|
||
LIBBASE = ../lib/sparc-${MACHINE}-${MACHOPT} | ||
TESTBASE = ../.ci | ||
|
||
override CC=mpicc | ||
|
||
all: sparc | ||
|
||
# Note the implicit rule to compile '.c' files into '.o' files is | ||
# %.o : %.c | ||
# $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ | ||
|
||
sparc: $(OBJSC) | ||
$(CC) $(CFLAGS) $(LDFLAGS) -o $(LIBBASE) $^ $(LDLIBS) | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -f $(OBJSC) $(LIBBASE) | ||
test: ../.ci/run_tests.py | ||
cd $(TESTBASE); ./run_tests.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters