Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 35 additions & 4 deletions numa_streams/numa_streams_extra/run_numa_stream
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ cpus_per_node=""
cache_cap_size=0
host=`hostname`
size_list="0"
pcp=0
pcpdir=""

#
# Define options
Expand All @@ -50,6 +52,7 @@ ARGUMENT_LIST=(
"numa_iterations"
"numb_sizes"
"optimize_lvl"
"pcp"
"results_dir"
"size_list"
"strides"
Expand Down Expand Up @@ -111,7 +114,11 @@ while [[ $# -gt 0 ]]; do
optim=${2}
shift 2
;;

--pcp)
pcpdir=${2}
pcp=1
shift 2
;;
--results_dir)
echo setting result dir
resultdir=${2}
Expand Down Expand Up @@ -143,6 +150,11 @@ while [[ $# -gt 0 ]]; do
esac
done

if [[ $pcp -eq 1 ]]; then
source $TOOLS_BIN/pcp/pcp_commands.inc
setup_pcp
pcp_cfg=$TOOLS_BIN/pcp/default.cfg
fi

setup_sizing()
{
Expand Down Expand Up @@ -196,15 +208,18 @@ install_numa_streams()
{
dnf install wget gcc gcc-c++ autoconf hwloc hwloc-gui libomp -y
git clone https://github.com/jemalloc/jemalloc.git
pushd jemalloc
pushd jemalloc > /dev/null
./autogen.sh
make
make install
popd
popd > /dev/null

mkdir /opt/AMD
touch /opt/AMD/setenv_AOCC.sh

#
# We are getting the test from the phoronix git.
#
wget http://www.phoronix-test-suite.com/benchmark-files/amd-stream-dynamic-1.tar.xz

tar -xf amd-stream-dynamic-1.tar.xz
Expand Down Expand Up @@ -248,7 +263,17 @@ create_numa_cache_list()
cache_size_mb="512 1000 2000 4000"
for cache_size in $cache_size_mb
do
if [[ $pcp -eq 1 ]]; then
start_pcp_subset
fi
run_numa_test $threads $cache_size
if [[ $pcp -eq 1 ]]; then
echo "Send result to PCP archive"
out="${stream_size}_iter_${test_iters}"
result2pcp iteration_${iteration} ${out}
stop_pcp_subset
fi

done
}

Expand All @@ -266,20 +291,26 @@ run_numa_streams()
cpus=`cat /proc/cpuinfo | grep processor | wc -l`
threads=1

if [[ $pcp -eq 1 ]]; then
echo "Start PCP"
start_pcp ${pcpdir}/ numa_streams $pcp_cfg
fi
while [ $threads -lt $cpus ]
do
echo create_numa_cache_list $threads >> /root/debug_dups
create_numa_cache_list $threads
threads=`echo "${threads}*2" | bc`
done
create_numa_cache_list $cpus
if [[ $pcp -eq 1 ]]; then
shutdown_pcp
fi

#
# Record highest
#
echo Test:MB/sec > highest.csv

# DJV
record_numa_stream Copy
record_numa_stream Scale
record_numa_stream Add
Expand Down
89 changes: 41 additions & 48 deletions numa_streams/numa_streams_run
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
mem_offset=0
numa_iterations=10
arguments="$@"
pcp=""
pdir=""

curdir=`pwd`
if [[ $0 == "./"* ]]; then
Expand Down Expand Up @@ -93,7 +95,7 @@ process_results()
# Sort the data based on # sockets. To do this, dump the data to a temp
# file and sort it. We expect the results file to already be sorted based on size.
#
data_file=$(mktemp /tmp/streams_reduce_.XXXXXX)
data_file=$(mktemp /tmp/numa_streams_reduce_.XXXXXX)
for item in ${data[*]}; do
if [ $item_count -eq $data_index ]; then
break;
Expand Down Expand Up @@ -242,7 +244,7 @@ retrieve_sys_config()
echo "% Socket(s) "`grep "Socket(s):" stream* | cut -d: -f 3 | sort -u` >> ../results_${test_name}.csv
echo "% Model_name "`grep "^Model name" stream* | cut -d: -f 3 | sort -u` >> ../results_${test_name}.csv
echo "% total_memory "`grep "MemTotal:" /proc/meminfo | cut -d':' -f 2 | sed "s/ //g"` >> ../results_${test_name}.csv
echo "% streams_version_# "`grep "^STREAM version" stream* | cut -d':' -f 3 | cut -d' ' -f2 | sort -u` >> ../results_${test_name}.csv
echo "% numa_streams_version_# "`grep "^Numa version" numa_stream* | cut -d':' -f 3 | cut -d' ' -f2 | sort -u` >> ../results_${test_name}.csv
}

#
Expand All @@ -256,13 +258,9 @@ set_up_test()
if [[ $results_dir == "" ]]; then
results_dir=results_${test_name}_${to_tuned_setting}_`date +"%Y%m%d%H%M%S"`
fi
if [ -d /$run_dir/run_numa_stream ]; then
rm -rf /$run_dir/run_numa_stream 2> /dev/null
fi
if [ -d /tmp/streams_results ]; then
rm -rf /tmp/streams_results 2> /dev/null
fi
mkdir /tmp/streams_results
rm -f /$run_dir/run_numa_stream
rm -rf /tmp/numa_streams_results
mkdir /tmp/numa_streams_results

#
# Setup the run script
Expand All @@ -276,15 +274,15 @@ set_up_test()
#
run_numa_stream()
{
cd $run_dir
./run_numa_stream --cache_cap_size ${cache_cap_size} --iterations ${to_times_to_run} --cache_start_size $cache_start_factor --optimize_lvl ${1} --cache_multiply $cache_multiply --numb_sizes $nsizes --thread_multiply $threads_multiple --results_dir ${results_dir} --host ${to_configuration} --size_list ${size_list} --numa_iterations=${numa_iterations} --mem_offset=${mem_offset} > /tmp/streams_results/${2}_opt_${1}
mv ${results_dir}_* /tmp/streams_results
cd ..
pushd $run_dir > /dev/null
./run_numa_stream --cache_cap_size ${cache_cap_size} --iterations ${to_times_to_run} --cache_start_size $cache_start_factor --optimize_lvl ${1} --cache_multiply $cache_multiply --numb_sizes $nsizes --thread_multiply $threads_multiple --results_dir ${results_dir} --host ${to_configuration} --size_list ${size_list} --numa_iterations=${numa_iterations} --mem_offset=${mem_offset} ${pcp} > /tmp/numa_streams_results/${2}_opt_${1}
mv ${results_dir}_* /tmp/numa_streams_results
popd > /dev/null
}

streams_run()
numa_streams_run()
{
run_numa_stream 3 "streams_O3_${to_tuned_setting}.out"
run_numa_stream 3 "numa_streams_O3_${to_tuned_setting}.out"
}

tools_git=https://github.com/redhat-performance/test_tools-wrappers
Expand Down Expand Up @@ -353,8 +351,6 @@ fi
# to_home_root: home directory
# to_configuration: configuration information
# to_times_to_run: number of times to run the test
# to_pbench: Run the test via pbench
# to_puser: User running pbench
# to_run_label: Label for the run
# to_user: User on the test system running the test
# to_sys_type: for results info, basically aws, azure or local
Expand All @@ -364,6 +360,7 @@ fi

${curdir}/test_tools/gather_data ${curdir}
source test_tools/general_setup "$@"
export TOOLS_BIN

if [ ! -f "/tmp/${test_name}.out" ]; then
${TOOLS_BIN}/invoke_test --test_name ${test_name} --command ${0} --options "${arguments}"
Expand Down Expand Up @@ -484,36 +481,32 @@ while [[ $# -gt 0 ]]; do
esac
done

if [ $to_pbench -eq 1 ]; then
$TOOLS_BIN/execute_via_pbench --cmd_executing "$0" $arguments --test $test_name --spacing 11 --pbench_stats $to_pstats
else
set_up_test
streams_run
wdir=`pwd`
cd /tmp
if [[ $results_dir == "" ]]; then
results_dir=results_numa_streams_${tuned_setting}_$(date "+%Y.%m.%d-%H.%M.%S")
rm results_${test_name}_${tuned_setting} 2> /dev/null
mkdir ${results_dir}
ln -s ${results_dir} results_${test_name}_${tuned_setting}
cp /tmp/results_numa_streams/* $results_dir
else
mkdir ${results_dir}
cp /tmp/results_numa_streams/* $results_dir
fi
${curdir}/test_tools/move_data $curdir $results_dir
#
# report the results
#
pushd $results_dir > /dev/null
mv /tmp/streams.out .
mv /tmp/test_results_report .
mv /tmp/numa_results/* .
tar hcf results_${test_name}_${to_tuned_setting}.tar $results_dir
rm -rf results_pbench.tar
popd > /dev/null
tar hcf results_${test_name}_${to_tuned_setting}.tar $results_dir
working_dir=`ls -rtd /tmp/results*${test_name}* | grep -v tar | tail -1`
find $working_dir -type f | tar --transform 's/.*\///g' -cf results_pbench.tar --files-from=/dev/stdin
set_up_test

if [[ $to_use_pcp -eq 1 ]]; then
pdir=/tmp/pcp_`date "+%Y.%m.%d-%H.%M.%S"`
pcp="--pcp ${pdir}"
fi

numa_streams_run
wdir=`pwd`
cd /tmp
if [[ $results_dir == "" ]]; then
results_dir=/tmp/results_numa_streams_${tuned_setting}_$(date "+%Y.%m.%d-%H.%M.%S")
rm results_${test_name}_${tuned_setting} 2> /dev/null
mkdir ${results_dir}
ln -s ${results_dir} results_${test_name}_${tuned_setting}
cp /tmp/results_numa_streams/* $results_dir
else
mkdir ${results_dir}
cp /tmp/results_numa_streams/* $results_dir
fi
#
# report the results
#
pushd $results_dir > /dev/null
mv /tmp/${test_name}.out .
popd > /dev/null
tar hcf /tmp/results_${test_name}_${to_tuned_setting}.tar $results_dir
${curdir}/test_tools/save_results --curdir $curdir --home_root $to_home_root --test_name $test_name --tuned_setting=$to_tuned_setting --version NONE --user $to_user --copy_dir "$results_dir $pdir"
exit 0
Loading