-
Notifications
You must be signed in to change notification settings - Fork 0
/
gen_vasp
executable file
·67 lines (63 loc) · 1.78 KB
/
gen_vasp
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
# ------------------------------------------
# Function:
# Script for running gen-generated serial jobs.
# Usage:
# 1. Edit the localization and run_flags parts, which is basically how you'd run vasp once, by uncommenting the appropriate line.
# 2. Edit gen.log. Comment out lines by #
# 3. Run gen_vasp
# History:
# 2017/02/24 Xiang: updated description.
# 2017/02/25 Xiang: compromise - flexible - tunable. localize at each machine. at dellpc, std/gam/gpu/ncl.
# ------------------------------------------
## localization ##
numbercores="$1"
flavor="$2"
if [[ -z $numbercores ]] || [[ -z $flavor ]] ; then
echo 'localized usage: gen_vasp $numbercores $flavor'
exit 64
fi
## run flags ##
vasp_command="mpiexec.hydra -n $numbercores /home/xzhang1/src/vasp.5.4.1/bin/vasp_$flavor"
gen_log_dir="${PWD}"
## reporting mechanisms ##
report_end() {
mail -s "VASP job finished: {$vasp_caller}|{${PWD##*/}}" 8576361405@vtext.com <<< EOM
}
trap report_end EXIT
## calculation ##
mkdir -p NOW
for p in `cat ${gen_log_dir}/gen.log`
do
if [[ $p == \#* ]] ; then
continue
fi
echo ${PWD} $p `date`
echo -------------------------------------
rm -rf ./NOW/tag_*
rm -rf vasprun.xml
touch ./NOW/tag_${p}
if [ ! -f ./NOW/POTCAR ] ; then
cp ./POTCAR ./NOW/POTCAR
fi
if [ ! -f ./NOW/POSCAR ] ; then
cp ./POSCAR ./NOW/POSCAR
fi
if [ -f ./NOW/CONTCAR ] && [ -s ./NOW/CONTCAR ] ; then
cp ./NOW/CONTCAR ./NOW/POSCAR
fi
cp INCAR-${p} ./NOW/INCAR
cp KPOINTS-${p} ./NOW/KPOINTS
cd ./NOW/
## vasp it!
eval ${vasp_command}
if [[ `tail -1 vasprun.xml` != "</modeling>" ]] ; then
report_end; exit 1
fi
cd ../
## end vasp it!
cp -r ./NOW ${p}
echo -------------------------------------
echo ${PWD} $p OVER HERE `date`
echo;echo
done