-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprofess_serial_convergence_test_ecut
More file actions
executable file
·65 lines (40 loc) · 1.31 KB
/
profess_serial_convergence_test_ecut
File metadata and controls
executable file
·65 lines (40 loc) · 1.31 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
#!/bin/bash
# run in directory containing input files for a PROFESS run
first_energy=$1
final_energy=$2
energy_step=$3
# auto-determine fileroot
name=`ls *.inpt`
fileroot=`python3 -c "print('$name'.split('.')[0])"`
if [ ! -f ecut.txt ]; then
echo "Cutoff Energy [eV]; Total calculated energy per atom [eV]; Time [s]" >> ecut.txt
fi
counter=0
for cutoff in `seq $first_energy $energy_step $final_energy`; do
mkdir ecut_${cutoff}
cp ${fileroot}.* ecut_${cutoff}
cp *.usp* ecut_${cutoff}
cp *pot* ecut_${cutoff}
cd ecut_${cutoff}
sed -i "s/XYZ/${cutoff}/gi" ${fileroot}.inpt
PROFESS $fileroot > profess.run &
cd ..
counter=$((counter+1))
if [ $counter -eq $NCORES ]; then
wait
# all jobs are done; next num_cores jobs can be started
counter=0
fi
done
wait
# do the same loop again to read output data
for cutoff in `seq $first_energy $energy_step $final_energy`; do
cd ecut_${cutoff}
energy=`awk '{IGNORECASE=1} /total energy/ {print $5}' ${fileroot}.out`
time=`awk '/PROFESS/ {print $3}' ${fileroot}.out | tail -1`
# determine number of atoms per UC in order to calculate the total energy per atom
natoms=`awk '/Ion number/ {print $4}' ${fileroot}.out`
energy_per_atom=`python3 -c "print(float('$energy')/float('$natoms'))"`
echo $cutoff $energy_per_atom $time >> ../ecut.txt
cd ..
done