Пример #1
0
    def test_remote_blocking(self):
        res = cpp.mpcp_bounds(self.rsi, False)

        self.assertEqual(0, res.get_remote_count(3))
        self.assertEqual(0, res.get_remote_blocking(3))

        self.assertEqual(0, res.get_blocking_count(3))
        self.assertEqual(0, res.get_blocking_term(3))

        self.assertEqual(7, res.get_remote_blocking(0))
        self.assertEqual(7, res.get_blocking_term(0))

        self.assertEqual(1 * 7 + (2 + 1) * 3, res.get_remote_blocking(1))
        self.assertEqual(1 * 7 + (2 + 1) * 3, res.get_blocking_term(1))

        self.assertEqual((2 + 1) * 3 + (1 + 1) * 5, res.get_remote_blocking(2))
        self.assertEqual((2 + 1) * 3 + (1 + 1) * 5, res.get_blocking_term(2))
Пример #2
0
def apply_mpcp_bounds(all_tasks, use_virtual_spin=False):
    model = get_cpp_model(all_tasks)
    res = cpp.mpcp_bounds(model, use_virtual_spin)

    if use_virtual_spin:
        for i, t in enumerate(all_tasks):
            # no suspension time
            t.suspended = 0
            # all blocking, including arrival blocking
            t.blocked = res.get_blocking_term(i)
            # remote blocking increases CPU demand (s-oblivious)
            t.cost += res.get_remote_blocking(i)
    else:
        for i, t in enumerate(all_tasks):
            # remote blocking <=> suspension time
            t.suspended = res.get_remote_blocking(i)
            # all blocking, including arrival blocking
            t.blocked = res.get_blocking_term(i)
Пример #3
0
def apply_mpcp_bounds(all_tasks, use_virtual_spin=False):
    model = get_cpp_model(all_tasks)
    res = cpp.mpcp_bounds(model, use_virtual_spin)

    if use_virtual_spin:
        for i, t in enumerate(all_tasks):
            # no suspension time
            t.suspended = 0
            # all blocking, including arrival blocking
            t.blocked = res.get_blocking_term(i)
            # remote blocking increases CPU demand (s-oblivious)
            t.cost += res.get_remote_blocking(i)
    else:
        for i, t in enumerate(all_tasks):
            # remote blocking <=> suspension time
            t.suspended = res.get_remote_blocking(i)
            # all blocking, including arrival blocking
            t.blocked = res.get_blocking_term(i)
            t.locally_blocked = res.get_local_blocking(i)

    return res