Skip to content

Commit b36104b

Browse files
committed
Add pcp support.
1 parent e449f46 commit b36104b

File tree

2 files changed

+48
-17
lines changed

2 files changed

+48
-17
lines changed

numa_streams/numa_streams_extra/run_numa_stream

Lines changed: 30 additions & 2 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
{
@@ -251,7 +263,17 @@ create_numa_cache_list()
251263
cache_size_mb="512 1000 2000 4000"
252264
for cache_size in $cache_size_mb
253265
do
266+
if [[ $pcp -eq 1 ]]; then
267+
start_pcp_subset
268+
fi
254269
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+
255277
done
256278
}
257279

@@ -269,20 +291,26 @@ run_numa_streams()
269291
cpus=`cat /proc/cpuinfo | grep processor | wc -l`
270292
threads=1
271293

294+
if [[ $pcp -eq 1 ]]; then
295+
echo "Start PCP"
296+
start_pcp ${pcpdir}/ streams $pcp_cfg
297+
fi
272298
while [ $threads -lt $cpus ]
273299
do
274300
echo create_numa_cache_list $threads >> /root/debug_dups
275301
create_numa_cache_list $threads
276302
threads=`echo "${threads}*2" | bc`
277303
done
278304
create_numa_cache_list $cpus
305+
if [[ $pcp -eq 1 ]]; then
306+
shutdown_pcp
307+
fi
279308

280309
#
281310
# Record highest
282311
#
283312
echo Test:MB/sec > highest.csv
284313

285-
# DJV
286314
record_numa_stream Copy
287315
record_numa_stream Scale
288316
record_numa_stream Add

numa_streams/numa_streams_run

Lines changed: 18 additions & 15 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
@@ -256,18 +258,14 @@ 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/numa_streams_results ]; then
263-
rm -rf /tmp/numa_streams_results 2> /dev/null
264-
fi
261+
rm -f /$run_dir/run_numa_stream
262+
rm -rf /tmp/numa_streams_results
265263
mkdir /tmp/numa_streams_results
266264

267265
#
268266
# Setup the run script
269267
#
270-
cp $run_dir/numa_numa_streams_extra/run_numa_stream $run_dir
268+
cp $run_dir/numa_streams_extra/run_numa_stream $run_dir
271269
chmod 755 $run_dir/run_numa_stream
272270
}
273271

@@ -276,13 +274,13 @@ 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/numa_streams_results/${2}_opt_${1}
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}
281279
mv ${results_dir}_* /tmp/numa_streams_results
282-
cd ..
280+
popd > /dev/null
283281
}
284282

285-
streams_run()
283+
numa_streams_run()
286284
{
287285
run_numa_stream 3 "numa_streams_O3_${to_tuned_setting}.out"
288286
}
@@ -362,6 +360,7 @@ fi
362360

363361
${curdir}/test_tools/gather_data ${curdir}
364362
source test_tools/general_setup "$@"
363+
export TOOLS_BIN
365364

366365
if [ ! -f "/tmp/${test_name}.out" ]; then
367366
${TOOLS_BIN}/invoke_test --test_name ${test_name} --command ${0} --options "${arguments}"
@@ -483,7 +482,13 @@ while [[ $# -gt 0 ]]; do
483482
done
484483

485484
set_up_test
486-
streams_run
485+
486+
if [[ $to_use_pcp -eq 1 ]]; then
487+
pdir=/tmp/pcp_`date "+%Y.%m.%d-%H.%M.%S"`
488+
pcp="--pcp ${pdir}"
489+
fi
490+
491+
numa_streams_run
487492
wdir=`pwd`
488493
cd /tmp
489494
if [[ $results_dir == "" ]]; then
@@ -496,14 +501,12 @@ else
496501
mkdir ${results_dir}
497502
cp /tmp/results_numa_streams/* $results_dir
498503
fi
499-
#${curdir}/test_tools/move_data $curdir $results_dir
500504
#
501505
# report the results
502506
#
503507
pushd $results_dir > /dev/null
504508
mv /tmp/${test_name}.out .
505-
mv /tmp/test_results_report .
506509
popd > /dev/null
507510
tar hcf /tmp/results_${test_name}_${to_tuned_setting}.tar $results_dir
508-
${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
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"
509512
exit 0

0 commit comments

Comments
 (0)