abinit-9.6.2应用移植指南
收藏回复举报
abinit-9.6.2应用移植指南
新人帖
发表于2023-11-15 10:37:03
0 查看

安装如下依赖:

GCC编译器

10.3.1

https://mirrors.huaweicloud.com/kunpeng/archive/compiler/kunpeng_gcc/gcc-10.3.1-2022.11-aarch64-linux.tar.gz

OPENMPI

4.1.2

https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.2.tar.gz

ABINT

9.6.2

https://www.abinit.org/sites/default/files/packages/abinit-9.6.2.tar.gz

LIBXC

4.3.4

http://www.tddft.org/programs/libxc/down.php?file=4.3.4/libxc-4.3.4.tar.gz

FFTW

3.3.10

http://www.fftw.org/fftw-3.3.10.tar.gz

OPENBLAS

0.3.21

https://github.com/xianyi/OpenBLAS/archive/refs/tags/v0.3.21.tar.gz

SCALAPACK

2.2.0

https://github.com/Reference-ScaLAPACK/scalapack/archive/refs/tags/v2.2.0.tar.gz

HDF5

1.12.1

https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.1/src/hdf5-1.12.1.tar.gz

PNETCDF

1.12.3

https://parallel-netcdf.github.io/Release/pnetcdf-1.12.3.tar.gz

NETCDF-C

4.9.0

https://downloads.unidata.ucar.edu/netcdf-c/4.9.0/netcdf-c-4.9.0.tar.gz

NETCDF-FORTRAN

4.6.0

https://downloads.unidata.ucar.edu/netcdf-fortran/4.6.0/netcdf-fortran-4.6.0.tar.gz

测试算例

9.6.2

abinit-9.6.2/tests/hpc/Input/t01.in

安装libxc 

tar -xvf libxc-4.3.4.tar.gz && cd libxc-4.3.4

./configure CC=gcc FC="gfortran -fallow-argument-mismatch" --prefix=/usr/local/libxc --enable-shared=yes --enable-static=yes

make -j$(nproc) && make install

cat > "/usr/local/libxc/libxc_modulefiles" <<EOF

#%Module1.0

conflict libxc

variable modfile [file normalize [info script]]

proc getModulefileDir {} {

    variable modfile

    set modfile_path [file dirname \$modfile]

    return \$modfile_path

}

set pwd [getModulefileDir]

set LIBXC \$pwd

setenv LIBXC \$LIBXC

prepend-path PATH                \$LIBXC/bin

prepend-path LD_LIBRARY_PATH \$LIBXC/lib

prepend-path INCLUDE            \$LIBXC/include

EOF

module use /usr/local

module load libxc/libxc_modulefiles

vi /etc/profile

新增如下内容:

module use /usr/local

module load libxc/libxc_modulefiles

安装OpenBLAS

tar -xvf OpenBLAS-0.3.21.tgz && cd OpenBLAS-0.3.21  

CC=gcc CXX=g++ FC= "gfortran -fallow-argument-mismatch" make  

make PREFIX=/usr/local/openblas  

cat > "/usr/local/openblas/openblas_modulefiles" <<EOF  

#%Module1.0  

conflict openblas  

variable modfile [file normalize [info script]]  

proc getModulefileDir {} {  

    variable modfile  

    set modfile_path [file dirname \$modfile]  

    return \$modfile_path  

}  

set openblas [getModulefileDir]  

setenv OPENBLAS \$openblas  

prepend-path LD_LIBRARY_PATH \$openblas/lib  

prepend-path INCLUDE \$openblas/include  

EOF  

module use /usr/local  

module load openblas/openblas_modulefiles  

  

vi /etc/profile  

#新增如下内容:  

module use /usr/local  

module load openblas/openblas_modulefiles  

安装fftw 

tar -xvf fftw-3.3.10.tar.gz && cd fftw-3.3.10  

#进行single版本编译配置。  

./configure CC=gcc MPICC=mpicc F77="gfortran -fallow-argument-mismatch" --prefix=/usr/local/fftw --enable-mpi --enable-openmp --enable-threads --enable-shared=yes --enable-static=yes --enable-neon --enable-armv8-pmccntr-el0 --enable-armv8-cntvct-el0  

make -j$(nproc) && make install  

#进行float版本的编译配置  

./configure CC=gcc MPICC=mpicc F77="gfortran -fallow-argument-mismatch" --prefix=/usr/local/fftw –enable-float --enable-mpi --enable-openmp --enable-threads --enable-shared=yes --enable-static=yes --enable-neon --enable-armv8-pmccntr-el0 --enable-armv8-cntvct-el0  

make -j$(nproc) && make install  

cat > "/usr/local/fftw/fftw_modulefiles" <<EOF  

#%Module1.0  

conflict fftw  

variable modfile [file normalize [info script]]  

proc getModulefileDir {} {  

    variable modfile  

    set modfile_path [file dirname \$modfile]  

    return \$modfile_path  

}  

set pwd [getModulefileDir]  

set FFTW \$pwd  

