Exemple #1
0
def test_task_insertion_in_middle():
    dag = {
        9: (10, 11),  # some very high rank tasks which all depend on one
        10: (),  # initial task.
        11: (),
        1: (),  # multiple low rank but cheap tasks
        2: (),
    }

    orders, _ = schedule(dag, 'ab', compcost, zero_commcost)

    print orders
    print find_job_event(2, orders)

    # Both of the cheap tasks (1 and 2) should be done on the second
    # processor while we are waiting for task 9 to finish on the first one
    assert find_job_event(1, orders).end == 3
    assert find_job_event(2, orders).end == 2
Exemple #2
0
def test_task_insertion_in_middle():
    dag = {9: (10, 11), # some very high rank tasks which all depend on one
           10: (),      # initial task.
           11: (),

           1: (), # multiple low rank but cheap tasks
           2: (),
          }

    orders, _ = schedule(dag, 'ab', compcost, zero_commcost)

    print orders
    print find_job_event(2, orders)

    # Both of the cheap tasks (1 and 2) should be done on the second
    # processor while we are waiting for task 9 to finish on the first one
    assert find_job_event(1, orders).end == 3
    assert find_job_event(2, orders).end == 2
Exemple #3
0
def test_task_insertion_at_start():
    dag = {
        9: (10, 11),  # some very high rank tasks which all depend on one
        10: (),  # initial task.
        11: (),
        1: (),  # one low rank but cheap tasks
    }

    orders, _ = schedule(dag, 'ab', compcost, zero_commcost)

    # The cheap task 1 should be done on the spare processor while we are
    # waiting for task 9 to finish on the first one.
    assert find_job_event(1, orders).end == 1
Exemple #4
0
def test_task_insertion_at_start():
    dag = {9: (10, 11), # some very high rank tasks which all depend on one
           10: (),      # initial task.
           11: (),

           1: (), # one low rank but cheap tasks
          }

    orders, _ = schedule(dag, 'ab', compcost, zero_commcost)

    # The cheap task 1 should be done on the spare processor while we are
    # waiting for task 9 to finish on the first one.
    assert find_job_event(1, orders).end == 1