Slurm for Octopus
1#!/bin/bash
2#SBATCH -J octopus-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
13OUTPUTNAME=screen
14
15echo Time is `date`
16echo Working dir is $SLURM_SUBMIT_DIR #$SLURM_SUBMIT_DIR:作业提交目录
17cd $SLURM_SUBMIT_DIR
18
19NPROCS=$((SLURM_NTASKS)) #$SLURM_NTASKS:总任务数
20N_NODE=$((SLURM_JOB_NUM_NODES)) #$SLURM_JOB_NUM_NODES:节点数
21
22echo This job has allocated ${N_NODE} nodes with ${NPROCS} processors
23echo Running on host `hostname`
24echo This jobs runs on the following processors:
25echo "**Start"
26
27echo $SLURM_SUBMIT_DIR > work.txt
28echo $SLURM_NODELIST > nodefile.txt #$SLURM_NODELIST:节点列表
29echo $NPROCS > cpucore.txt
30echo $N_NODE > node.txt
31
32source ~/run_software_bashrc/before_run_octopus12.2.sh
33
34mpiexec -np ${NPROCS} octopus > ${OUTPUTNAME}.out
35
36echo "**Finished!"