-
Notifications
You must be signed in to change notification settings - Fork 4
/
run_benchmarks.sh
executable file
·110 lines (85 loc) · 1.77 KB
/
run_benchmarks.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
#!/bin/bash
_CWD="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd)"
function usage(){
echo \
"""
Usage:
run_benchmarks.sh [[OPTIONS]]
General Options
---------------
[-o|--out-dir <dir>] Path to output directory
[-t|--type <mpi, tmpi, tmpi_stream, tmpi_init>] Specify to run mpi or threaded mpi
)
"""
}
parse_arguments(){
set +u
while (( "$#" )); do
case "$1" in
-o|--out-dir)
out_dir="$2"
shift 2
;;
-t|--type)
run_type="$2"
shift 2
;;
--) # end argument parsing
shift
break
;;
-*|--*=|*) # unsupported flags
echo "Error: Unsupported flag $1" >&2
usage
exit 1
;;
esac
done
if [[ -z "${run_type+x}" ]]; then
echo "Must specify run-type -t as either 'mpi', 'tmpi', 'tmpi_stream' or 'tmpi_init'"
exit -1
fi
if [[ -z "${out_dir+x}" ]]; then
out_dir="/tmp"
echo "using /tmp as output directory"
fi
}
parse_arguments $*
run_mpi(){
echo "running mpi mode"
cd $_CWD
./gromacs_mpi.sh $out_dir
}
run_tmpi(){
echo "running threaded mpi mode"
cd $_CWD
./gromacs_tmpi.sh $out_dir
}
run_tmpi_stream(){
echo "running threaded mpi mode"
cd $_CWD
./gromacs_tmpi_stream.sh $out_dir
}
run_tmpi_init(){
echo "running threaded mpi mode"
cd $_CWD
./gromacs_tmpi_init.sh $out_dir
}
export GMX_GPU_DD_COMMS=1
export GMX_GPU_PME_PP_COMMS=1
export GMX_FORCE_UPDATE_DEFAULT_GPU=1
export ROC_ACTIVE_WAIT_TIMEOUT=0
export AMD_DIRECT_DISPATCH=0
if [[ $run_type == "mpi" ]]; then
run_mpi
fi
if [[ $run_type == "tmpi" ]]; then
run_tmpi
fi
if [[ $run_type == "tmpi_stream" ]]; then
run_tmpi_stream
fi
if [[ $run_type == "tmpi_init" ]]; then
run_tmpi_init
fi
# EDIT 3