|
1 #!/bin/bash |
|
2 |
|
3 MODE=compare |
|
4 if [[ "$1" == "--seq" ]]; then |
|
5 MODE=seq |
|
6 shift |
|
7 elif [[ "$1" == "--par" ]]; then |
|
8 MODE=par |
|
9 shift |
|
10 fi |
|
11 |
|
12 if [[ -z "$1" ]] || [[ "$1" == "--help" ]]; then |
|
13 echo "Usage: run.sh [--seq | --par] path-to-shell paths-to-test" |
|
14 echo "" |
|
15 echo "Runs the given benchmark(s) using the given shell and " |
|
16 echo "prints the results. If -seq or -par is supplied, " |
|
17 echo "only runs sequentially or in parallel. Otherwise, runs both" |
|
18 echo "and compares the performance." |
|
19 fi |
|
20 |
|
21 D="$(dirname $0)" |
|
22 S="$1" |
|
23 shift |
|
24 for T in "$@"; do |
|
25 echo "$S" --ion-parallel-compile=on -e "'"'var libdir="'$D'/"; var MODE="'$MODE'";'"'" "$T" |
|
26 "$S" --ion-parallel-compile=on -e 'var libdir="'$D'/"; var MODE="'$MODE'";' "$T" |
|
27 done |