示例#1
0
def test_make_ilp():
    x = theano.tensor.matrix('x')
    y = theano.tensor.matrix('y')
    z = theano.tensor.dot(x, x) + y[:,0].sum() - x*y
    env = theano.FunctionGraph([x, y], [z])
    machine_ids = ["ankaa", "arroyitos"]

    prob, X, S, Cmax = make_ilp(env, machine_ids, dummy_compute_cost,
            dummy_comm_cost, dummy_ability, 100)

    prob.solve()
    assert Cmax.value() == 5
示例#2
0
def test_make_ilp():
    x = theano.tensor.matrix('x')
    y = theano.tensor.matrix('y')
    z = theano.tensor.dot(x, x) + y[:, 0].sum() - x * y
    env = theano.FunctionGraph([x, y], [z])
    machine_ids = ["ankaa", "arroyitos"]

    prob, X, S, Cmax = make_ilp(env, machine_ids, dummy_compute_cost,
                                dummy_comm_cost, dummy_ability, 100)

    prob.solve()
    assert Cmax.value() == 5
示例#3
0
def test_compute_schedule():
    x = theano.tensor.matrix('x')
    y = theano.tensor.matrix('y')
    z = theano.tensor.dot(x, x) + y[:,0].sum() - x*y
    env = theano.FunctionGraph([x, y], [z])
    machine_ids = ["ankaa", "arroyitos"]

    sched = compute_schedule(*make_ilp(env, machine_ids, dummy_compute_cost,
            dummy_comm_cost, dummy_ability, 100))

    # nodes are the jobs
    assert env.apply_nodes == set([job for job, (time, id) in sched])
    times = [time for job, (time, id) in sched]
    # jobs are sorted by time
    assert list(sorted(times)) == times
    # the machine ids match what we put in
    assert all(id in machine_ids for job, (time, id) in sched)
示例#4
0
def test_compute_schedule():
    x = theano.tensor.matrix('x')
    y = theano.tensor.matrix('y')
    z = theano.tensor.dot(x, x) + y[:, 0].sum() - x * y
    env = theano.FunctionGraph([x, y], [z])
    machine_ids = ["ankaa", "arroyitos"]

    sched = compute_schedule(*make_ilp(env, machine_ids, dummy_compute_cost,
                                       dummy_comm_cost, dummy_ability, 100))

    # nodes are the jobs
    assert env.apply_nodes == set([job for job, (time, id) in sched])
    times = [time for job, (time, id) in sched]
    # jobs are sorted by time
    assert list(sorted(times)) == times
    # the machine ids match what we put in
    assert all(id in machine_ids for job, (time, id) in sched)