|
#!/bin/bash
#========================================#
# PBS Job submission script for VASP
#========================================#
# 1. PBS job control
#PBS -S /bin/bash
#PBS -N vasp5.2
#PBS -j oe
#PBS -q Acb65
#PBS -l nodes=1:ppn=12
##PBS -l walltime=00:30:00
#PBS -V
#========================================#
# 2. Job specification
cd ${PBS_O_WORKDIR}
inputfile="INCAR"
#========================================#
# 3. Integrity check
export LANG=C
source /public/software/profile.d/intel-env.sh
source /public/software/profile.d/impi-env.sh
export I_MPI_DEVICE=rdssm
export I_MPI_PIN=off
echo
echo "Starting VASP run at" `date`
echo
master=`hostname`
echo "The job submission node is $master"
echo "The working directory is " ${PBS_O_WORKDIR}
echo "VASP input file is" ${PBS_O_WORKDIR}/${inputfile}
#========================================#
# 4. Parallel execution
# make sure to use serial math lib
export MKL_SERIAL=YES
export MKL_NUM_THREADS=1
export OMP_NUM_THREADS=1
export GOTO_NUM_THREADS=1
echo
echo "VASP execution start at" `date`
echo
## Show system info
hostname > host.info
grep 'Linux' /etc/issue >> host.info
grep 'model name' /proc/cpuinfo |cut -d: -f2 |uniq -c >> host.info
grep 'cpu M' /proc/cpuinfo >> host.info
grep 'MemTotal' /proc/meminfo >> host.info
free -g >> host.info
ulimit -a >> host.info
cat $PBS_NODEFILE >> host.info
if [ -z "`grep AuthenticAMD /proc/cpuinfo`" ];then
export vasp_exe=/public/software/vasp/vasp5.2.12-impi-em64t-sca
else
export vasp_exe=/public/software/vasp/vasp5.2.12-impi-amd64-sca
fi
echo The VASP version is ${vasp_exe} >> host.info
PROCS=`cat $PBS_NODEFILE | wc -l`
qstat -n $PBS_JOBID|awk -F+ '(NR>6) {for(i=1;i<=NF;i++) print $i}'|awk '(NF>0) {print $1}'|awk -F'/' '{printf("-n 1 -host %s numactl --localalloc --physcpubind %d %s\n",$1,$2,ENVIRON["vasp_exe"])}' > impi.${PBS_JOBID}
for NP in $PROCS;
do
## for Intel MPI ##
mpirun -r ssh -configfile impi.${PBS_JOBID} >& $NP.log
mv OUTCAR $NP.OUTCAR
# ## delete useless file ##
# rm -f CHG
# rm -f CHGCAR
# rm -f CONTCAR
# rm -f DOSCAR
# rm -f EIGENVAL
# rm -f OSZICAR
# rm -f PCDAT
# rm -f vasprun.xml
# rm -f WAVECAR
# rm -f XDATCAR
done
|
|