Skip to content

Commit 7f568b3

Browse files
committed
Update the number of events to process based on the number of threads
1 parent b8e4d0c commit 7f568b3

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

scan

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ if __name__ == "__main__":
4444
min_step = 1 # minimum is 1
4545
max_step = None # None to guess based on the number of available cores (or threads) and concurrent jobs
4646

47-
##############################################################################
47+
events_extra_per_thread = 500 # increase by this amount the number of events per thread
48+
events_limit = 0 # if not 0, limit the total number of events to be processed
4849

4950
# print a system overview
5051
info()
@@ -95,6 +96,14 @@ if __name__ == "__main__":
9596
base = base + '/'
9697
step_opt['logdir'] = base + 'scan_%d' % step
9798

99+
# update the number of events to process based on the number of threads
100+
if events_extra_per_thread > 0:
101+
step_opt['events'] = options['events'] + events_extra_per_thread * step_opt['threads']
102+
103+
if events_limit > 0:
104+
if step_opt['events'] > events_limit:
105+
step_opt['events'] = events_limit
106+
98107
# benchmark reading the input data
99108
if run_io_benchmark:
100109
print('Benchmarking only I/O')

0 commit comments

Comments
 (0)