setenv FFTW \$FFTW  

prepend-path PATH                \$FFTW/bin  

prepend-path LD_LIBRARY_PATH \$FFTW/lib  

prepend-path INCLUDE            \$FFTW/include  

EOF  

module use /usr/local  

module load fftw/fftw_modulefiles  

vi /etc/profile  

#新增如下内容:  

module use /usr/local  

module load fftw/fftw_modulefiles  

----结束 

安装scalapack  

tar -xvf scalapack-2.2.0.tar.gz  && cd scalapack-2.2.0  

cp SLmake.inc.example SLmake.inc  

sed -i -e "s+-lblas+-L/usr/local/openblas/lib -lopenblas+g" -e 's+-llapack++g' -e 's+mpif90+mpif90 -fallow-argument-mismatch+g' SLmake.inc  

make -p /usr/local/scalapack/lib  

cp libscalapack.a /usr/local/scalapack/lib/  

cat > "/usr/local/scalapack/ scalapack_modulefiles"<<EOF  

#%Module1.0  

conflict scalapack  

variable modfile [file normalize [info script]]  

proc getModulefileDir {} {  

    variable modfile  

    set modfile_path [file dirname \$modfile]  

    return \$modfile_path  

}  

set scalapack [getModulefileDir]  

setenv SCALAPACK \$SCALAPACK  

prepend-path LD_LIBRARY_PATH \$scalapack/lib  

EOF  

module use /usr/local  

module load scalapack/scalapack_modulefiles  

vi /etc/profile  

#新增如下内容:  

module use /usr/local  

module load scalapack/scalapack_modulefiles  

安装hdf5  

tar -xvf hdf5-1.12.1.tar.gz && cd hdf5-1.12.1  

./configure CC=mpicc CXX=mpicxx FC="mpifort -fallow-argument-mismatch" --prefix=/usr/local/hdf5 --enable-shared=yes --enable-static=yes --enable-parallel --enable-hl  

make -j$(nproc) && make install  

cat > "/usr/local/hdf5/hdf5_modulefiles" <<EOF  

#%Module1.0  

conflict hdf5  

variable modfile [file normalize [info script]]  

proc getModulefileDir {} {  

    variable modfile  

    set modfile_path [file dirname \$modfile]  

    return \$modfile_path  

}  

set hdf5 [getModulefileDir]  

setenv HDF5 \$hdf5  

prepend-path PATH                \$hdf5/bin  

prepend-path LD_LIBRARY_PATH \$hdf5/lib  

prepend-path INCLUDE            \$hdf5/include  

EOF  

module use /usr/local  

module load hdf5/hdf5_modulefiles  

vi /etc/profile  

#新增如下内容:  

module use /usr/local  

module load hdf5/hdf5_modulefiles  

安装pnetcdf  

tar -xvf pentcdf-1.12.3.tar.gz && cd pnetcdf-1.12.3  

./configure CC=gcc CXX=g++ F77="gfortran -fallow-argument-mismatch" FC="gfortran -fallow-argument-mismatch" MPICC=mpicc MPICXX=mpicxx MPIF77="mpifort -fallow-argument-mismatch" MPIF90="mpifort -fallow-argument-mismatch" --prefix=/usr/local/pnetcdf --enable-shared=yes --enable-static=yes --enable-largefile  

make -j$(nproc) && make install  

cat > "/usr/local/pnetcdf/pnetcdf_modulefiles"<<EOF  

#%Module1.0  

conflict pnetcdf  

variable modfile [file normalize [info script]]  

proc getModulefileDir {} {  

    variable modfile  

    set modfile_path [file dirname \$modfile]  

    return \$modfile_path  

}  

set pnetcdf [getModulefileDir]  

setenv PNETCDF \$pnetcdf  

prepend-path PATH                \$pentcdf/bin  

prepend-path LD_LIBRARY_PATH \$pnetcdf/lib  

prepend-path INCLUDE            \$pnetcdf/include  

EOF  

module use /usr/local  

module load pnetcdf/pnetcdf_modulefiles  

vi /etc/profile  

#新增如下内容:  

module use /usr/local  

module load pnetcdf/pnetcdf_modulefiles  

安装netcdf-c  

tar -xvf netcdf-c-4.9.0.tar.gz && cd netcdf-c-4.9.0  

./configure CC=mpicc CXX=mpicxx --prefix=/usr/local/netcdf-c --enable-shared=yes --enable-static=yes --enable-largefile --enable-hdf5=yes --enable-pnetcdf LDFLAGS="-L/usr/local/hdf5/lib –L/usr/local/pnetcdf/lib" CPPFLAGS="-I/usr/local/hdf5/include –I/usr/local/pnetcdf/include"  

make -j$(nproc) && make install  

cat >"/usr/local/netcdf-c/netcdf-c_modulefiles"<<EOF  

#%Module1.0  

conflict hdf5  

variable modfile [file normalize [info script]]  

proc getModulefileDir {} {  

    variable modfile  

    set modfile_path [file dirname \$modfile]  

    return \$modfile_path  

}  

