def non_interactive_mode(filename, title):
    global hosts
    total_runtime = 0
    name = "undefined"
    bench_all = {}

    bench_all['title'] = title

    job = yaml.load(file(filename, 'r'))
    if job['name'] is None:
        HP.logger.error("Missing name parameter in yaml file")
        disconnect_clients()
        return
    else:
        name = job['name']

    if job['required-hosts'] is None:
        HP.logger.error("Missing required-hosts parameter in yaml file")
        disconnect_clients()
        return

    bench_all['required-hosts'] = int(job['required-hosts'])
    if bench_all['required-hosts'] < 1:
        HP.logger.error("required-hosts shall be greater than 0")
        disconnect_clients()
        return

    bench_all['runtime'] = get_default_value(job, 'runtime', 10)
    bench_all['required-hypervisors'] = get_default_value(job, 'required-hypervisors', 0)

    log_dir = prepare_log_dir(name)

    # Saving original yaml file
    shutil.copy2(filename, log_dir)
    if (int(bench_all['required-hypervisors']) > 0):
        HP.logger.info("Expecting %d hosts on %d hypervisors to start job %s" %
                       (bench_all['required-hosts'], int(bench_all['required-hypervisors']),
                           name))
    else:
        HP.logger.info("Expecting %d hosts to start job %s" %
                       (bench_all['required-hosts'], name))
    hosts_count = len(hosts.keys())
    previous_hosts_count = hosts_count
    while (int(hosts_count) < bench_all['required-hosts']):
        if (hosts_count != previous_hosts_count):
            HP.logger.info("Still %d hosts to connect" % (bench_all['required-hosts'] - int(hosts_count)))
            previous_hosts_count = hosts_count
            dump_hosts(log_dir)
        hosts_count = len(hosts.keys())
        time.sleep(1)

    dump_hosts(log_dir)

    if len(compute_affinity()) < int(bench_all['required-hypervisors']):
        HP.logger.error("%d hypervisors expected but only %d found" % (bench_all['required-hypervisors'], len(compute_affinity())))
        HP.logger.error("Please adjust 'required-hypervisors' option")
        HP.logger.error("Exiting")
        disconnect_clients()
        return

    HP.logger.info("Starting %s" % name)
    for next_job in job['jobs']:
        HP.logger.info("Starting job %s" % next_job)
        global results_network
        global results_cpu
        global results_memory
        global results_storage
        results_network = {}
        results_cpu = {}
        results_memory = {}
        results_storage = {}
        current_job = job['jobs'][next_job]
        current_job['name'] = next_job
        if 'component' not in current_job.keys():
            HP.logger.error("Missing component in job %s, canceling job" % current_job['name'])
            continue
        if "cpu" in current_job['component']:
                do_cpu_job(bench_all, current_job, log_dir, total_runtime)
        if "memory" in current_job['component']:
                do_memory_job(bench_all, current_job, log_dir, total_runtime)
        if "network" in current_job['component']:
                do_network_job(bench_all, current_job, log_dir, total_runtime)
        if "storage" in current_job['component']:
                do_storage_job(bench_all, current_job, log_dir, total_runtime)

    HP.logger.info("End of %s" % name)
    HP.logger.info(log_dir % "Results are available here : %s")
    disconnect_clients()
dataset/ETHPy150Open redhat-cip/edeploy/src/health-server.py/non_interactive_mode/swapped operands of `%`