-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunset4.sh
61 lines (42 loc) · 1.37 KB
/
runset4.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
#!/bin/bash
CHARMMEXEC=/net/orinoco/pga043/CHARMM_47a2/charmm_47a2/build_opls/charmm
ii=$run
ibeg=$(( ( $ii - 1 ) * $nitt + 1 ))
iend=$(( $ii * $nitt ))
DIR=`pwd`
name=`cat name`
nnodes=`cat nnodes`
nreps=`cat nreps`
RUNDIR=$DIR/run$i
echo "RUNDIR is run${i}"
# If this is the first iteration, set up the run directory
if [[ $ii -eq 1 ]]
then
mkdir $RUNDIR
mkdir $RUNDIR/res $RUNDIR/dcd $RUNDIR/failed
cp msld_prod.inp $RUNDIR/
cp variables$ini.inp $RUNDIR/variablesprod.inp
cp -r prep $RUNDIR
fi
# Done setting up the run directory
cd $RUNDIR
while [ $ibeg -gt 1 -a `../ALF/GetSteps.py res/${name}_prod$(( $ibeg - 1 )).lmd_0` -ne 50000 ]
do
echo "Error: Run $ibeg incomplete. Going back one step"
ibeg=$(( $ibeg - ( 1 * $nitt ) ))
done
for itt in `seq $ibeg $iend`
do
# Keep trying until simulation completes correctly with 50000 steps in lambda file
while [ `../ALF/GetSteps.py res/${name}_prod${itt}.lmd_0` -ne 50000 ]
do
# If run failed in past, file the failed files before moving on
if [ -f output_${itt} ]; then
cp output_${itt} output_${itt}_* error_${itt}* failed/
rm output_${itt} output_${itt}_* error_${itt}*
fi
# Run the simulation
mpirun -np $nreps -x OMP_NUM_THREADS=$nnodes --map-by node $CHARMMEXEC nsteps=500000 nsavc=10000 seed=$RANDOM itt=$itt -i msld_prod.inp > output_$itt 2> error_$itt
sed -i '/run setvariable domdecheuristic off/,$d' output_$itt
done
done