Blame test/run_alloc_benchmark.sh
|
Packit |
345191 |
#!/bin/bash
|
|
Packit Service |
7f3b24 |
# SPDX-License-Identifier: BSD-2-Clause
|
|
Packit Service |
7f3b24 |
# Copyright (C) 2014 - 2020 Intel Corporation.
|
|
Packit |
345191 |
|
|
Packit |
345191 |
# Allocator
|
|
Packit |
345191 |
ALLOCATOR="glibc tbb hbw pmem"
|
|
Packit |
345191 |
# Thread configuration
|
|
Packit |
345191 |
THREADS=(1 2 4 8 16 18 36)
|
|
Packit |
345191 |
# Memory configuration (in kB) / iterations
|
|
Packit |
345191 |
MEMORY=(1 4 16 64 256 1024 4096 16384)
|
|
Packit |
345191 |
# Iterations
|
|
Packit |
345191 |
ITERS=1000
|
|
Packit |
345191 |
|
|
Packit |
345191 |
export KMP_AFFINITY=scatter,granularity=fine
|
|
Packit |
345191 |
|
|
Packit |
345191 |
# For each algorithm
|
|
Packit |
345191 |
for alloc in $ALLOCATOR
|
|
Packit |
345191 |
do
|
|
Packit |
345191 |
rm -f alloctest_$alloc.txt
|
|
Packit |
345191 |
echo "# Number of threads, allocation size [kB], average malloc and free time [ms], average allocation time [ms], \
|
|
Packit |
345191 |
average free time [ms], first allocation time [ms], first free time [ms]" >> alloctest_$alloc.txt
|
|
Packit |
345191 |
# For each number of threads
|
|
Packit |
345191 |
for nthr in ${THREADS[*]}
|
|
Packit |
345191 |
do
|
|
Packit |
345191 |
# For each amount of memory
|
|
Packit |
345191 |
for mem in ${MEMORY[*]}
|
|
Packit |
345191 |
do
|
|
Packit |
345191 |
echo "OMP_NUM_THREADS=$nthr ./alloc_benchmark_$alloc $ITERS $mem >> alloctest_$alloc.txt"
|
|
Packit |
345191 |
OMP_NUM_THREADS=$nthr ./alloc_benchmark_$alloc $ITERS $mem >> alloctest_$alloc.txt
|
|
Packit |
345191 |
ret=$?
|
|
Packit |
345191 |
if [ $ret -ne 0 ]; then
|
|
Packit |
345191 |
echo "Error: alloc_benchmark_$alloc returned $ret"
|
|
Packit |
345191 |
exit
|
|
Packit |
345191 |
fi
|
|
Packit |
345191 |
done
|
|
Packit |
345191 |
done
|
|
Packit |
345191 |
done
|
|
Packit |
345191 |
|
|
Packit |
345191 |
echo "Data collected. You can draw performance plots using python draw_plots.py."
|