Skip to content

Commit

Permalink
DAOS-11999 test: adjust ior_test_base to use mpi_type from yaml (#10726)
Browse files Browse the repository at this point in the history
Don't hardcode Mpirun and mpich when calling get_job_manager(),
since those are the defaults.

Signed-off-by: Dalton Bohning <[email protected]>
  • Loading branch information
daltonbohning authored Nov 3, 2022
1 parent 7473f7e commit 8f66edd
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 24 deletions.
10 changes: 4 additions & 6 deletions src/tests/ftest/aggregation/multiple_pool_cont.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/python
"""
(C) Copyright 2021-2022 Intel Corporation.
Expand Down Expand Up @@ -82,8 +81,7 @@ def longrun_aggregation(self, total_pools=1, total_containers_per_pool=1):
start_time = 0
finish_time = 0

job_manager = get_job_manager(self, "Mpirun", None, False, "mpich",
self.get_remaining_time())
job_manager = get_job_manager(self, subprocess=False, timeout=self.get_remaining_time())
# Create requested pools
self.add_pool_qty(total_pools, connect=False)
start_time = time.time()
Expand All @@ -101,7 +99,7 @@ def longrun_aggregation(self, total_pools=1, total_containers_per_pool=1):
self.add_container_qty(total_containers_per_pool, pool)

# Run ior on each container sequentially
for i in [1, 2]:
for idx in [1, 2]:
for container in self.container:
ior_log = "{}_{}_{}_ior1.log".format(self.test_id,
container.pool.uuid,
Expand All @@ -114,8 +112,8 @@ def longrun_aggregation(self, total_pools=1, total_containers_per_pool=1):
self.log.info(result)
except CommandFailure as error:
self.log.info(error)
self.save_free_space(i, storage_index)
self.verify_free_space((i-1), i)
self.save_free_space(idx, storage_index)
self.verify_free_space((idx - 1), idx)

# Enable the aggregation
for pool in self.pool:
Expand Down
6 changes: 3 additions & 3 deletions src/tests/ftest/deployment/network_failure.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ def run_ior_report_error(self, results, job_num, file_name, pool, container,
ior_cmd.test_file.update(testfile)

manager = get_job_manager(
test=self, class_name="Mpirun", job=ior_cmd, subprocess=self.subprocess,
mpi_type="mpich", timeout=timeout)
test=self, job=ior_cmd, subprocess=self.subprocess, timeout=timeout)
manager.assign_hosts(
self.hostlist_clients, self.workdir, self.hostfile_clients_slots)

Expand Down Expand Up @@ -123,7 +122,8 @@ def create_ip_to_host(self):

return ip_to_host

def create_host_to_ranks(self, ip_to_host, system_query_members):
@staticmethod
def create_host_to_ranks(ip_to_host, system_query_members):
"""Create a dictionary of hostname to ranks.
Args:
Expand Down
9 changes: 3 additions & 6 deletions src/tests/ftest/deployment/target_failure.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/python
"""
(C) Copyright 2022 Intel Corporation.
Expand Down Expand Up @@ -45,9 +44,7 @@ def run_ior_report_error(self, results, job_num, file_name, pool, container,
testfile = os.path.join("/", file_name)
ior_cmd.test_file.update(testfile)

manager = get_job_manager(
test=self, class_name="Mpirun", job=ior_cmd, subprocess=self.subprocess,
mpi_type="mpich")
manager = get_job_manager(test=self, job=ior_cmd, subprocess=self.subprocess)
manager.assign_hosts(
self.hostlist_clients, self.workdir, self.hostfile_clients_slots)
ppn = self.params.get("ppn", '/run/ior/client_processes/*')
Expand Down Expand Up @@ -332,9 +329,9 @@ def test_target_failure_parallel(self):
# available storage.
self.pool.append(self.get_pool(namespace="/run/pool_size_ratio_40/*"))
self.pool.append(self.get_pool(namespace="/run/pool_size_ratio_66/*"))
for i in range(2):
for idx in range(2):
self.container.append(
self.get_container(pool=self.pool[i], namespace="/run/container_wo_rf/*"))
self.get_container(pool=self.pool[idx], namespace="/run/container_wo_rf/*"))

# 2. Run IOR with oclass SX on all containers at the same time.
ior_results = {}
Expand Down
2 changes: 1 addition & 1 deletion src/tests/ftest/ior/intercept_verify_data_integrity.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def test_ior_intercept_verify_data(self):
# Add a job manager for each ior command. Use a timeout for the ior command that leaves
# enough time to report the summary of all the threads
job_manager = get_job_manager(
self, "Mpirun", None, False, "mpich", self.get_remaining_time() - 30)
self, subprocess=False, timeout=self.get_remaining_time() - 30)

# Define the parameters that will be used to run an ior command in this thread
thread_manager.add(
Expand Down
5 changes: 3 additions & 2 deletions src/tests/ftest/nvme/enospace.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
import time
import threading

from avocado.core.exceptions import TestFail

from apricot import skipForTicket
from nvme_utils import ServerFillUp
from avocado.core.exceptions import TestFail
from daos_utils import DaosCommand
from job_manager_utils import get_job_manager
from ior_utils import IorCommand, IorMetrics
Expand Down Expand Up @@ -99,7 +100,7 @@ def ior_bg_thread(self):
ior_bg_cmd.test_file.update('/testfile_background')

# Define the job manager for the IOR command
job_manager = get_job_manager(self, "Mpirun", ior_bg_cmd, mpi_type="mpich")
job_manager = get_job_manager(self, job=ior_bg_cmd)

# create container
container = self.get_container(self.pool)
Expand Down
2 changes: 1 addition & 1 deletion src/tests/ftest/nvme/fragmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def ior_runner_thread(self, results):
ior_cmd.flags.update(flags)

# Define the job manager for the IOR command
job_manager = get_job_manager(self, "Mpirun", ior_cmd, mpi_type="mpich")
job_manager = get_job_manager(self, job=ior_cmd)
cont_label = self.cont_label_generator.get_label()
job_manager.job.dfs_cont.update(cont_label)
env = ior_cmd.get_default_env(str(job_manager))
Expand Down
7 changes: 3 additions & 4 deletions src/tests/ftest/nvme/pool_capacity.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/python
"""
(C) Copyright 2020-2022 Intel Corporation.
Expand All @@ -8,14 +7,14 @@
import threading
import uuid
from itertools import product
import queue

from apricot import TestWithServers
from write_host_file import write_host_file
from test_utils_container import TestContainer
from ior_utils import IorCommand
from job_manager_utils import get_job_manager
from exception_utils import CommandFailure
import queue


class NvmePoolCapacity(TestWithServers):
Expand Down Expand Up @@ -76,7 +75,7 @@ def ior_thread(self, pool, oclass, api, test, flags, results):
test[2])] = str(uuid.uuid4())

# Define the job manager for the IOR command
job_manager = get_job_manager(self, "Mpirun", ior_cmd, mpi_type="mpich")
job_manager = get_job_manager(self, job=ior_cmd)
key = "{}{}{}".format(oclass, api, test[2])
job_manager.job.dfs_cont.update(container_info[key])
env = ior_cmd.get_default_env(str(job_manager))
Expand All @@ -87,7 +86,7 @@ def ior_thread(self, pool, oclass, api, test, flags, results):
# run IOR Command
try:
job_manager.run()
except CommandFailure as _error:
except CommandFailure:
results.put("FAIL")

def test_create_delete(self, num_pool=2, num_cont=5, total_count=100,
Expand Down
2 changes: 1 addition & 1 deletion src/tests/ftest/util/ior_test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def get_ior_job_manager_command(self):
JobManager: the mpi job manager object
"""
return get_job_manager(self, "Mpirun", self.ior_cmd, self.subprocess, "mpich")
return get_job_manager(self, job=self.ior_cmd, subprocess=self.subprocess)

def check_subprocess_status(self, operation="write"):
"""Check subprocess status."""
Expand Down

0 comments on commit 8f66edd

Please sign in to comment.