Skip to content

Commit dc1a795

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

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

benchmark/librbdfio.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,18 @@ def run_workloads(self):
172172
enable_monitor = bool(test['monitor'])
173173
# TODO: simplify this loop to have a single iterator for general queu depth
174174
for job in test['numjobs']:
175-
for iod in test['iodepth']:
175+
iodepth: list[str] = []
176+
use_total_iodepth: bool = False
177+
if "total_iodepth" in test.keys():
178+
iodepth = test["total_iodepth"]
179+
use_total_iodepth = True
180+
else:
181+
iodepth = test["iodepth"]
182+
for iod in iodepth:
183+
if use_total_iodepth:
184+
self._ioddepth_per_volume = self._calculate_iodepth_per_volume(
185+
int(self.volumes_per_client), int(iod)
186+
)
176187
self.mode = test['mode']
177188
if 'op_size' in test:
178189
self.op_size = test['op_size']
@@ -183,7 +194,10 @@ def run_workloads(self):
183194
f'iodepth-{int(self.iodepth):03d}/numjobs-{int(self.numjobs):03d}' )
184195
common.make_remote_dir(self.run_dir)
185196

186-
for i in range(self.volumes_per_client):
197+
number_of_volumes: int = int(self.volumes_per_client)
198+
if use_total_iodepth:
199+
number_of_volumes = len(self._ioddepth_per_volume.keys())
200+
for i in range(number_of_volumes):
187201
fio_cmd = self.mkfiocmd(i)
188202
p = common.pdsh(settings.getnodes('clients'), fio_cmd)
189203
ps.append(p)
@@ -235,7 +249,10 @@ def run(self):
235249
monitoring.start(self.run_dir)
236250
logger.info('Running rbd fio %s test.', self.mode)
237251
ps = []
238-
for i in range(self.volumes_per_client):
252+
number_of_volumes: int = int(self.volumes_per_client)
253+
if self._ioddepth_per_volume != {}:
254+
number_of_volumes = len(self._ioddepth_per_volume.keys())
255+
for i in range(number_of_volumes):
239256
fio_cmd = self.mkfiocmd(i)
240257
p = common.pdsh(settings.getnodes('clients'), fio_cmd)
241258
ps.append(p)
@@ -436,7 +453,6 @@ def _calculate_iodepth_per_volume(self, number_of_volumes: int, total_desired_io
436453
"Number of volumes per client will be reduced from %s to %s", number_of_volumes, total_desired_iodepth
437454
)
438455
number_of_volumes = total_desired_iodepth
439-
self.volumes_per_client = number_of_volumes
440456

441457
iodepth_per_volume: int = total_desired_iodepth // number_of_volumes
442458
remainder: int = total_desired_iodepth % number_of_volumes

0 commit comments

Comments
 (0)