Skip to content

Commit

Permalink
DAOS-16446 test: HDF5-VOL test - Set object class and container prope… (
Browse files Browse the repository at this point in the history
#15004) (#15098)

In HDF5, DFS, MPIIO, or POSIX, object class and container properties are defined
during the container create. If it’s DFS, object class is also set to the IOR
parameter. However, in HDF5-VOL, object class and container properties are
defined with the following environment variables of mpirun.

HDF5_DAOS_OBJ_CLASS (Object class)
HDF5_DAOS_FILE_PROP (Container properties)

The infrastructure to set these variables are already there in run_ior_with_pool().
In file_count_test_base.py, pass in the env vars to run_ior_with_pool(env=env) as a
dictionary. Object class is the oclass variable. Container properties can be
obtained from self.container.properties.value.

This fix is discussed in PR #14964.

Signed-off-by: Makito Kano <[email protected]>
  • Loading branch information
shimizukko authored Oct 16, 2024
1 parent 76cfb41 commit b4eb689
Showing 1 changed file with 22 additions and 9 deletions.
31 changes: 22 additions & 9 deletions src/tests/ftest/util/file_count_test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ class FileCountTestBase(IorTestBase, MdtestBase):
:avocado: recursive
"""

def add_containers(self, file_oclass=None, dir_oclass=None):
"""Create a list of containers that the various jobs use for storage.
def get_file_write_container(self, file_oclass=None, dir_oclass=None):
"""Create a container, set oclass, dir_oclass, and add rd_fac property based on oclass.
Args:
file_oclass (str, optional): file object class of container.
Defaults to None.
dir_oclass (str, optional): dir object class of container.
Defaults to None.
file_oclass (str, optional): file object class of container. Defaults to None.
dir_oclass (str, optional): dir object class of container. Defaults to None.
Returns:
TestContainer: Created container with oclass, dir_oclass, and rd_fac set.
"""
# Create a container and add it to the overall list of containers
Expand Down Expand Up @@ -92,7 +92,7 @@ def run_file_count(self):
rd_fac = extract_redundancy_factor(oclass)
dir_oclass = self.get_diroclass(rd_fac)
self.mdtest_cmd.dfs_dir_oclass.update(dir_oclass)
self.container = self.add_containers(oclass, dir_oclass)
self.container = self.get_file_write_container(oclass, dir_oclass)
try:
self.processes = mdtest_np
self.ppn = mdtest_ppn
Expand All @@ -111,14 +111,27 @@ def run_file_count(self):
# run ior
self.log.info("=======>>>Starting IOR with %s and %s", api, oclass)
self.ior_cmd.dfs_oclass.update(oclass)
self.container = self.add_containers(oclass)
self.container = self.get_file_write_container(oclass)
self.update_ior_cmd_with_pool(False)
try:
self.processes = ior_np
self.ppn = ior_ppn
if api == 'HDF5-VOL':
# Format the container properties so that it works with HDF5-VOL env var.
# Each entry:value pair needs to be separated by a semicolon. Since we're
# using this in the mpirun command, semicolon would indicate the end of the
# command, so quote the whole thing.
cont_props = self.container.properties.value
cont_props_hdf5_vol = '"' + cont_props.replace(",", ";") + '"'
self.log.info("cont_props_hdf5_vol = %s", cont_props_hdf5_vol)
env = self.ior_cmd.env.copy()
env.update({
"HDF5_DAOS_OBJ_CLASS": oclass,
"HDF5_DAOS_FILE_PROP": cont_props_hdf5_vol
})
self.ior_cmd.api.update('HDF5')
self.run_ior_with_pool(create_pool=False, plugin_path=hdf5_plugin_path)
self.run_ior_with_pool(
create_pool=False, plugin_path=hdf5_plugin_path, env=env)
elif self.ior_cmd.api.value == 'POSIX':
self.run_ior_with_pool(create_pool=False, intercept=intercept)
else:
Expand Down

0 comments on commit b4eb689

Please sign in to comment.