forked from open-mpi/ompi-collectives-tuning
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_and_analyze.sh
More file actions
executable file
·65 lines (56 loc) · 1.41 KB
/
run_and_analyze.sh
File metadata and controls
executable file
·65 lines (56 loc) · 1.41 KB
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
#!/bin/bash
# Copyright (c) 2020 Amazon.com, Inc. or its affiliates. All Rights
# reserved.
#
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
numcoll=0
config_file=""
usage()
{
echo "Usage:
$0
-c | --config-file <config>
Options:
--config-file (string)
The file containing global configurations." 1>&2; exit 1;
}
OPTIONS=$(getopt -o :c: --long config-file: -- "$@")
if [[ $? -ne 0 ]]; then
usage
exit 1
fi
eval set -- "$OPTIONS"
while true; do
case "$1" in
'-c'|'--config-file')
case "$2" in
"") shift 2 ;;
*) config_file=$2; shift 2;;
esac;;
'--')
shift
break
;;
*) echo "Internal error!"; usage; exit 1 ;;
esac
done
python coltune_script.py $config_file
if [ $? -ne 0 ]; then
echo "Failed to create job scripts. Exiting.."
exit 1;
fi
collectives=$(cat $config_file | grep "collectives")
collectives=$(cut -d ":" -f 2 <<< "$collectives")
work_dir=$(dirname "$0")
# Some work needed to automatically create qsub jobs and wait for completion
for collective in ${collectives// / } ; do
qsub -N $collective -cwd $work_dir/output/$collective/${collective}_coltune.sh
done
collective_string=$(echo $collectives | sed 's/ /,/g')
qsub -hold_jid $collective_string $work_dir/analyze.sh -c $config_file
exit