示例#1
0
    def job_setup(self, job, pool):
        """Create the cmdline needed to launch job.

        Args:
            job(str): single job from test params list of jobs to run
            pool (obj): TestPool obj

        Returns:
            job_cmdlist: list cmdline that can be launched
                         by specified job manager

        """
        job_cmdlist = []
        commands = []
        scripts = []
        nodesperjob = []
        self.log.info("<<Job_Setup %s >> at %s", self.test_name, time.ctime())
        for npj in self.nodesperjob:
            # nodesperjob = -1 indicates to use all nodes in client hostlist
            if npj < 0:
                npj = len(self.hostlist_clients)
            if len(self.hostlist_clients) / npj < 1:
                raise SoakTestError(
                    "<<FAILED: There are only {} client nodes for this job. "
                    "Job requires {}".format(len(self.hostlist_clients), npj))
            nodesperjob.append(npj)
        if "ior" in job:
            for npj in nodesperjob:
                for ppn in self.taskspernode:
                    commands = create_ior_cmdline(self, job, pool, ppn, npj)
                    # scripts are single cmdline
                    scripts = build_job_script(self, commands, job, ppn, npj)
                    job_cmdlist.extend(scripts)
        elif "fio" in job:
            commands = create_fio_cmdline(self, job, pool)
            # scripts are single cmdline
            scripts = build_job_script(self, commands, job, 1, 1)
            job_cmdlist.extend(scripts)
        elif "daos_racer" in job:
            commands = create_racer_cmdline(self, job, pool)
            # scripts are single cmdline
            scripts = build_job_script(self, commands, job, 1, 1)
            job_cmdlist.extend(scripts)
        else:
            raise SoakTestError("<<FAILED: Job {} is not supported. ".format(
                self.job))
        return job_cmdlist
示例#2
0
    def job_setup(self, jobs, pool):
        """Create the cmdline needed to launch job.

        Args:
            jobs(list): list of jobs to run
            pool (obj): TestPool obj

        Returns:
            job_cmdlist: list of sbatch scripts that can be launched
                         by slurm job manager

        """
        job_cmdlist = []
        self.log.info("<<Job_Setup %s >> at %s", self.test_name, time.ctime())
        for job in jobs:
            jobscript = []
            commands = []
            nodesperjob = self.params.get("nodesperjob", "/run/" + job + "/*",
                                          [1])
            taskspernode = self.params.get("taskspernode",
                                           "/run/" + job + "/*", [1])
            for npj in list(nodesperjob):
                # nodesperjob = -1 indicates to use all nodes in client hostlist
                if npj < 0:
                    npj = len(self.hostlist_clients)
                if len(self.hostlist_clients) / npj < 1:
                    raise SoakTestError(
                        "<<FAILED: There are only {} client nodes for this job."
                        " Job requires {}".format(len(self.hostlist_clients),
                                                  npj))
                for ppn in list(taskspernode):
                    if "ior" in job:
                        commands = create_ior_cmdline(self, job, pool, ppn,
                                                      npj)
                    elif "fio" in job:
                        commands = create_fio_cmdline(self, job, pool)
                    elif "mdtest" in job:
                        commands = create_mdtest_cmdline(
                            self, job, pool, ppn, npj)
                    elif "daos_racer" in job:
                        self.add_cancel_ticket("DAOS-7436",
                                               "daos_racer pool issue")
                        # Uncomment the following when DAOS-7436 is fixed
                        # commands = create_racer_cmdline(self, job, pool)
                    else:
                        raise SoakTestError(
                            "<<FAILED: Job {} is not supported. ".format(
                                self.job))
                    jobscript = build_job_script(self, commands, job, npj)
                    job_cmdlist.extend(jobscript)
        return job_cmdlist