Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

集群用户的脚本 #42

Open
cndaqiang opened this issue Dec 4, 2020 · 6 comments
Open

集群用户的脚本 #42

cndaqiang opened this issue Dec 4, 2020 · 6 comments

Comments

@cndaqiang
Copy link
Owner

No description provided.

@cndaqiang
Copy link
Owner Author

删除管理员强加的intel编译器

delet=intel
VARS=( CP_INTEL_DIR PATH LD_LIBRARY_PATH LIBRARY_PATH  MANPATH INCLUDE FPATH CPATH INTEL_LICENSE_FILE MKLROOT TBBROOT MIC_LD_LIBRARY_PATH NLSPATH)
for VAR in ${VARS[@]}
do
    unset A
    for term in $(echo $(eval echo \$$VAR) | awk -F: '{for(i=1;i<=NF;i++){printf "%s ", $i}}')
    do 
        if [ $( echo $term | grep -v $delet ) ]
        then
            if [ ! $A ] 
            then
                A=$term
            else
                A=$A:$term
            fi
        fi
    done
    export $VAR=$A
done

@cndaqiang
Copy link
Owner Author

cndaqiang commented Dec 5, 2020

管理员把module弄的一团遭,自己找合适的库

还是自己重新安装省心!!!

NEED=( /opt/ohpc/pub/mpi/mvapich2-gnu8/2.3.2 /opt/ohpc/pub/compiler/gcc/8.3.0 )

for i in  ${NEED[@]}
do
echo -e "
export LD_LIBRARY_PATH=$i/lib:\$LD_LIBRARY_PATH
export LIBRARY_PATH=$i/lib:\$LIBRARY_PATH
export C_INCLUDE_PATH=$i/include:\$C_INCLUDE_PATH
export PATH=$i/bin:\$PATH"
#自动添加
export LD_LIBRARY_PATH=$i/lib:$LD_LIBRARY_PATH
export LIBRARY_PATH=$i/lib:$LIBRARY_PATH
export C_INCLUDE_PATH=$i/include:$C_INCLUDE_PATH 
export PATH=$i/bin:$PATH
#gcc 有 lib64
if [ -d $i/lib64 ] 
then
echo -e "
export LD_LIBRARY_PATH=$i/lib64:\$LD_LIBRARY_PATH
export LIBRARY_PATH=$i/lib64:\$LIBRARY_PATH"
export LD_LIBRARY_PATH=$i/lib64:$LD_LIBRARY_PATH
export LIBRARY_PATH=$i/lib64:$LIBRARY_PATH
fi
done

@cndaqiang
Copy link
Owner Author

cndaqiang commented Dec 6, 2020

发现在一个服务器编译的程序,在解决库以来的问题后是可以直接分发到其他的服务器上的

以后在sslab统一编译程序,使用git协议进行分发

不要在bashrc里面乱填动态库,以免找错

@cndaqiang
Copy link
Owner Author

cndaqiang commented Dec 6, 2020

怀柔最终编译环境

module unload openmpi3/3.1.4
module load gnu8/8.3.0
module load mvapich2/2.3.2 #Huairou gcc8只支持2.3.2
ROOT=$HOME/soft/gcc-8.3.0-mvapich

数学库

mkdir -p $ROOT/source
#编译scalapack
cd $ROOT/source
wget https://cndaqiang.gitee.io/packages//mirrors/math/scalapack_installer_CNQ_WO_Net.tar.gz
tar xzvf scalapack_installer_CNQ_WO_Net.tar.gz
cd scalapack_installer

cat << EOF > ./make.sh
#!/bin/bash
#SBATCH -J make
#SBATCH -p debug
#SBATCH -N 1
#SBATCH --ntasks-per-node=36
#SBATCH -o make.out


module unload openmpi3/3.1.4
module load gnu8/8.3.0
module load mvapich2/2.3.2 #Huairou gcc8只支持2.3.2
ROOT=$HOME/soft/gcc-8.3.0-mvapich

if [ -e ./netlib.py ]
then
    ./setup.py --prefix=$ROOT/math --downall
else
    make -j20
    make install
fi
EOF

qsub ../make.sh

编译QE

QE使用他本身的数学库就可以了,后期可以测试一下QE的数学库和netlib提供的新库的计算速度,以及加上scalapack后的速度
也许这些库是给特殊的计算用的,对pwscf没有加速

./configure
make pwall -j36 #多输入几次,qe6.6有几个编译不出来

可能是QE的问题了,因为本地和远程都报错,但是编译通过的程序都可以运行
image
对比intel完美编译的结果
image

SIESTA 不支持gcc-8暂时保持以前的gcc-4

../Src/obj_setup.sh
../Src/configure --enable-mpi FC=gfortran CC=gcc MPIFC=mpif90
echo "
MATHDIR=$ROOT/math
BLAS_LIBS=\$(MATHDIR)/librefblas.a
LAPACK_LIBS=\$(MATHDIR)/libreflapack.a \$(MATHDIR)/libtmg.a
BLACS_LIBS=
SCALAPACK_LIBS=\$(MATHDIR)/libscalapack.a
" >> arch.make
make -j30

SSLAB最终编译环境

module load compiler/gcc/gcc_8.3.0
module load mpi/mvapich2/gnu/2.3.1
ROOT=$HOME/soft/gcc-8.3.0-mvapich

使用tdpwpush推送程序到松山湖

(python37) [SSLAB chendq@login3 bin]$ldd tdpw.x  | grep found
	libgfortran.so.5 => not found
(python37) [SSLAB chendq@login3 bin]$module load compiler/gcc/gcc_8.3.0
(python37) [SSLAB chendq@login3 bin]$ldd tdpw.x  | grep found

@cndaqiang
Copy link
Owner Author

NEED=( $ROOT/fftw-3.3.3 $ROOT/math)
for i in ${NEED[@]}
do
echo -e "
export LD_LIBRARY_PATH=$i/lib:$LD_LIBRARY_PATH
export LIBRARY_PATH=$i/lib:$LIBRARY_PATH
export C_INCLUDE_PATH=$i/include:$C_INCLUDE_PATH
export PATH=$i/bin:$PATH"
#自动添加
export LD_LIBRARY_PATH=$i/lib:$LD_LIBRARY_PATH
export LIBRARY_PATH=$i/lib:$LIBRARY_PATH
export C_INCLUDE_PATH=$i/include:$C_INCLUDE_PATH
export PATH=$i/bin:$PATH
#gcc 有 lib64
if [ -d $i/lib64 ]
then
echo -e "
export LD_LIBRARY_PATH=$i/lib64:$LD_LIBRARY_PATH
export LIBRARY_PATH=$i/lib64:$LIBRARY_PATH"
export LD_LIBRARY_PATH=$i/lib64:$LD_LIBRARY_PATH
export LIBRARY_PATH=$i/lib64:$LIBRARY_PATH
fi
done

@cndaqiang
Copy link
Owner Author

编译QE的简单结论

  • Intel速度比gcc要快
  • 自己编译的lapack不比QE自带lapack快
  • 如果系统的lapack很老(ubuntu)反而会让QE很慢
  • 所以就用QE的lapack
  • 自己编译的fftw,在QE运行第一个scf就数值卡死了,用QE的fft吧
  • 只要依赖在,编译好的程序可以在本服务器以及其他服务器上调用,调用时的mpirun/srun可以与编译本程序的mpi不是同一个
    甚至是impi的环境可以srun gcc&mvapich编译的程序
  • 在不冲突的情况下, mpi编译器和动态库也不必须由相同串行编译器编译得到

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant