#!/bin/bash #SBATCH -J _JOBNAME_ #SBATCH -t _TIMELIMIT_:00:00 #SBATCH -n _NCORES_ #SBATCH --tasks-per-node=24 #SBATCH -e Job.err module load fortran/intel module load mkl module load mpi/impi ulimit -s unlimited WorkDir=` pwd ` # Submission Dir is the working dir ScratchDir=${TMPDIR} # Temporary dir is set (already with JobID) VASP="/home/miglio/VASP_5.3.5/vasp.5.3.5/vasp-SRP032" cd ${ScratchDir} scp -r ${WorkDir}/* . ######################################### # Velocity adjusting preparatory step # ######################################### cp INCAR_ INCAR sed -i "s/_nsw_/NSW = 1/" INCAR # execute vasp srun ${VASP} >> vasp.out # move files of interest mv POSCAR POSCAR_0 mv OSZICAR OSZICAR_0 mv XDATCAR XDATCAR_0 grep -A 51 "TOTAL-FORCE" OUTCAR > Forces_0.dat # get timing grep Elapsed OUTCAR >> time.dat rm OUTCAR vasp* E* D* IB* PC* W* CON* CHG python - <& /dev/null & # determine pid of checker checkerpid=$! # execute vasp srun ${VASP} >> vasp.out # kill checker kill ${checkerpid} #execute one more in order to see whether a restart is needed ./check-CHD3.py #check for the restarts number check=0 while [ -e "XDATCAR_${check}" ] do let check++ done # get timing grep Elapsed OUTCAR >> time.dat # update important outputs mv POSCAR POSCAR_${check} mv OSZICAR OSZICAR_${check} mv XDATCAR XDATCAR_${check} mv CONTCAR CONTCAR_${check} grep -A 51 "TOTAL-FORCE" OUTCAR > Forces_${check}.dat rm D* E* IB* PC* W* vasprun* OUTCAR vdw* # Copy files back scp -r ${ScratchDir}/* ${WorkDir}/. # clean up rm -r ${ScratchDir}