Skip to content

Commit 96b21eb

Browse files
authored
Merge pull request #8 from redhat-performance/add_pcp
Add pcp
2 parents f714585 + 12efa04 commit 96b21eb

File tree

4 files changed

+76
-870
lines changed

4 files changed

+76
-870
lines changed

numa_streams/numa_streams_extra/run_numa_stream

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ cpus_per_node=""
3636
cache_cap_size=0
3737
host=`hostname`
3838
size_list="0"
39+
pcp=0
40+
pcpdir=""
3941

4042
#
4143
# Define options
@@ -50,6 +52,7 @@ ARGUMENT_LIST=(
5052
"numa_iterations"
5153
"numb_sizes"
5254
"optimize_lvl"
55+
"pcp"
5356
"results_dir"
5457
"size_list"
5558
"strides"
@@ -111,7 +114,11 @@ while [[ $# -gt 0 ]]; do
111114
optim=${2}
112115
shift 2
113116
;;
114-
117+
--pcp)
118+
pcpdir=${2}
119+
pcp=1
120+
shift 2
121+
;;
115122
--results_dir)
116123
echo setting result dir
117124
resultdir=${2}
@@ -143,6 +150,11 @@ while [[ $# -gt 0 ]]; do
143150
esac
144151
done
145152

153+
if [[ $pcp -eq 1 ]]; then
154+
source $TOOLS_BIN/pcp/pcp_commands.inc
155+
setup_pcp
156+
pcp_cfg=$TOOLS_BIN/pcp/default.cfg
157+
fi
146158

147159
setup_sizing()
148160
{
@@ -196,15 +208,18 @@ install_numa_streams()
196208
{
197209
dnf install wget gcc gcc-c++ autoconf hwloc hwloc-gui libomp -y
198210
git clone https://github.com/jemalloc/jemalloc.git
199-
pushd jemalloc
211+
pushd jemalloc > /dev/null
200212
./autogen.sh
201213
make
202214
make install
203-
popd
215+
popd > /dev/null
204216

205217
mkdir /opt/AMD
206218
touch /opt/AMD/setenv_AOCC.sh
207219

220+
#
221+
# We are getting the test from phoronix.
222+
#
208223
wget http://www.phoronix-test-suite.com/benchmark-files/amd-stream-dynamic-1.tar.xz
209224

210225
tar -xf amd-stream-dynamic-1.tar.xz
@@ -248,7 +263,17 @@ create_numa_cache_list()
248263
cache_size_mb="512 1000 2000 4000"
249264
for cache_size in $cache_size_mb
250265
do
266+
if [[ $pcp -eq 1 ]]; then
267+
start_pcp_subset
268+
fi
251269
run_numa_test $threads $cache_size
270+
if [[ $pcp -eq 1 ]]; then
271+
echo "Send result to PCP archive"
272+
out="${stream_size}_iter_${test_iters}"
273+
result2pcp iteration_${iteration} ${out}
274+
stop_pcp_subset
275+
fi
276+
252277
done
253278
}
254279

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

294+
if [[ $pcp -eq 1 ]]; then
295+
echo "Start PCP"
296+
start_pcp ${pcpdir}/ numa_streams $pcp_cfg
297+
fi
269298
while [ $threads -lt $cpus ]
270299
do
271300
echo create_numa_cache_list $threads >> /root/debug_dups
272301
create_numa_cache_list $threads
273302
threads=`echo "${threads}*2" | bc`
274303
done
275304
create_numa_cache_list $cpus
305+
if [[ $pcp -eq 1 ]]; then
306+
shutdown_pcp
307+
fi
276308

277309
#
278310
# Record highest
279311
#
280312
echo Test:MB/sec > highest.csv
281313

282-
# DJV
283314
record_numa_stream Copy
284315
record_numa_stream Scale
285316
record_numa_stream Add

numa_streams/numa_streams_run

Lines changed: 41 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
mem_offset=0
2020
numa_iterations=10
2121
arguments="$@"
22+
pcp=""
23+
pdir=""
2224

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

248250
#
@@ -256,13 +258,9 @@ set_up_test()
256258
if [[ $results_dir == "" ]]; then
257259
results_dir=results_${test_name}_${to_tuned_setting}_`date +"%Y%m%d%H%M%S"`
258260
fi
259-
if [ -d /$run_dir/run_numa_stream ]; then
260-
rm -rf /$run_dir/run_numa_stream 2> /dev/null
261-
fi
262-
if [ -d /tmp/streams_results ]; then
263-
rm -rf /tmp/streams_results 2> /dev/null
264-
fi
265-
mkdir /tmp/streams_results
261+
rm -f /$run_dir/run_numa_stream
262+
rm -rf /tmp/numa_streams_results
263+
mkdir /tmp/numa_streams_results
266264

267265
#
268266
# Setup the run script
@@ -276,15 +274,15 @@ set_up_test()
276274
#
277275
run_numa_stream()
278276
{
279-
cd $run_dir
280-
./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}
281-
mv ${results_dir}_* /tmp/streams_results
282-
cd ..
277+
pushd $run_dir > /dev/null
278+
./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}
279+
mv ${results_dir}_* /tmp/numa_streams_results
280+
popd > /dev/null
283281
}
284282

285-
streams_run()
283+
numa_streams_run()
286284
{
287-
run_numa_stream 3 "streams_O3_${to_tuned_setting}.out"
285+
run_numa_stream 3 "numa_streams_O3_${to_tuned_setting}.out"
288286
}
289287

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

365361
${curdir}/test_tools/gather_data ${curdir}
366362
source test_tools/general_setup "$@"
363+
export TOOLS_BIN
367364

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

487-
if [ $to_pbench -eq 1 ]; then
488-
$TOOLS_BIN/execute_via_pbench --cmd_executing "$0" $arguments --test $test_name --spacing 11 --pbench_stats $to_pstats
489-
else
490-
set_up_test
491-
streams_run
492-
wdir=`pwd`
493-
cd /tmp
494-
if [[ $results_dir == "" ]]; then
495-
results_dir=results_numa_streams_${tuned_setting}_$(date "+%Y.%m.%d-%H.%M.%S")
496-
rm results_${test_name}_${tuned_setting} 2> /dev/null
497-
mkdir ${results_dir}
498-
ln -s ${results_dir} results_${test_name}_${tuned_setting}
499-
cp /tmp/results_numa_streams/* $results_dir
500-
else
501-
mkdir ${results_dir}
502-
cp /tmp/results_numa_streams/* $results_dir
503-
fi
504-
${curdir}/test_tools/move_data $curdir $results_dir
505-
#
506-
# report the results
507-
#
508-
pushd $results_dir > /dev/null
509-
mv /tmp/streams.out .
510-
mv /tmp/test_results_report .
511-
mv /tmp/numa_results/* .
512-
tar hcf results_${test_name}_${to_tuned_setting}.tar $results_dir
513-
rm -rf results_pbench.tar
514-
popd > /dev/null
515-
tar hcf results_${test_name}_${to_tuned_setting}.tar $results_dir
516-
working_dir=`ls -rtd /tmp/results*${test_name}* | grep -v tar | tail -1`
517-
find $working_dir -type f | tar --transform 's/.*\///g' -cf results_pbench.tar --files-from=/dev/stdin
484+
set_up_test
485+
486+
if [[ $to_use_pcp -eq 1 ]]; then
487+
pdir=/tmp/pcp_`date "+%Y.%m.%d-%H.%M.%S"`
488+
pcp="--pcp ${pdir}"
518489
fi
490+
491+
numa_streams_run
492+
wdir=`pwd`
493+
cd /tmp
494+
if [[ $results_dir == "" ]]; then
495+
results_dir=/tmp/results_numa_streams_${tuned_setting}_$(date "+%Y.%m.%d-%H.%M.%S")
496+
rm results_${test_name}_${tuned_setting} 2> /dev/null
497+
mkdir ${results_dir}
498+
ln -s ${results_dir} results_${test_name}_${tuned_setting}
499+
cp /tmp/results_numa_streams/* $results_dir
500+
else
501+
mkdir ${results_dir}
502+
cp /tmp/results_numa_streams/* $results_dir
503+
fi
504+
#
505+
# report the results
506+
#
507+
pushd $results_dir > /dev/null
508+
mv /tmp/${test_name}.out .
509+
popd > /dev/null
510+
tar hcf /tmp/results_${test_name}_${to_tuned_setting}.tar $results_dir
511+
${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"
519512
exit 0

0 commit comments

Comments
 (0)