-
Notifications
You must be signed in to change notification settings - Fork 0
/
vasp_5.4.4_relaxation.sh
144 lines (98 loc) · 2.98 KB
/
vasp_5.4.4_relaxation.sh
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#!/bin/bash
#
#SBATCH --job-name=vasp_relaxation
#SBATCH --output=output_%j.out
#SBATCH --error=error_%j.err
#SBATCH --ntasks=Nan
#SBATCH --time=Nan
#SBATCH --partition=Nan
#SBATCH --mail-user=auguste.tetenoire@univ-rennes.fr
#SBATCH --mail-type=FAIL,REQUEUE,INVALID_DEPEND,STAGE_OUT
#Name of the directory where you will do the calculation
directory_name=${SLURM_JOB_ID}_${SLURM_JOB_NAME}
directory=/tmp/job_${directory_name}
# Create working directory
mkdir ${directory}
# directories where datas are stored
DD=${SLURM_SUBMIT_DIR}
# copy files in the working directory
for i in INCAR POSCAR POTCAR KPOINTS ; do
cp -rv ${i} ${directory}/.
done
#write that the calculation start
echo ${directory} ${SLURM_JOB_NODELIST}>> /home/users/${USER}/slurm.log.working
echo $SLURM_JOB_NODELIST >> ${DD}/mpd.hosts
cat >> /home/users/${USER}/slurm.log <<EOF
################################################################
$(date +'%A %d %B (%D) %Hh%M')
${SLURM_JOB_ID}
${SLURM_JOB_NAME}
${SLURM_SUBMIT_DIR}
${SLURM_JOB_NODELIST}
nodes=${SLURM_JOB_NUM_NODES}:ppn${SLURM_CPUS_ON_NODE}
${SLURM_NTASKS}
$(squeue -j ${SLURM_JOB_ID} -h --Format TimeLimit)
echo ${SLURM_JOB_PARTITION}
EOF
echo '======================'
echo '======================'
echo ''
echo "Starting at `date +"%D%t%A%t%T"`"
echo ''
echo '======================'
echo '======================'
echo ''
# go to working directory
cd ${directory}
# Def function of periodic copy
recopie-periodique ()
{
tjsPresent=`ls -l $TMPDIR | wc -l`
delai=10 # pour recopie des le demarrage du calcul
while [ $tjsPresent -gt 0 ]
do
sleep $delai
touch *
echo "Copie fichier : `date`"
cp -rv ${directory} ${DD}/working_save.tmp
tjsPresent=`ls -l $TMPDIR | wc -l`
delai=3000 # augmentation du delai pour limiter l'utilisation de la bande passante
done
}
recopie-periodique &
# Run the code
ulimit -s unlimited
if [[ $SLURM_JOB_PARTITION == *"AMD"* ]]; then
. /opt/intel/oneapi/setvars.sh
/cluster_cti/utils/openmpi/openmpi-4.1.0_ifort/bin/mpirun -np 48 /cluster_cti/bin/VASP/vasp.5.4.4/vasp_std
else
source /opt/intel/bin/ifortvars.sh intel64
/cluster_cti/utils/openmpi/openmpi-1.10.2/bin/mpirun -np 36 /cluster_cti/bin/VASP/VASP_5.4.4.pl2/vasp_std
fi
cd ${DD}
# Retrieve data
mv ${DD}/mpd.hosts ${directory}/.
mv ${directory} ${DD}/.
rm -r ${DD}/working_save.tmp
# Write that calculation ended
cat >> /home/users/${USER}/slurm.log.end <<EOF
################################################################
$(date +'%A %d %B (%D) %Hh%M')
${SLURM_JOB_ID}
${SLURM_JOB_NAME}
${SLURM_SUBMIT_DIR}
${SLURM_JOB_NODELIST}
nodes=${SLURM_JOB_NUM_NODES}:ppn${SLURM_CPUS_ON_NODE}
${SLURM_NTASKS}
$(squeue -j ${SLURM_JOB_ID} -h --Format TimeLimit)
echo ${SLURM_JOB_PARTITION}
EOF
sed -i "s/${directory} ${SLURM_JOB_NODELIST}//" /home/users/${USER}/slurm.log.working
echo '======================'
echo '======================'
echo ''
echo "Ending at `date +"%D%t%A%t%T"`"
echo ''
echo '======================'
echo '======================'
echo ''