Benchmarking program for scalar mpi reductions, and nonbatch script for running benchmarks

- New program mpi_reduce_bench
      - runs testcases defined in source
      - writes all benchmark results to a csv file, tags the testcase and benchmark run
      - takes optional argument for benchmark tag, default benchmark tag is a timestamp
    - New script mpibench.sh
      - runs the mpi_reduce_bench with defined parameters:
        - number of tasks
        - number of nodes
        - the benchmark tag for mpi_reduce_bench, default tag is the current git HEAD short hash
This commit is contained in:
Oskar Lappi
2020-06-05 19:48:40 +03:00
parent 9e5fd40838
commit 666f01a23d
4 changed files with 206 additions and 0 deletions

View File

@@ -0,0 +1,63 @@
#!/bin/bash
#defaults
default_num_procs=8
default_num_nodes=2
num_procs=$default_num_procs
num_nodes=$default_num_nodes
script_name=$0
print_usage(){
echo "Usage: $script_name [Options]"
echo "\tRuns mpi_reduce_bench, which will write benchmark results"
echo "Options:"
echo "\t -n <num_procs>"
echo "\t\t-n option to slurm, default=$default_num_procs"
echo "\t -N <num_nodes>"
echo "\t\t-N option to slurm, default=$default_num_nodes"
echo "\t -t <tag>"
echo "\t\tA benchmark tag that will be added to the mpi_reduction_benchmark.csv file"
echo "\t\tBy default the current git HEAD short hash will be used as a tag"
}
while getopts n:N:t: opt
do
case "$opt" in
n)
if [ $OPTARG ]
then
num_procs=$OPTARG
else
print_usage
exit 1
fi
;;
N)
if [ $OPTARG ]
then
num_nodes=$OPTARG
else
print_usage
exit 1
fi
;;
t)
if [ $OPTARG ]
then
benchmark_label=$OPTARG
else
print_usage
exit 1
fi
;;
esac
done
if [ -z "$benchmark_label" ]
then
benchmark_label=$(git rev-parse --short HEAD)
fi
set -x
srun --account=project_2000403 --gres=gpu:v100:4 --mem=48000 -t 00:14:59 -p gpu -n ${num_procs} -N ${num_nodes} ./mpi_reduce_bench ${benchmark_label}