-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path05_run_afe.sh
56 lines (42 loc) · 1.33 KB
/
05_run_afe.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
#SBATCH -o PATH_TO_LOGS/%x_%a.slurm.out
#SBATCH -e PATH_TO_LOGS/%x_%a.slurm.err
#SBATCH -n N_TASKS
#SBATCH --gres=gpu:N_GPUS
#SBATCH --cpus-per-gpu N_CPUS
eval "$(conda shell.bash hook)"
conda activate obss
#try without this: #SBATCH --mem MEMORY
start=`date +%s`
# get ligand pair and lambda string from input variables
transformation=$1
lambdastring="$2"
# set variables in meze.py
engine=ENGINE
repeats=N_REPEATS
outputs_dir=OUTPUTS_DIR
echo "$lambdastring"
# read in lambda string
INPUT_FILE_STREAM=" " read -ra lambdas <<< "$lambdastring"
# use slurm array task id as lambda window index
id=$SLURM_ARRAY_TASK_ID
lambda=${lambdas[$id]}
for stage in "unbound" "bound"
do
for (( i=1; i<=$repeats; i++))
do
lambda_directory=$outputs_dir/${engine}_${i}/$transformation/$stage/lambda_$lambda
echo "Lambda directory is: $lambda_directory"
echo "Using ${engine}_${i} for $transformation at $stage lambda $lambda"
if [[ $engine == *"SOMD"* ]]; then
echo "Running AFE transformation..."
cd $lambda_directory
$BSS_HOME/somd-freenrg -C ./somd.cfg -l $lambda -c ./somd.rst7 -t ./somd.prm7 -m ./somd.pert -p CUDA 1> ./somd.out 2> ./somd.err
else
echo "Engine $engine is not supported yet."
fi
done
done
end=`date +%s`
runtime=$((end - start))
echo "Finished in $runtime seconds, or $((runtime/60)) minutes"