-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsubmit_current
More file actions
67 lines (56 loc) · 1.43 KB
/
Copy pathsubmit_current
File metadata and controls
67 lines (56 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
if [ $# -ne 3 ] && [ $# -ne 4 ]; then
echo " This script has to be called in the following form:"
echo ""
echo " current_submit queue cores mem"
echo "Optionally a fourth argument can be the name of the job"
exit
fi
QUEUE=$1
CORES=$2
MEM=$3
NAME=$4
if [ -z "$NAME" ]; then
NAME="current_calc"
echo "Job name has been set to default: $NAME"
fi
SUBMIT=qsub.tmp
PWD=`pwd`
# Checks if there is already data present so it doesn't overwrite
if [ -f $PWD/data/central_region.xyz ]
then
read -p "Seems like there's already some data. Do you want to delete everything and re-run the script? y/n" -n 1 -r
echo
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
rm -rfv data/ __pycache__/ logfile.txt seq.*.err seq.*.out
else
exit
fi
fi
mkdir data
mkdir data/basis
mkdir data/basis/ao
mkdir data/basis/mo
mkdir data/basis/eigenchannels
mkdir data/plots
mkdir data/data
cp hh_junc.traj data/.
cat > $SUBMIT <<!EOF
#!/bin/bash
#SBATCH --job-name=$NAME
#SBATCH --error=`pwd`/seq.%j.err
#SBATCH --output=`pwd`/seq.%j.out
#SBATCH --nodes=1
#SBATCH --ntasks=$CORES
#SBATCH --cpus-per-task=2
#SBATCH --mem=$MEM"gb"
#SBATCH --partition=$QUEUE
#Important to set OPENBLAS_NUM_THREADS
#GPAW will hang for a long time if not
export OPENBLAS_NUM_THREADS=1
gpaw -P $CORES python ~/bin/py_scripts/calc_current/calc_currents.py --path $PWD/data --config $PWD/config
!EOF
sbatch $SUBMIT
rm $SUBMIT