Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ Streams Options:
--cache_start_factor <value>: Start the cache size at base cache * <value>. Default is 1.
--cache_cap_size <value>: Caps the size of cache to this value. Default is no cap (0).
--nsizes <value>: Maximum number of cache sizes to test. Default is 4.
--ntimes <value>: Sets the compile flag NTIMES to value x. The streams run will"
report the best value of the x runs.
--opt2 <value>: If value is not 0, run with O2 optimization level. Default is 1.
--opt3 <value>: If value is not 0, run with O3 optimization level. Default is 1.
--result_dir <string>: Directory to place results into. Default is
Expand Down
7 changes: 6 additions & 1 deletion streams/streams_extra/run_stream
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ ARGUMENT_LIST=(
"cache_start_size"
"host"
"iterations"
"ntimes"
"numb_sizes"
"optimize_lvl"
"pcpdir"
Expand Down Expand Up @@ -94,6 +95,10 @@ while [[ $# -gt 0 ]]; do
iterations=${2}
shift 2
;;
--ntimes)
ntimes=${2}
shift 2
;;
--numb_sizes)
numb_sizes=${2}
shift 2
Expand Down Expand Up @@ -189,7 +194,7 @@ build_images()
continue
fi

CC_CMD="gcc ${MOPT} -fopenmp -mcmodel=large ${optim_opt} -DSTREAM_ARRAY_SIZE=${use_cache} stream_omp_5_10.c -o ${stream} -fno-pic"
CC_CMD="gcc ${MOPT} -fopenmp -mcmodel=large ${optim_opt} -DNTIMES=${ntimes} -DSTREAM_ARRAY_SIZE=${use_cache} stream_omp_5_10.c -o ${stream} -fno-pic"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Ntimes ignored in size_list 🐞 Bug ≡ Correctness

In streams/streams_extra/run_stream, the new -DNTIMES=${ntimes} flag is only used when
size_list=="0"; when a user supplies --size_list, compilation omits NTIMES so --ntimes has no
effect. This breaks the intended behavior for explicit array-size runs and silently falls back to
STREAM’s default NTIMES.
Agent Prompt
### Issue description
`--ntimes` currently only affects compilation when `size_list=="0"`. When `--size_list` is provided, the compilation path omits `-DNTIMES=...`, so the new CLI option is ignored.

### Issue Context
`streams/streams_extra/run_stream` has two compilation paths inside `build_images()`: one for automatic sizing and one for explicit `--size_list`. Only the automatic sizing path applies `-DNTIMES=${ntimes}`.

### Fix Focus Areas
- streams/streams_extra/run_stream[219-235]
- streams/streams_extra/run_stream[197-201]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

echo $CC_CMD >> streams_build_options
$CC_CMD
if [ $? -ne 0 ]; then
Expand Down
13 changes: 11 additions & 2 deletions streams/streams_run
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ array_size=""
streams_wrapper_version=1.0
curdir=`pwd`
start_time=""
ntimes=100

end_time=""
if [[ $0 == "./"* ]]; then
chars=`echo $0 | awk -v RS='/' 'END{print NR-1}'`
Expand Down Expand Up @@ -369,8 +371,8 @@ set_up_test()
run_stream()
{
cd $run_dir
echo ./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} --top_dir $curdir $pcp
./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} --top_dir $curdir > /tmp/streams_results/${2}_opt_${1} $pcp
echo ./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} --top_dir $curdir $pcp --ntimes $ntimes
./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} --top_dir $curdir > /tmp/streams_results/${2}_opt_${1} $pcp --ntimes $ntimes
if [ $? -ne 0 ]; then
echo "Execution of run stream failed."
exit $E_GENERAL
Expand Down Expand Up @@ -398,6 +400,8 @@ usage()
echo " Default is 1"
echo "--cache_cap_size <value>: Caps the size of cache to this value. Default is no cap."
echo "--nsizes <value>: Maximum number of cache sizes to do. Default is 4"
echo "--ntimes <value>: Sets the compile flag NTIMES to value x. The streams run will"
echo " report the best value of the x runs. Default value is 100"
echo "--opt2 <value>: If value is not 0, then we will run with optimization level"
echo " 2. Default value is 1"
echo "--opt3 <value>: If value is not 0, then we will run with optimization level"
Expand Down Expand Up @@ -479,6 +483,7 @@ ARGUMENT_LIST=(
"cache_multiply"
"cache_start_factor"
"nsizes"
"ntimes"
"opt2"
"opt3"
"results_dir"
Expand Down Expand Up @@ -530,6 +535,10 @@ while [[ $# -gt 0 ]]; do
nsizes=${2}
shift 2
;;
--ntimes)
ntimes=${2}
shift 2
;;
--opt2)
opt_two=${2}
shift 2
Expand Down
Loading