Add option to designate the build option NTIME#73
Conversation
|
This relates to RPOPC-695 |
Review Summary by QodoAdd --ntimes option to control stream run iterations
WalkthroughsDescription• Add --ntimes option to control NTIMES compile flag • Allows multiple stream runs with best result reporting • Default value set to 100 for consistent benchmarking • Updated documentation and usage information Diagramflowchart LR
A["User Input<br/>--ntimes flag"] --> B["streams_run script<br/>parses argument"]
B --> C["Default: ntimes=100"]
C --> D["run_stream script<br/>receives ntimes value"]
D --> E["Compile with<br/>-DNTIMES flag"]
E --> F["Stream executes<br/>multiple runs"]
F --> G["Reports best result"]
File Changes1. README.md
|
Code Review by Qodo
Context used✅ Tickets:
🎫 Need to increase run time for streams. 1. NTIMES ignored in size_list
|
| 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" |
There was a problem hiding this comment.
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
Description
Adds an option to allow us to designate the NTIME build option. This build option tells the streams code to run x times and provide the best results.
Before/After Comparison
Before: Seeing variations from run to run.
After: If variations are present, use the ntime option to increase NTIME build option. Default is 100.
Clerical Stuff
This closes #55
Relates to JIRA: RPOPC-695
Testing
Verified the --ntime option is impacting the run time of streams
set to 10
real 8m37.110s
user 3m38.759s
sys 0m20.636s
Set to 100
real 15m54.233s
user 31m59.629s
sys 0m20.912s
csv file produced
Array_sizes,8192k,16384k,32768k,65536k,Start_Date,End_Date
Copy,28714,29358,29702,29674,2026-05-08T12:35:19Z,2026-05-08T12:50:57Z
Scale,20639,20342,20140,20086,2026-05-08T12:35:19Z,2026-05-08T12:50:57Z
Add,21829,21834,20361,20427,2026-05-08T12:35:19Z,2026-05-08T12:50:57Z
Triad,21946,21925,20368,20427,2026-05-08T12:35:19Z,2026-05-08T12:50:57Z
Documentation updated.