示例#1
0
if __name__ == '__main__':
    nruns = 10
    ncodes = 2
    max_procs = 4
    max_nodes = None
    processes_per_node = None
    timeout = 10
    kill_on_partial_failure = False
    if len(sys.argv) > 1:
        nruns = int(sys.argv[1])
    if len(sys.argv) > 2:
        ncodes = int(sys.argv[2])
    if len(sys.argv) > 3:
        max_procs = int(sys.argv[3])
    if len(sys.argv) > 4:
        timeout = int(sys.argv[4])
    if len(sys.argv) > 5:
        max_nodes = max_procs
        max_procs = None
        processes_per_node = int(sys.argv[5])
    if len(sys.argv) > 6:
        kill_on_partial_failure = True

    extra_env = dict(BAD_ENV_TYPE=10)
    p = run_workflow(nruns, ncodes, max_procs, max_nodes, processes_per_node,
                     timeout, kill_on_partial_failure, extra_env=extra_env)
    p.wait()
    with open(STATUS_FILE) as f:
        print(f.read())
#!/usr/bin/env python3

from common_workflow import run_workflow, STATUS_FILE

if __name__ == '__main__':
    nruns = 10
    ncodes = 2
    max_procs = 4
    max_nodes = None
    processes_per_node = None
    timeout = 5
    kill_on_partial_failure = False

    p = run_workflow(nruns,
                     ncodes,
                     max_procs,
                     max_nodes,
                     processes_per_node,
                     timeout,
                     kill_on_partial_failure,
                     test_script='test-children.sh',
                     test_script_args=['4'],
                     sleep_after=[5, 0])
    p.wait()
    with open(STATUS_FILE) as f:
        print(f.read())
#!/usr/bin/env python3

from common_workflow import run_workflow, STATUS_FILE

if __name__ == '__main__':
    nruns = 10
    ncodes = 2
    max_procs = 4
    max_nodes = None
    processes_per_node = None
    timeout = 10
    kill_on_partial_failure = True

    p = run_workflow(nruns,
                     ncodes,
                     max_procs,
                     max_nodes,
                     processes_per_node,
                     timeout,
                     kill_on_partial_failure,
                     test_script='test-immediate-fail.sh',
                     sleep_after=[5, 0])
    p.wait()
    with open(STATUS_FILE) as f:
        print(f.read())
from common_workflow import run_workflow, STATUS_FILE, LOG_FILE


if __name__ == '__main__':
    nruns = 10
    ncodes = 3
    max_procs = None
    max_nodes = 4
    processes_per_node = 16
    # 4 * 16 = 64 total procs available, but with node exclusive, they
    # can't all necessarily be used. In this case, the first code needs
    # only one proc but still takes one node, second code takes two, and
    # thrid code also requires two, so 5 nodes are required and only 4
    # are allowed.
    codes_nprocs = [1, 32, 17]
    timeout = 20
    kill_on_partial_failure = False

    p = run_workflow(nruns, ncodes, max_procs, max_nodes, processes_per_node,
                     timeout, kill_on_partial_failure,
                     codes_nprocs=codes_nprocs)
    p.wait()

    with open(STATUS_FILE) as f:
        print("STATUS")
        print(f.read())

    with open(LOG_FILE) as f:
        print("LOG")
        print(f.read())