From 5f6cf24cbaec4a9552591a599882054ad77d1cc2 Mon Sep 17 00:00:00 2001 From: David Valin Date: Wed, 10 Sep 2025 08:56:47 -0400 Subject: [PATCH 1/8] Remove streams directory, not needed. --- streams/streams_extra/run_stream | 299 ------------------ streams/streams_run | 519 ------------------------------- 2 files changed, 818 deletions(-) delete mode 100755 streams/streams_extra/run_stream delete mode 100755 streams/streams_run diff --git a/streams/streams_extra/run_stream b/streams/streams_extra/run_stream deleted file mode 100755 index 0c7fc7b..0000000 --- a/streams/streams_extra/run_stream +++ /dev/null @@ -1,299 +0,0 @@ -#!/bin/bash -# -# Copyright (C) 2022 David Valin dvalin@redhat.com -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# - -numa_iterations=10 -mem_offset=0 -strides=1 -iterations=10 -tuned_config="None" -optim=3 -optim_opt="" -cache_multiply=2 -numb_sizes=4 -streams_exec="" -start_at=1 -thread_multiply=2 -use_cache="" -base_cache_size="" -resultdir="" -cpus_per_node="" -cache_cap_size=0 -host=`hostname` -size_list="0" - -# -# Define options -# -ARGUMENT_LIST=( - "cache_cap_size" - "cache_multiply" - "cache_start_size" - "host" - "iterations" - "mem_offset" - "numa_iterations" - "numb_sizes" - "optimize_lvl" - "results_dir" - "size_list" - "strides" - "thread_multiply" -) - -NO_ARGUMENTS=( - "usage" -) - - -# read arguments -opts=$(getopt \ - --longoptions "$(printf "%s:," "${ARGUMENT_LIST[@]}")" \ - --longoptions "$(printf "%s," "${NO_ARGUMENTS[@]}")" \ - --name "$(basename "$0")" \ - --options "h" \ - -- "$@" -) - -eval set --$opts - -while [[ $# -gt 0 ]]; do - echo $1 >> /tmp/junk - case "$1" in - --cache_cap_size) - cache_cap_size=${2} - shift 2 - ;; - --cache_multiply) - cache_multiply=${2} - shift 2 - ;; - --cache_start_size) - ache_start_size=${2} - shift 2 - ;; - --host) - host=${2} - shift 2 - ;; - --iterations) - iterations=${2} - shift 2 - ;; - --mem_offset) - mem_offset=${2} - shift 2 - ;; - --numa_iterations) - numa_iterations=${2} - shift 2 - ;; - --numb_sizes) - numb_sizes=${2} - shift 2 - ;; - --optimize_lvl) - optim=${2} - shift 2 - ;; - - --results_dir) - echo setting result dir - resultdir=${2} - shift 2 - ;; - --size_list) - size_list=${2} - shift 2 - ;; - --strides) - strides=${2} - shift 2 - ;; - --thread_multiply) - thread_multiply=${2} - if [[ $thread_multiply == "1" ]]; then - echo Thread multiple can not be 1, defaulting to 2 - thread_multiply=2 - fi - shift 2 - ;; - --usage) - echo usage to come - exit - ;; - --) - break; - ;; - esac -done - - -setup_sizing() -{ - numa_nodes=`lscpu | grep NUMA | grep CPU | wc -l` - - if [ $optim -eq 3 ]; then - echo Optimization=O3 - optim_opt="-O3" - else - echo Optimization=02 - optim_opt="-O2" - fi - if [[ $resultdir != "" ]]; then - resultdir="${resultdir}_${optim_opt}" - mkdir $resultdir - fi - cpus=`lscpu | grep "^CPU(s)" | cut -d: -f 2` - echo cpus=${cpus} - - cpus_per_node=`echo ${cpus}/${numa_nodes} | bc` - - # - # Sizing from Pete Rival - # - cpu_list=`cat /proc/cpuinfo | grep "processor"| cut -d: -f 2` - - # - # Some systems have a third-level cache that's not an classic L3 cache but rather a System-Level Cache (SLC). - # Arm Neoverse-based systems are among these special cases. At this time that means there's no L3 cache in the - # sysfs hierarchy. Unless and until that changes, special case things with hardcoded numbers because there's - # no good way to tell otherwise. We'll want to revisit this if more systems with different-sized SLCs arrive. - # - - if [ -f /sys/devices/system/cpu/cpu0/cache/index3/shared_cpu_list ]; then - top_level_caches=`cat /sys/devices/system/cpu/cpu*/cache/index3/shared_cpu_list |sort | uniq |wc -l` - base_cache_size=`cat /sys/devices/system/cpu/cpu0/cache/index*/size | sed -e s/K// -e s/M// | sort -n | tail -1` - else - # - # Neoverse systems have a 32MB SLC that is not exposed properly. Work around that here. - # - top_level_caches=$numa_nodes - base_cache_size=$(( 32768 * numa_nodes )) - fi - # - # Numa streams operates on a long, not bytes like regular streams does. - # - base_cache_size=`echo "${base_cache_size} * ${start_at}/8" | bc` -} - -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 - ./autogen.sh - make - make install - popd - - mkdir /opt/AMD - touch /opt/AMD/setenv_AOCC.sh - - wget http://www.phoronix-test-suite.com/benchmark-files/amd-stream-dynamic-1.tar.xz - - tar -xf amd-stream-dynamic-1.tar.xz - cd amd-stream-dynamic - files=`grep "fnt-store=aggressive" * | cut -d: -f1` - for i in $files; do - echo in here - sed "s/-fnt-store=aggressive//" < $i > temp - rm -rf $i - mv temp $i - done - - export CC=gcc - export CXX=g++ - # - # No cpu_governor on cloud systems - # - files=`grep set_cpu_governor * |cut -d':' -f1 | sort -u` - for i in $files; do - sed "s/^set_cpu_governor$/# set_cpu_governor/g" < $i | sed "s/-mavx2//g" > foo - rm -rf $i - mv foo $i - chmod 755 $i - done - ./build_stream_dynamic.py - chmod 755 ./run_stream_dynamic.py -} - -run_numa_test() -{ - threads=$1 - size_of_cache=$2 - - echo ./run_stream_dynamic.py --threads $1 --stream_array_mb $2 --ntimes 100 > ${2}meg_threads=${1}_passes=100 - ./run_stream_dynamic.py --threads $1 --stream_array_mb $2 --ntimes 100 >> ${2}meg_threads=${1}_passes=100 -} - -create_numa_cache_list() -{ - threads=$1 - cache_size_mb="512 1000 2000 4000" - for cache_size in $cache_size_mb - do - run_numa_test $threads $cache_size - done -} - -record_numa_stream() -{ - value=`grep ${1} *meg_threads* | awk '{print $2}' |sort -n | tail -1` - echo ${1}:${value} >> highest.csv - value=`grep ${1} *meg_threads* | awk '{print $5}' |sort -n | tail -1` - echo ${1}:${value} >> min.csv -} - - -run_numa_streams() -{ - cpus=`cat /proc/cpuinfo | grep processor | wc -l` - threads=1 - - 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 - - # - # Record highest - # - echo Test:MB/sec > highest.csv - - # DJV - record_numa_stream Copy - record_numa_stream Scale - record_numa_stream Add - record_numa_stream Triad - rm -rf /tmp/results_numa_streams - mkdir /tmp/results_numa_streams - cp *meg_threads* /tmp/results_numa_streams - cp *csv /tmp/results_numa_streams -} - -setup_sizing -base_cache_size=`echo "${base_cache_size}*1024" | bc` -install_numa_streams -run_numa_streams -rm -rf /tmp/numa_results -mkdir /tmp/numa_results -cp * /tmp/numa_results diff --git a/streams/streams_run b/streams/streams_run deleted file mode 100755 index 0fb7e84..0000000 --- a/streams/streams_run +++ /dev/null @@ -1,519 +0,0 @@ -# -# Copyright (C) 2022 David Valin dvalin@redhat.com -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# - -mem_offset=0 -numa_iterations=10 -arguments="$@" - -curdir=`pwd` -if [[ $0 == "./"* ]]; then - chars=`echo $0 | awk -v RS='/' 'END{print NR-1}'` - if [[ $chars == 1 ]]; then - run_dir=`pwd` - else - run_dir=`echo $0 | cut -d'/' -f 1-${chars} | cut -d'.' -f2-` - run_dir="${curdir}${run_dir}" - fi -else - chars=`echo $0 | awk -v RS='/' 'END{print NR-1}'` - run_dir=`echo $0 | cut -d'/' -f 1-${chars}` -fi - -# -# streams arguments -# -size_list="0" -opt_three=1 -opt_two=1 -cache_multiply=2 -nsizes=3 -cache_start_factor=1 -threads_multiple=2 -results_dir="" -cache_cap_size=0 -test_name="numa_streams" - -# -# Report results -# - -process_list() -{ - echo $number_sockets Socket >> ../results_${test_name}.csv - echo Copy:$copy >> ../results_${test_name}.csv - echo Scale:$scale >> ../results_${test_name}.csv - echo Add:$add >> ../results_${test_name}.csv - echo Triad:$triad >> ../results_${test_name}.csv - echo "" >> ../results_${test_name}.csv - line_size=`echo $copy | wc -c` - if [ $line_size -lt 2 ]; then - echo Failed >> /tmp/test_results_report - else - echo Ran >> /tmp/test_results_report - fi -} - -process_results() -{ - declare -a data - data_index=0 - header="" - system_name="" - - real_data=0 - while IFS= read -r line - do - if [ $real_data -eq 0 ]; then - if [[ $line == "buffer_size"* ]]; then - header=${line} - real_data=1 - fi - else - data[$data_index]=$line - let "data_index=${data_index}+1" - fi - done < "$1" - item_count=0 - # - # 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) - for item in ${data[*]}; do - if [ $item_count -eq $data_index ]; then - break; - fi - let "item_count=${item_count}+1" - echo "$item" >> $data_file - done - sort -u -t : -k 3 $data_file| grep -v ^buffer > ${data_file}.sorted - - # - # We have the data sorted, now go through things. Each jump in number of sockets - # - number_sockets=0 - - # - # Now build the csv file - # - field_index=1 - while IFS= read -r line - do - current_socket=`echo $line | cut -d':' -f3` - if [ $number_sockets -eq 0 ]; then - number_sockets=$current_socket - else - if [ $current_socket -ne $number_sockets ]; then - process_list - field_index=1 - fi - number_sockets=$current_socket - fi - # - # Building the header list - # - if [[ $field_index -eq 1 ]]; then - header=$system_name - copy="" - scale="" - add="" - triad="" - separ="" - fi - field_index=2 - value=`echo $line | cut -d: -f 1` - header=${header}":"${value} - # - # Easiest way is to put each item into their own file. - # When the sockets chance we will then join the files - # into one. - # - val=`echo $line | cut -d: -f 4` - copy=${copy}${separ}$val - val=`echo $line | cut -d: -f 5` - scale=${scale}${separ}$val - val=`echo $line | cut -d: -f 6` - add=${add}${separ}$val - val=`echo $line | cut -d: -f 7` - triad=${triad}${separ}$val - separ=":" - done < ${data_file}.sorted - rm ${data_file}.sorted 2> /dev/null - process_list -} - -# -# Create the summary csv file. -# - -out_line="" - -# -# Retrieve the relevent lines from the file. -# We return the average of all the lines. -# -retrieve_line() -{ - search_for=$1 - file=$2 - items=0 - calc_line="" - - info=`grep "${search_for}" ${file}* | tr -s " " | sed "s/ /:/g" | cut -d: -f 4` - - for i in $info; do - if [ $items -eq 0 ]; then - calc_line="("${calc_line}${i} - else - calc_line=${calc_line}"+"${i} - fi - let items="${items}+1" - done - calc_line=$calc_line")/"$items - out_line=$out_line":"`echo $calc_line | bc` -} - -# -# First get the data -# -# -# line format -# buffer_size:#threads:#sockets:Copy rate:Scale rate:Add rate:Triad rate -# -retrieve_results() -{ - last_file="" - # - # Get all the files to work on. - # - ls stream* | sort > files - for i in `cat files`; do - file=`echo $i | cut -d'_' -f 1-5` - if [[ $file == $last_file ]]; then - continue - fi - last_file=$file - out_line=`echo $i | cut -d'.' -f 2` - out_line=$out_line":"`echo $i | cut -d'_' -f 2 | cut -d'.' -f1` - out_line=$out_line":"`echo $i | cut -d'_' -f 4 | cut -d'.' -f1` - retrieve_line "^Copy" $file - retrieve_line "^Scale" $file - retrieve_line "^Add" $file - retrieve_line "^Triad" $file - echo $out_line >> temp_file - done - # - # Header - # - echo buffer_size:#threads:#sockets:Copy:Scale:Add:Triad >> results_${test_name}.wrkr - # - # Now the actual results - # - sort -n temp_file >> results_${test_name}.wrkr - rm temp_file files -} - -# -# Retrieve the system configuration information -# -retrieve_sys_config() -{ - echo "% Optimization level: ${1}" >> ../results_${test_name}.csv - echo "% kernel_rev "`grep "^kernel:" stream* | cut -d: -f 3 | sort -u` >> ../results_${test_name}.csv - echo "% numa_nodes "`grep "^NUMA node(s):" stream* | cut -d: -f 3 | sort -u` >> ../results_${test_name}.csv - echo "% number_cpus "`grep "^CPU(s):" stream* | cut -d: -f 3 | sort -u` >> ../results_${test_name}.csv - echo "% Thread(s)_per_core "`grep "Thread(s) per core:" stream* | cut -d: -f 3 | sort -u` >> ../results_${test_name}.csv - echo "% Core(s)_per_socket "`grep "Core(s) per socket:" stream* | cut -d: -f 3 | sort -u` >> ../results_${test_name}.csv - 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 -} - -# -# General setup -# -set_up_test() -{ - # - # Set the results dir name, and create it. - # - 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_stream ]; then - rm -rf /$run_dir/run_stream 2> /dev/null - fi - if [ -d /tmp/streams_results ]; then - rm -rf /tmp/streams_results 2> /dev/null - fi - mkdir /tmp/streams_results - - # - # Setup the run script - # - cp $run_dir/streams_extra/run_stream $run_dir - chmod 755 $run_dir/run_stream -} - -# -# Run the test. -# -run_stream() -{ - cd $run_dir - ./run_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 .. -} - -streams_run() -{ - run_stream 3 "streams_O3_${to_tuned_setting}.out" -} - -tools_git=https://github.com/redhat-performance/test_tools-wrappers -usage() -{ - echo Usage ${1}: - echo "--cache_multiply : Multiply cache sizes by . Default is 2" - echo "--cache_start_factor : Start the cache size at base cache * " - echo " Default is 1" - echo "--cache_cap_size : Caps the size of cache to this value. Default is no cap." - echo "--nsizes : Maximum number of cache sizes to do. Default is 4" - echo "--opt2 : If value is not 0, then we will run with optimization level" - echo " 2. Default value is 1" - echo "--opt3 : If value is not 0, then we will run with optimization level" - echo " 3. Default value is 1" - echo "--result_dir : Directory to place results into. Default is" - echo " results_streams_tuned__" - echo "--size_list : List of array sizes in byte" - echo "--threads_multiple : Multiply number threads by . Default is 2" - echo "--tools_git : git repo to retrieve the required tools from, default is ${tools_git}" - source test_tools/general_setup --usage -} - - -# -# Clone the repo that contains the common code and tools -# -show_usage=0 -found=0 -for arg in "$@"; do - if [ $found -eq 1 ]; then - tools_git=$arg - break; - fi - if [[ $arg == "--tools_git" ]]; then - found=1 - fi - - # - # Check to see if usage is requested, if so call usage. - # We do this so we do not pull in the common git. - # - if [[ $arg == "--usage" ]]; then - show_usage=1 - fi -done - -if [ ! -d "test_tools" ]; then - git clone $tools_git test_tools - if [ $? -ne 0 ]; then - echo pulling git $tools_git failed. - exit 1 - fi -else - echo Found an existing test_tools directory, using it. -fi - -if [ $show_usage -eq 1 ]; then - usage $0 -fi - -# -# Variables set -# -# TOOLS_BIN: points to the tool directory -# 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 -# to_sysname: name of the system -# to_tuned_setting: tuned setting -# - -${curdir}/test_tools/gather_data ${curdir} -source test_tools/general_setup "$@" - -if [ ! -f "/tmp/${test_name}.out" ]; then - ${TOOLS_BIN}/invoke_test --test_name ${test_name} --command ${0} --options "${arguments}" - exit $? -fi - -# -# Define user options -# -ARGUMENT_LIST=( - "cache_cap_size" - "cache_multiply" - "cache_start_factor" - "mem_offset" - "nsizes" - "numa_iterations" - "numa_streams" - "opt2" - "opt3" - "results_dir" - "size_list" - "threads_multiple" - "tools_git" -) - -# read arguments -opts=$(getopt \ - --longoptions "$(printf "%s:," "${ARGUMENT_LIST[@]}")" \ - --name "$(basename "$0")" \ - --options "h" \ - -- "$@" -) - -# -# If there is an error, bail out. -# -if [ $? -ne 0 ]; then - usage $0 -fi - -eval set --$opts - -while [[ $# -gt 0 ]]; do - case "$1" in - --cache_cap_size) - cache_cap_size=$2 - shift 2 - ;; - --cache_multiply) - cache_multiply=$2 - if [ $cache_multiply -lt 2 ]; then - echo Error: cache multiply by must be greater then 1. - exit 1 - fi - shift 2 - ;; - --cache_start_factor) - cache_start_factor=$2 - if [ $cache_start_factor -lt 1 ]; then - echo Error: cache start factor must be greater then 0. - exit 1 - fi - shift 2 - ;; - --mem_offset) - mem_offset=${2} - shift 2 - ;; - --nsizes) - nsizes=${2} - shift 2 - ;; - --numa_iterations) - numa_iterations=${2} - shift 2 - ;; - --opt2) - opt_two=${2} - shift 2 - ;; - --opt3) - opt_three=${2} - shift 2 - ;; - --results_dir) - results_dir=${2} - shift 2 - ;; - --size_list) - size_list=$2 - shift 2 - ;; - --threads_multiple) - threads_multiple=${2} - if [ $threads_multiple -lt 2 ]; then - echo Error: threads_multiple must be greater then 1. - exit 1 - fi - shift 2 - ;; - --tools_git) - # - # ignore, already handled. - # - shift 2 - ;; - -h) - usage "0" - shift 1 - ;; - --) - break - ;; - *) - echo "not found $1" - usage "0" - ;; - 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 -fi -exit 0 From 0db436bf1514c04b7ed5146835ae8d7361d1ba0d Mon Sep 17 00:00:00 2001 From: David Valin Date: Wed, 10 Sep 2025 08:57:37 -0400 Subject: [PATCH 2/8] Add comment saying numa streams test is comming from phoronix. --- numa_streams/numa_streams_extra/run_numa_stream | 3 +++ 1 file changed, 3 insertions(+) diff --git a/numa_streams/numa_streams_extra/run_numa_stream b/numa_streams/numa_streams_extra/run_numa_stream index 0c7fc7b..3410d51 100755 --- a/numa_streams/numa_streams_extra/run_numa_stream +++ b/numa_streams/numa_streams_extra/run_numa_stream @@ -205,6 +205,9 @@ install_numa_streams() 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 From 34d6efbde460f44a6605fdef21181de6a711b2be Mon Sep 17 00:00:00 2001 From: David Valin Date: Wed, 10 Sep 2025 09:01:14 -0400 Subject: [PATCH 3/8] Remove pushd/popd messages --- numa_streams/numa_streams_extra/run_numa_stream | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/numa_streams/numa_streams_extra/run_numa_stream b/numa_streams/numa_streams_extra/run_numa_stream index 3410d51..1a1fa44 100755 --- a/numa_streams/numa_streams_extra/run_numa_stream +++ b/numa_streams/numa_streams_extra/run_numa_stream @@ -196,11 +196,11 @@ 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 From fcd2deb7f093f8486638102b367970bcbc8a66ed Mon Sep 17 00:00:00 2001 From: David Valin Date: Thu, 11 Sep 2025 05:27:40 -0400 Subject: [PATCH 4/8] Remove pbench --- numa_streams/numa_streams_run | 61 ++++++++++++++++------------------- 1 file changed, 27 insertions(+), 34 deletions(-) diff --git a/numa_streams/numa_streams_run b/numa_streams/numa_streams_run index c18ef3b..c5a67f5 100755 --- a/numa_streams/numa_streams_run +++ b/numa_streams/numa_streams_run @@ -353,9 +353,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 # to_sysname: name of the system @@ -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 +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 exit 0 From e449f46f13aab8ccbfa94be5f4c0f087d84919f6 Mon Sep 17 00:00:00 2001 From: David Valin Date: Thu, 11 Sep 2025 05:29:58 -0400 Subject: [PATCH 5/8] Fix so we are getting the proper output. --- numa_streams/numa_streams_run | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/numa_streams/numa_streams_run b/numa_streams/numa_streams_run index c5a67f5..4cd8653 100755 --- a/numa_streams/numa_streams_run +++ b/numa_streams/numa_streams_run @@ -93,7 +93,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; @@ -242,7 +242,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 } # @@ -259,15 +259,15 @@ set_up_test() 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 + if [ -d /tmp/numa_streams_results ]; then + rm -rf /tmp/numa_streams_results 2> /dev/null fi - mkdir /tmp/streams_results + mkdir /tmp/numa_streams_results # # Setup the run script # - cp $run_dir/numa_streams_extra/run_numa_stream $run_dir + cp $run_dir/numa_numa_streams_extra/run_numa_stream $run_dir chmod 755 $run_dir/run_numa_stream } @@ -277,14 +277,14 @@ 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 + ./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/numa_streams_results/${2}_opt_${1} + mv ${results_dir}_* /tmp/numa_streams_results cd .. } 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 @@ -353,6 +353,7 @@ fi # to_home_root: home directory # to_configuration: configuration information # to_times_to_run: number of times to run the test +# 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 # to_sysname: name of the system @@ -486,7 +487,7 @@ streams_run wdir=`pwd` cd /tmp if [[ $results_dir == "" ]]; then - results_dir=results_numa_streams_${tuned_setting}_$(date "+%Y.%m.%d-%H.%M.%S") + 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} @@ -495,18 +496,14 @@ else mkdir ${results_dir} cp /tmp/results_numa_streams/* $results_dir fi -${curdir}/test_tools/move_data $curdir $results_dir +#${curdir}/test_tools/move_data $curdir $results_dir # # report the results # pushd $results_dir > /dev/null -mv /tmp/streams.out . +mv /tmp/${test_name}.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 +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 exit 0 From b36104b68f2d50f79987e7890d03858a463b1595 Mon Sep 17 00:00:00 2001 From: David Valin Date: Thu, 11 Sep 2025 14:51:39 -0400 Subject: [PATCH 6/8] Add pcp support. --- .../numa_streams_extra/run_numa_stream | 32 ++++++++++++++++-- numa_streams/numa_streams_run | 33 ++++++++++--------- 2 files changed, 48 insertions(+), 17 deletions(-) diff --git a/numa_streams/numa_streams_extra/run_numa_stream b/numa_streams/numa_streams_extra/run_numa_stream index 1a1fa44..7526f77 100755 --- a/numa_streams/numa_streams_extra/run_numa_stream +++ b/numa_streams/numa_streams_extra/run_numa_stream @@ -36,6 +36,8 @@ cpus_per_node="" cache_cap_size=0 host=`hostname` size_list="0" +pcp=0 +pcpdir="" # # Define options @@ -50,6 +52,7 @@ ARGUMENT_LIST=( "numa_iterations" "numb_sizes" "optimize_lvl" + "pcp" "results_dir" "size_list" "strides" @@ -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} @@ -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() { @@ -251,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 } @@ -269,6 +291,10 @@ run_numa_streams() cpus=`cat /proc/cpuinfo | grep processor | wc -l` threads=1 + if [[ $pcp -eq 1 ]]; then + echo "Start PCP" + start_pcp ${pcpdir}/ streams $pcp_cfg + fi while [ $threads -lt $cpus ] do echo create_numa_cache_list $threads >> /root/debug_dups @@ -276,13 +302,15 @@ run_numa_streams() 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 diff --git a/numa_streams/numa_streams_run b/numa_streams/numa_streams_run index 4cd8653..9abf323 100755 --- a/numa_streams/numa_streams_run +++ b/numa_streams/numa_streams_run @@ -19,6 +19,8 @@ mem_offset=0 numa_iterations=10 arguments="$@" +pcp="" +pdir="" curdir=`pwd` if [[ $0 == "./"* ]]; then @@ -256,18 +258,14 @@ 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/numa_streams_results ]; then - rm -rf /tmp/numa_streams_results 2> /dev/null - fi + rm -f /$run_dir/run_numa_stream + rm -rf /tmp/numa_streams_results mkdir /tmp/numa_streams_results # # Setup the run script # - cp $run_dir/numa_numa_streams_extra/run_numa_stream $run_dir + cp $run_dir/numa_streams_extra/run_numa_stream $run_dir chmod 755 $run_dir/run_numa_stream } @@ -276,13 +274,13 @@ 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/numa_streams_results/${2}_opt_${1} + 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 - cd .. + popd > /dev/null } -streams_run() +numa_streams_run() { run_numa_stream 3 "numa_streams_O3_${to_tuned_setting}.out" } @@ -362,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}" @@ -483,7 +482,13 @@ while [[ $# -gt 0 ]]; do done set_up_test -streams_run + +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 @@ -496,14 +501,12 @@ 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/${test_name}.out . -mv /tmp/test_results_report . 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 +${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 From 699ea20b3fa84609a486f7e3b898ceb3c0e4e287 Mon Sep 17 00:00:00 2001 From: David Valin Date: Fri, 12 Sep 2025 05:27:06 -0400 Subject: [PATCH 7/8] Change pcp name from streams to numa_streams --- numa_streams/numa_streams_extra/run_numa_stream | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/numa_streams/numa_streams_extra/run_numa_stream b/numa_streams/numa_streams_extra/run_numa_stream index 7526f77..b63fba4 100755 --- a/numa_streams/numa_streams_extra/run_numa_stream +++ b/numa_streams/numa_streams_extra/run_numa_stream @@ -293,7 +293,7 @@ run_numa_streams() if [[ $pcp -eq 1 ]]; then echo "Start PCP" - start_pcp ${pcpdir}/ streams $pcp_cfg + start_pcp ${pcpdir}/ numa_streams $pcp_cfg fi while [ $threads -lt $cpus ] do From 12efa04b49b2fd1dd79b9e395b7c0ddf0d538455 Mon Sep 17 00:00:00 2001 From: David Valin Date: Wed, 17 Sep 2025 10:17:56 -0400 Subject: [PATCH 8/8] Update doc on where are getting the test from --- numa_streams/numa_streams_extra/run_numa_stream | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/numa_streams/numa_streams_extra/run_numa_stream b/numa_streams/numa_streams_extra/run_numa_stream index b63fba4..69c8c44 100755 --- a/numa_streams/numa_streams_extra/run_numa_stream +++ b/numa_streams/numa_streams_extra/run_numa_stream @@ -218,7 +218,7 @@ install_numa_streams() touch /opt/AMD/setenv_AOCC.sh # - # We are getting the test from the phoronix git. + # We are getting the test from phoronix. # wget http://www.phoronix-test-suite.com/benchmark-files/amd-stream-dynamic-1.tar.xz