Skip to content

Commit 1510b6b

Browse files
author
Chris Harris
committed
Workload fixes for total_iodepth
Signed-off-by: CHris Harris(harriscr@uk.ibm.com)
1 parent 7892fa9 commit 1510b6b

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

benchmark/librbdfio.py

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ def backup_global_fio_options(self):
110110
self.global_fio_options['op_size'] = self.op_size
111111

112112

113+
113114
def restore_global_fio_options(self):
114115
"""
115116
Restore the global values that are set before each workload
@@ -172,7 +173,18 @@ def run_workloads(self):
172173
enable_monitor = bool(test['monitor'])
173174
# TODO: simplify this loop to have a single iterator for general queu depth
174175
for job in test['numjobs']:
175-
for iod in test['iodepth']:
176+
iodepth: list[str] = []
177+
use_total_iodepth: bool = False
178+
if "total_iodepth" in test.keys():
179+
iodepth = test["total_iodepth"]
180+
use_total_iodepth = True
181+
else:
182+
iodepth = test["iodepth"]
183+
for iod in iodepth:
184+
if use_total_iodepth:
185+
self._ioddepth_per_volume = self._calculate_iodepth_per_volume(
186+
int(self.volumes_per_client), int(iod)
187+
)
176188
self.mode = test['mode']
177189
if 'op_size' in test:
178190
self.op_size = test['op_size']
@@ -183,7 +195,10 @@ def run_workloads(self):
183195
f'iodepth-{int(self.iodepth):03d}/numjobs-{int(self.numjobs):03d}' )
184196
common.make_remote_dir(self.run_dir)
185197

186-
for i in range(self.volumes_per_client):
198+
number_of_volumes: int = int(self.volumes_per_client)
199+
if use_total_iodepth:
200+
number_of_volumes = len(self._ioddepth_per_volume.keys())
201+
for i in range(number_of_volumes):
187202
fio_cmd = self.mkfiocmd(i)
188203
p = common.pdsh(settings.getnodes('clients'), fio_cmd)
189204
ps.append(p)
@@ -235,7 +250,10 @@ def run(self):
235250
monitoring.start(self.run_dir)
236251
logger.info('Running rbd fio %s test.', self.mode)
237252
ps = []
238-
for i in range(self.volumes_per_client):
253+
number_of_volumes: int = int(self.volumes_per_client)
254+
if self._ioddepth_per_volume is not {}:
255+
number_of_volumes = len(self._ioddepth_per_volume.keys())
256+
for i in range(number_of_volumes):
239257
fio_cmd = self.mkfiocmd(i)
240258
p = common.pdsh(settings.getnodes('clients'), fio_cmd)
241259
ps.append(p)
@@ -436,7 +454,6 @@ def _calculate_iodepth_per_volume(self, number_of_volumes: int, total_desired_io
436454
"Number of volumes per client will be reduced from %s to %s", number_of_volumes, total_desired_iodepth
437455
)
438456
number_of_volumes = total_desired_iodepth
439-
self.volumes_per_client = number_of_volumes
440457

441458
iodepth_per_volume: int = total_desired_iodepth // number_of_volumes
442459
remainder: int = total_desired_iodepth % number_of_volumes

0 commit comments

Comments
 (0)