def do_cpu_job(bench_all, current_job, log_dir, total_runtime):
    bench = dict(bench_all)

    if parse_job_config(bench, current_job, HM.CPU, log_dir) is True:
        nb_loops = 0
        hosts_series = compute_nb_hosts_series(bench)
        for nb_hosts in hosts_series:
            nb_loops = nb_loops + 1
            iter_bench = dict(bench)
            iter_bench['cores'] = get_default_value(current_job, 'cores', 1)
            iter_bench['nb-hosts'] = nb_hosts
            total_runtime += iter_bench['runtime']

            iter_bench['hosts-list'] = get_hosts_list_from_affinity(iter_bench)

            if (len(iter_bench['hosts-list']) < iter_bench['nb-hosts']):
                HP.logger.error((iter_bench['nb-hosts'], len(iter_bench['hosts-list'])) % "CPU: %d hosts expected while affinity only provides %d hosts available")
                HP.logger.error("CPU: Canceling test %d / %d" % ((iter_bench['nb-hosts'], iter_bench['max_hosts'])))
                continue

            HP.logger.info("CPU: Waiting bench %d / %d"
                           " to finish on %d hosts (step = %d): should take"
                           " %d seconds" % (nb_loops, len(hosts_series),
                                            iter_bench['nb-hosts'], iter_bench['step-hosts'],
                                            iter_bench['runtime']))

            metrics_log_dir = prepare_metrics(log_dir, iter_bench, HM.CPU)

            init_jitter()

            start_cpu_bench(iter_bench)

            time.sleep(bench['runtime'])

            while (get_host_list(CPU_RUN).keys()):
                time.sleep(1)

            disable_jitter()

            compute_metrics(metrics_log_dir, iter_bench, HM.CPU)
    else:
        HP.logger.error("CPU: Canceling Test")
dataset/ETHPy150Open redhat-cip/edeploy/src/health-server.py/do_cpu_job/swapped operands of `%`