def create_fio_cmdline(self, job_spec, pool): """Create the FOI commandline for job script. Args: job_spec (str): fio job in yaml to run pool (obj): TestPool obj ppn(int): number of tasks to run on each node Returns: cmd(list): list of cmdlines """ commands = [] fio_namespace = "/run/{}".format(job_spec) # test params bs_list = self.params.get("blocksize", fio_namespace + "/soak/*") size_list = self.params.get("size", fio_namespace + "/soak/*") rw_list = self.params.get("rw", fio_namespace + "/soak/*") # Get the parameters for Fio fio_cmd = FioCommand() fio_cmd.namespace = "{}/*".format(fio_namespace) fio_cmd.get_params(self) for blocksize in bs_list: for size in size_list: for rw in rw_list: # update fio params fio_cmd.update("global", "blocksize", blocksize, "fio --name=global --blocksize") fio_cmd.update("global", "size", size, "fio --name=global --size") fio_cmd.update("global", "rw", rw, "fio --name=global --rw") srun_cmds = [] # add srun start dfuse cmds if api is POSIX if fio_cmd.api.value == "POSIX": # Connect to the pool, create container # and then start dfuse dfuse, srun_cmds = self.start_dfuse(pool) # Update the FIO cmdline fio_cmd.update("global", "directory", dfuse.mount_dir.value, "fio --name=global --directory") # add srun and srun params to fio cmline srun_cmds.append( slurm_utils.srun_str(hosts=None, cmd=str(fio_cmd.__str__()), srun_params=None)) # If posix, add the srun dfuse stop cmds if fio_cmd.api.value == "POSIX": srun_cmds.extend(self.stop_dfuse(dfuse)) log_name = "{}_{}_{}".format(blocksize, size, rw) commands.append([srun_cmds, log_name]) self.log.info("<<Fio cmdlines>>:") for cmd in srun_cmds: self.log.info("%s", cmd) return commands
def create_fio_cmdline(self, job_spec, pool): """Create the FOI commandline. Args: job_spec (str): fio job in yaml to run pool (obj): TestPool obj ppn(int): number of tasks to run on each node Returns: cmd(list): list of cmdlines """ commands = [] fio_namespace = "/run/{}".format(job_spec) # test params bs_list = self.params.get("blocksize", fio_namespace + "/soak/*") size_list = self.params.get("size", fio_namespace + "/soak/*") rw_list = self.params.get("rw", fio_namespace + "/soak/*") # Get the parameters for Fio fio_cmd = FioCommand() fio_cmd.namespace = "{}/*".format(fio_namespace) fio_cmd.get_params(self) for blocksize in bs_list: for size in size_list: for rw in rw_list: # update fio params fio_cmd.update( "global", "blocksize", blocksize, "fio --name=global --blocksize") fio_cmd.update( "global", "size", size, "fio --name=global --size") fio_cmd.update( "global", "rw", rw, "fio --name=global --rw") # start dfuse if api is POSIX if fio_cmd.api.value == "POSIX": # Connect to the pool, create container # and then start dfuse self.start_dfuse(pool) fio_cmd.update( "global", "directory", self.dfuse.mount_dir.value, "fio --name=global --directory") # fio command log_name = "{}_{}_{}".format(blocksize, size, rw) commands.append([fio_cmd.__str__(), log_name]) self.log.info( "<<FIO cmdline>>: %s \n", commands[-1]) return commands
def create_fio_cmdline(self, job_spec, pool): """Create the FOI commandline for job script. Args: self (obj): soak obj job_spec (str): fio job in yaml to run pool (obj): TestPool obj ppn(int): number of tasks to run on each node Returns: cmd(list): list of cmdlines """ commands = [] fio_namespace = os.path.join(os.sep, "run", job_spec, "*") fio_soak_namespace = os.path.join(os.sep, "run", job_spec, "soak", "*") # test params bs_list = self.params.get("blocksize", fio_soak_namespace) size_list = self.params.get("size", fio_soak_namespace) rw_list = self.params.get("rw", fio_soak_namespace) oclass_list = self.params.get("oclass", fio_soak_namespace) # Get the parameters for Fio fio_cmd = FioCommand() fio_cmd.namespace = fio_namespace fio_cmd.get_params(self) fio_cmd.aux_path.update(self.test_dir, "aux_path") for blocksize in bs_list: for size in size_list: for rw in rw_list: for o_type in oclass_list: # update fio params fio_cmd.update("global", "blocksize", blocksize, "fio --name=global --blocksize") fio_cmd.update("global", "size", size, "fio --name=global --size") fio_cmd.update("global", "rw", rw, "fio --name=global --rw") srun_cmds = [] # add srun start dfuse cmds if api is POSIX if fio_cmd.api.value == "POSIX": # Connect to the pool, create container # and then start dfuse add_containers(self, pool, o_type) daos_cmd = DaosCommand(self.bin) daos_cmd.container_set_attr(pool.uuid, self.container[-1].uuid, 'dfuse-direct-io-disable', 'on') log_name = "{}_{}_{}_{}_{}".format( job_spec, blocksize, size, rw, o_type) dfuse, srun_cmds = start_dfuse(self, pool, self.container[-1], nodesperjob=1, name=log_name, job_spec=job_spec) # Update the FIO cmdline fio_cmd.update("global", "directory", dfuse.mount_dir.value, "fio --name=global --directory") # add fio cmline srun_cmds.append(str(fio_cmd.__str__())) srun_cmds.append("status=$?") # If posix, add the srun dfuse stop cmds if fio_cmd.api.value == "POSIX": srun_cmds.extend(stop_dfuse(dfuse, nodesperjob=1)) commands.append([srun_cmds, log_name]) self.log.info("<<Fio cmdlines>>:") for cmd in srun_cmds: self.log.info("%s", cmd) return commands