Commit fd7843bd authored by aumgn's avatar aumgn
Browse files

[exp/run] Add lb_bias parameter, "init" pinning and sd output

parent 7bd56121
......@@ -29,21 +29,22 @@ msg() {
usage() {
cat <<HD
Usage: $script [-v] <programs> <pinning> <nodes> <autogroup> <repeat>
Usage: $script [-v] <programs> <pinning> <nodes> <autogroup> <lb_bias> <repeat>
-v toggle verbose mode
<programs> list of programs to run
<pinning> list of values among { cores, nodes, subset, none }
<nodes> list of numbers of nodes
<autogroup> whether ('y') or not ('n') autogroup should be enabled
<lb_bias> whether ('y') or not ('n') load_balancing should be biased with exponential smoothing
<repeat> the number of time to run the application for each parameter combinations
Run volrend on 64 cores with and without pinning one time each:
>> $0 volrend "cores none" 8 n 1
>> $0 volrend "cores none" 8 n n 1
Run volrend and wordcount on 1,2,3,4,5,6,7,8 nodes
with pinning and without pinning, with and without
autogroup, five times each:
>> $0 "volrend word_count" "cores none" "\$(seq 1 8)" "y n" 5
>> $0 "volrend word_count" "cores none" "\$(seq 1 8)" "y n" "y n" 5
HD
}
......@@ -140,11 +141,12 @@ dump_args() {
local args_file=$RESULTS_DIR/args
echo $programs >>$args_file
echo $pinnings >>$args_file
echo $nodes_list >>$args_file
echo $autogroups >>$args_file
echo $repeat >>$args_file
echo "PROGRAM = $programs" >>$args_file
echo "PINNING = $pinnings" >>$args_file
echo "NODES = $nodes_list" >>$args_file
echo "AUTOGROUP = $autogroups" >>$args_file
echo "LB_BIAS = $lb_biases" >>$args_file
echo "REPEAT = $repeat" >>$args_file
}
dump_programs() {
......@@ -163,12 +165,15 @@ run_iterations() {
local pinning=$2
local nodes=$3
local autogroup=$4
local lb_bias=$5
local threads=$(($nodes * 8))
if [[ $pinning == 'cores' ]]; then
local pin_prefix="$PINTHREADS_BIN -c 0-$((threads-1))"
elif [[ $pinning == 'nodes' ]]; then
local pin_prefix="$PINTHREADS_BIN -n 0-$(($nodes-1)) -N"
elif [[ $pinning == 'init' ]]; then
local pin_prefix="$PINTHREADS_BIN -c 0-$((threads-1)) -i"
elif [[ $pinning == 'subset' ]]; then
local pin_prefix="numactl -N 0-$(($nodes-1))"
elif [[ $pinning == 'none' ]]; then
......@@ -187,16 +192,25 @@ run_iterations() {
exit 35
fi
printf '[%10s][%6s][%2d][%s] ' $program $pinning $nodes $autogroup
if [[ $lb_bias == "y" ]]; then
echo 'LB_BIAS' | sudo tee /sys/kernel/debug/sched_features >/dev/null
elif [[ $lb_bias == "n" ]]; then
echo 'NO_LB_BIAS' | sudo tee /sys/kernel/debug/sched_features >/dev/null
else
echo "Unknown lb_bias $lb_bias (y/n)"
exit 35
fi
local exp_dir=$TMP_RESULTS_DIR/outputs/$program-$pinning-$nodes-$autogroup
printf '[%10s][%6s][%2d][%s][%s] ' $program $pinning $nodes $autogroup $lb_bias
local exp_dir=$TMP_RESULTS_DIR/outputs/$program-$pinning-$nodes-$autogroup-$lb_bias
for iteration in $(seq 1 $repeat); do
local iteration_dir=$exp_dir/$iteration
mkdir -p $iteration_dir
local iteration_dir=$exp_dir/$iteration
mkdir -p $iteration_dir
local time_file=$iteration_dir/time
local time_prefix="/usr/bin/time -f%e -o $iteration_dir/time -a"
local time_file=$iteration_dir/time
local time_prefix="/usr/bin/time -f%e -o $iteration_dir/time -a"
local trace_prefix=""
if [[ -n $WITH_TRACE ]]; then
......@@ -210,32 +224,32 @@ run_iterations() {
perf_prefix="$PERF_BASE_PREFIX -o $perf_file"
fi
local output=$iteration_dir/output
local errors=$iteration_dir/error
local output=$iteration_dir/output
local errors=$iteration_dir/error
local cmd_prefix="$perf_prefix $time_prefix $pin_prefix"
local cmd_prefix="$perf_prefix $time_prefix $pin_prefix"
local cmd="$(command_$program "$cmd_prefix" "$threads")"
echo "#### $cmd" >$iteration_dir/command
cat /proc/schedstat >$iteration_dir/schedstat.before
if [[ -n $WITH_WC_VISU ]]; then
sudo insmod $SCHED_PROFILER_MOD_PATH
fi
if [[ -n $WITH_WC_VISU ]]; then
sudo insmod $SCHED_PROFILER_MOD_PATH
fi
eval "$cmd" 1>>$output 2>>$errors
echo "$?" >$iteration_dir/exit_status
if [[ -n $WITH_WC_VISU ]]; then
cat /proc/sched_profiler > $iteration_dir/sched_profiler.output
sudo rmmod $SCHED_PROFILER_MOD_PATH
fi
echo "$?" >$iteration_dir/exit_status
if [[ -n $WITH_WC_VISU ]]; then
cat /proc/sched_profiler > $iteration_dir/sched_profiler.output
sudo rmmod $SCHED_PROFILER_MOD_PATH
fi
cat /proc/schedstat >$iteration_dir/schedstat.after
printf '.'
done
avg=$(awk '{ sum += $1 } END { if (NR > 0) print sum / NR; else print NaN }' $exp_dir/*/time)
printf ' | Avg: %6.2f\n' $avg
avg=$(awk '{ sum += $1 } END { if (NR > 0) print sum / NR; else print NaN }' $exp_dir/*/time)
sd=$(awk '{ sum += $1; sum2 += $0^2 } END { print sqrt(sum2 / NR - (sum/NR)^2)}' $exp_dir/*/time)
printf ' | Avg: %6.2f ~%3.2f\n' $avg $sd
}
run_all() {
......@@ -245,7 +259,9 @@ run_all() {
for pinning in $pinnings; do
for nodes in $nodes_list; do
for autogroup in $autogroups; do
run_iterations $program $pinning $nodes $autogroup
for lb_bias in $lb_biases; do
run_iterations $program $pinning $nodes $autogroup $lb_bias
done
done
done
done
......@@ -256,7 +272,7 @@ check_errors() {
msg "# Checking errors"
if grep -v 0 $TMP_RESULTS_DIR/outputs/*/*/exit_status; then
exit 1
exit 1
fi
}
......@@ -272,7 +288,7 @@ move_results() {
cleanup_system() {
if sysctl kernel.sched_schedstats >/dev/null 2>&1; then
sudo sysctl kernel.sched_schedstats=0 >/dev/null
sudo sysctl kernel.sched_schedstats=0 >/dev/null
fi
}
......@@ -281,19 +297,19 @@ script=$0
verbose=''
while [[ $1 == -* ]]; do
case $1 in
-v)
-v)
verbose=true
shift
;;
*)
;;
*)
echo "Unkown flag $0"
usage
exit 126
;;
;;
esac
done
if [[ $# != 5 ]]; then
if [[ $# != 6 ]]; then
usage
exit 125
fi
......@@ -302,6 +318,7 @@ programs=$1; shift
pinnings=$1; shift
nodes_list=$1; shift
autogroups=$1; shift
lb_biases=$1; shift
repeat=$1; shift
prepare_bench
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment