-
Notifications
You must be signed in to change notification settings - Fork 1
/
minim.sh
56 lines (43 loc) · 1.08 KB
/
minim.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
#!/bin/bash
np=$1
box=${2:-1.0}
[ -z "$gmx" ] && gmx="/work/gmx-docker --"
if [ -z "$np" ]; then
echo usage: $0 number_of_cores
exit 1
fi
unset OMP_NUM_THREADS
minone() {
in=$1
base=$(basename $in .pdb)
# echo Prepare topology
$gmx pdb2gmx -f $base.pdb -o $base.gro -p $base -i $base -water spce -ff amber99 -ignh &&
# echo Add box
$gmx editconf -f $base.gro -o $base-box.gro -d $box -bt cubic &&
# not solvating
# no ions
# echo Minimize
$gmx grompp -f minim.mdp -c $base-box.gro -p $base.top -o $base-min.tpr -po $base-min.mdp -maxwarn 1 &&
$gmx mdrun -v -deffnm $base-min -ntomp 1 &&
(echo 10; echo) | $gmx energy -f $base-min.edr -xvg none -o $base.xvg &&
tail -1 $base.xvg >$base.minen && rm $base.xvg
}
nfil=$(ls conf*.pdb | wc -l)
echo Starting $np parallel processes
for p in $(seq 1 $np); do
(
i=$p
while [ $i -le $nfil ]; do
minone conf$i.pdb
i=$(($i + $np))
done
) >minim-$p.log 2>&1 &
done
echo Waiting for workers to finish
wait
echo Done, last 200 lines of their logs
echo
for p in $(seq 1 $np); do
echo ----- $p -----
tail -200 minim-$p.log
done