Slurm for VASP
1#!/bin/bash
2#SBATCH -J vasp-opt
3#SBATCH -o %J.out
4#SBATCH -e %J.err
5#SBATCH -N 1
6#SBATCH -w node01
7#SBATCH -n 36
8#SBATCH -t 999:0:0
9#SBATCH -p hpc
10
11export OMP_NUM_THREADS=1
12
13echo Time is `date`
14echo Working dir is $SLURM_SUBMIT_DIR #$SLURM_SUBMIT_DIR:作业提交目录
15cd $SLURM_SUBMIT_DIR
16
17NPROCS=$((SLURM_NTASKS)) #$SLURM_NTASKS:总任务数
18N_NODE=$((SLURM_JOB_NUM_NODES)) #$SLURM_JOB_NUM_NODES:节点数
19
20echo This job has allocated ${N_NODE} nodes with ${NPROCS} processors
21echo Running on host `hostname`
22echo This jobs runs on the following processors:
23echo "**Start"
24
25echo $SLURM_SUBMIT_DIR > work.txt
26echo $SLURM_NODELIST > nodefile.txt #$SLURM_NODELIST:节点列表
27echo $NPROCS > cpucore.txt
28echo $N_NODE > node.txt
29
30source ~/run_software_bashrc/before_run_vasp_and_tools.sh
31
32mpirun -n $NPROCS /opt/apps/vasp/vasp.6.1.0/bin/vasp_std >& screen.log
33
34echo "**Finished!"