set netcdf [getModulefileDir]  

setenv NETCDF \$netcdf  

prepend-path PATH                \$netcdf/bin  

prepend-path LD_LIBRARY_PATH \$netcdf/lib  

prepend-path INCLUDE            \$netcdf/include  

EOF  

module use /usr/local  

module load netcdf-c/netcdf-c_modulefiles  

vi /etc/profile  

#新增如下内容:  

module use /usr/local  

module load netcdf-c/netcdf-c_modulefiles  

安装netcdf-fortran  

tar -xvf netcdf-fortran-4.6.0.tar.gz && cd netcdf-fortran-4.6.0  

./configure CC=mpicc FC="mpifort -fallow-argument-mismatch" --prefix=/usr/local/netcdf-fortran --enable-shared=yes --enable-static=yes --enable-largefile LDFLAGS="-L/usr/local/hdf5/lib -L/usr/local/pnetcdf/lib -L/usr/local/netcdf-c/lib" CPPFLAGS="-I/usr/local/hdf5/include -I/usr/local/pnetcdf/include -I/usr/local/netcdf-c/include"  

make -j$(nproc) && make install  

cat >"/usr/local/netcdf-fortran/netcdf-fortran_modulefiles"<<EOF  

#%Module1.0  

conflict netcdf-fortran  

variable modfile [file normalize [info script]]  

proc getModulefileDir {} {  

    variable modfile  

    set modfile_path [file dirname \$modfile]  

    return \$modfile_path  

}  

set netcdff [getModulefileDir]  

setenv NETCDFF \$netcdff  

prepend-path PATH                \$netcdff /bin  

prepend-path LD_LIBRARY_PATH \$netcdff /lib  

prepend-path INCLUDE            \$netcdff /include  

EOF  

module use /usr/local  

module load netcdff-fortran/netcdff-fortran_modulefiles  

vi /etc/profile  

#新增如下内容:  

module use /usr/local  

module load netcdff-fortran/netcdff-fortran_modulefiles  

编译安装Abinit

wget https://www.abinit.org/sites/default/files/packages/abinit-9.6.2.tar.gz

mkdir -p /usr/local/abinit

tar xf abinit-9.6.2.tar.gz && cd abinit-9.6.2

./configure CC=mpicc CXX=mpicxx FC="mpifort -fallow-argument-mismatch" --prefix=/usr/local/abinit --enable-openmp=yes --with-mpi=yes --enable-mpi-io=yes --with-linalg-flavor=openblas LINALG_LIBS="-L/usr/local/openblas/lib -lopenblas -L/usr/local/scalapack/lib -lscalapack" --with-fft-flavor=fftw3 FFTW3_LDFLAGS="-L/usr/local/fftw/lib" FFTW3_CPPFLAGS="-I/usr/local/fftw/include" FFTW3_LIBS=" -lfftw3 -lfftw3_omp -lfftw3_mpi -lfftw3_threads -lfftw3f -lfftw3f_omp -lfftw3f_mpi -lfftw3f_threads" --with-hdf5=/usr/local/hdf5 --with-netcdf=/usr/local/netcdf-c --with-netcdf-fortran=/usr/local/netcdf-fortran --with-libxc=/usr/local/libxc --enable-netcdf-default=no

#注:各依赖包指定以实际路径为准

make -j$(nproc) && make install

cat > "/usr/local/abinit/abinit_modulefiles"<<EOF

#%Module1.0

conflict abinit

variable modfile [file normalize [info script]]

proc getModulefileDir {} {

    variable modfile

    set modfile_path [file dirname \$modfile]

    return \$modfile_path

}

set abinit [getModulefileDir]

prepend-path PATH \$abinit/bin

prepend-path LD_LIBRARY_PATH \$abinit/lib

EOF

module use /usr/local

module load abinit/abinit_modulefiles

vi /etc/profile

#新增如下内容:

module use /usr/local

module load abinit/abinit_modulefiles

module use /usr/local

module load gcc-10.3.1-2022.11-aarch64-linux/gcc_modulefiles

module load openmpi-4.1.2/openmpi_modulefiles

module load libxc/libxc_modulefiles

module load fftw/fftw_modulefiles

module load openblas/openblas_modulefiles

module load hdf5/hdf5_modulefiles

module load netcdf-c/netcdf-c_modulefiles

module load netcdf-fortran/netcdf-fortran_modulefiles

module load abinit/abinit_modulefiles

#创建计算模型。

cd abnint-9.6.2/tests/hpc/

cp Input/t01.in ./

cp ../Psps_for_tests/au.hpc.paw ./

#修改t01.in文件中的进程数

touch hpc_x.files。

cat > "hpc_x.files " <<EOF

./t01.in

t01_au.out

t01_au.i

t01_au.o

t01_au

./au.hpc.paw

EOF

#运行测试

mpirun --allow-run-as-root -np 32 -x OMP_NUM_THREADS=1 abinit < hpc_x.files

本帖最后由 匿名用户2023/11/16 11:50:06 编辑

我要发帖子