Skip to content

Commit

Permalink
use mpirun instead of clush
Browse files Browse the repository at this point in the history
Test-tag: test_metadata_server_restart
TODO-Test-tag: DaosCoreTestDfuse ObjectMetadata
Skip-unit-tests: true
Skip-fault-injection-test: true

Required-githooks: true

Signed-off-by: Dalton Bohning <[email protected]>
  • Loading branch information
daltonbohning committed May 20, 2024
1 parent 27365f5 commit b244731
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 19 deletions.
36 changes: 20 additions & 16 deletions src/tests/ftest/server/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,21 @@
from thread_manager import ThreadManager


def run_ior_loop(test, manager, loops):
def run_ior_loop(manager, cont_labels):
"""Run IOR multiple times.
Args:
test (Test): the test object
manager (str): mpi job manager command
loops (int): number of times to run IOR
cont_labels (list): container labels to run iteratively with
Returns:
list: a list of CmdResults from each ior command run
"""
results = []
errors = []
for index in range(loops):
cont = test.label_generator.get_label('cont')
manager.job.dfs_cont.update(cont, "ior.dfs_cont")

for index, cont_label in enumerate(cont_labels):
manager.job.dfs_cont.update(cont_label, "ior.dfs_cont")
t_start = time.time()

try:
Expand All @@ -39,15 +36,16 @@ def run_ior_loop(test, manager, loops):
ior_mode = "read" if "-r" in manager.job.flags.value else "write"
errors.append(
"IOR {} Loop {}/{} failed for container {}: {}".format(
ior_mode, index, loops, cont, error))
ior_mode, index, len(cont_labels), manager.job.dfs_cont.value, error))
finally:
t_end = time.time()
ior_cmd_time = t_end - t_start
results.append("ior_cmd_time = {}".format(ior_cmd_time))

if errors:
raise CommandFailure(
"IOR failed in {}/{} loops: {}".format(len(errors), loops, "\n".join(errors)))
"IOR failed in {}/{} loops: {}".format(
len(errors), len(cont_labels), "\n".join(errors)))
return results


Expand Down Expand Up @@ -467,10 +465,17 @@ def test_metadata_server_restart(self):
:avocado: tags=ObjectMetadata,test_metadata_server_restart
"""
self.create_pool()
files_per_thread = 400
files_per_thread = 10 # 400 # DEBUGGING
total_ior_threads = 5

processes = self.params.get("slots", "/run/ior/clientslots/*")
processes = self.params.get("np", "/run/ior/*")

# Generate all labels to be shared between write and read operation
all_cont_labels = []
for thread_index in range(total_ior_threads):
all_cont_labels.append([])
for file_index in range(files_per_thread):
all_cont_labels[-1].append(f'cont_{thread_index}_{file_index}')

# Launch threads to run IOR to write data, restart the agents and
# servers, and then run IOR to read the data
Expand All @@ -483,12 +488,11 @@ def test_metadata_server_restart(self):
# Define the arguments for the run_ior_loop method
ior_cmd = IorCommand()
ior_cmd.get_params(self)
ior_cmd.set_daos_params(self.pool, None)
ior_cmd.flags.value = self.params.get("ior{}flags".format(operation), "/run/ior/*")
ior_cmd.dfs_pool.update(self.pool.identifier)
ior_cmd.flags.update(self.params.get("ior{}flags".format(operation), "/run/ior/*"))

# Define the job manager for the IOR command
self.ior_managers.append(
get_job_manager(self, "Clush", ior_cmd))
self.ior_managers.append(get_job_manager(self, job=ior_cmd))
env = ior_cmd.get_default_env(str(self.ior_managers[-1]))
self.ior_managers[-1].assign_hosts(self.hostlist_clients, self.workdir, None)
self.ior_managers[-1].assign_processes(processes)
Expand All @@ -497,7 +501,7 @@ def test_metadata_server_restart(self):

# Add a thread for these IOR arguments
thread_manager.add(
test=self, manager=self.ior_managers[-1], loops=files_per_thread)
manager=self.ior_managers[-1], cont_labels=all_cont_labels[index])
self.log.info("Created %s thread %s", operation, index)

# Launch the IOR threads
Expand Down
9 changes: 6 additions & 3 deletions src/tests/ftest/server/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,15 @@ container:
control_method: API
silent: true
ior:
clientslots:
slots: 1
np: 1
dfs_destroy: false
iorwriteflags: "-w -W -k -G 1"
iorreadflags: "-r -R -G 1"
dfs_oclass: "SX"
test_file: /testFile
transfer_size: 1K
block_size: 1K
api: DFS
dfs_oclass: SX
metadata:
mean_percent: 1
num_addremove_loops: 4
Expand Down

0 comments on commit b244731

Please sign in to comment.