VASP下的GPU並行編譯安裝

安裝CUDA

CUDA版本11.0及以上
略。。。

安裝Intel編譯器

##Intel編譯器選擇2021版免費的oneAPI,Base基礎包+HPC包
sudo bash l_BaseKit_p_2021.2.0.2883_offline.sh
sudo bash l_HPCKit_p_2021.2.0.2997_offline.sh

##添加環境變量
編輯.bashrc或/etc/profile添加
source /opt/intel/oneapi/setvars.sh intel64

##編譯fftw
cd /opt/intel/oneapi/mkl/2021.2.0/interfaces/fftw3xf/
make libintel64			#無權限可將/opt/intel/oneapi修改user屬主屬組

安裝VASP

tar xvf vasp.6.1.0.tar.gz
cd vasp.6.1.0
cp arch/makefile.include.linux_intel makefile.include
修改文件makefile.include
make all

測試VASP

unzip test.zip
cd test 
mpirun  -np 30  vasp_std
mpirun  -np 30  vasp_gpu

makefile.include配置文件內容如下

#Precompiler options
CPP_OPTIONS= -DHOST=\"LinuxIFC\"\
			 -DMPI -DMPI_BLOCK=8000 -Duse_collective \
			 -DscaLAPACK \
			 -DCACHE_SIZE=4000 \
			 -Davoidalloc \
			 -Dvasp6 \
			 -Duse_bse_te \
			 -Dtbdyn \
			 -Dfock_dblbuf

CPP        = fpp -f_com=no -free -w0  $*$(FUFFIX) $*$(SUFFIX) $(CPP_OPTIONS)

FC         = mpiifort
FCL        = mpiifort -mkl=sequential

FREE       = -free -names lowercase

FFLAGS     = -assume byterecl -w -xHOST
OFLAG      = -O2
OFLAG_IN   = $(OFLAG)
DEBUG      = -O0

MKLROOT    = /opt/intel/oneapi/mkl/2021.2.0
MKL_PATH   = $(MKLROOT)/lib/intel64
BLAS       = -L$(MKL_PATH) -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread
LAPACK     = -L$(MKL_PATH) -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread
BLACS      = -lmkl_blacs_intelmpi_lp64
SCALAPACK  = $(MKL_PATH)/libmkl_scalapack_lp64.a $(BLACS)

OBJECTS    = fftmpiw.o fftmpi_map.o fft3dlib.o fftw3d.o \
			 $(MKLROOT)/interfaces/fftw3xf/libfftw3xf_intel.a

INCS       =-I$(MKLROOT)/include/fftw

LLIBS      = $(SCALAPACK) $(LAPACK) $(BLAS)


OBJECTS_O1 += fftw3d.o fftmpi.o fftmpiw.o
OBJECTS_O2 += fft3dlib.o

#For what used to be vasp.5.lib
CPP_LIB    = $(CPP)
FC_LIB     = $(FC)
CC_LIB     = icc
CFLAGS_LIB = -O
FFLAGS_LIB = -O1
FREE_LIB   = $(FREE)

OBJECTS_LIB= linpack_double.o getshmem.o

#For the parser library
CXX_PARS   = icpc
LLIBS      += -lstdc++

#Normally no need to change this
SRCDIR     = ../../src
BINDIR     = ../../bin

#================================================
#GPU Stuff

CPP_GPU    = -DCUDA_GPU -DRPROMU_CPROJ_OVERLAP -DUSE_PINNED_MEMORY -DCUFFT_MIN=28 -UscaLAPACK -Ufock_dblbuf

OBJECTS_GPU= fftmpiw.o fftmpi_map.o fft3dlib.o fftw3d_gpu.o fftmpiw_gpu.o

CC         = icc
CXX        = icpc
CFLAGS     = -fPIC -DADD_ -Wall -qopenmp -DMAGMA_WITH_MKL -DMAGMA_SETAFFINITY -DGPUSHMEM=300 -DHAVE_CUBLAS

CUDA_ROOT  ?= /usr/local/cuda/
NVCC       := $(CUDA_ROOT)/bin/nvcc -ccbin=icc -allow-unsupported-compiler
CUDA_LIB   := -L$(CUDA_ROOT)/lib64 -lnvToolsExt -lcudart -lcuda -lcufft -lcublas

GENCODE_ARCH    := -gencode=arch=compute_60,code=\"sm_60,compute_60\" \
				   -gencode=arch=compute_70,code=\"sm_70,compute_70\" \
				   -gencode=arch=compute_72,code=\"sm_72,compute_72\" \
				   -gencode=arch=compute_80,code=\"sm_80,compute_80\"
I_MPI_ROOT = /opt/intel/oneapi/mpi/2021.2.0
MPI_INC    = $(I_MPI_ROOT)/include/
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章