Peano
Loading...
Searching...
No Matches
test_task_groups.py
Go to the documentation of this file.
1from peano4.api.solversteps import SynchroniseActionSets, get_task_groups
2
3
5 def __init__(self, name, parallel):
6 self.name = name
7 self.parallel = parallel
8
9
10def _names(groups):
11 return [[action_set.name for action_set in group] for group in groups]
12
13
15 v = [_FakeActionSet(f"v{i}", parallel) for i, parallel in enumerate([True, True, False, True, True], start=1)]
16 assert _names(get_task_groups(v)) == [["v1", "v2"], ["v3"], ["v4", "v5"]]
17
18
20 v = [_FakeActionSet(f"v{i}", False) for i in range(1, 4)]
21 assert _names(get_task_groups(v)) == [["v1"], ["v2"], ["v3"]]
22
23
25 v1, v2, v3, v4 = (_FakeActionSet(f"v{i}", True) for i in range(1, 5))
26 assert _names(get_task_groups([v1, v2, SynchroniseActionSets(), v3, v4])) == [["v1", "v2"], ["v3", "v4"]]
27
28
30 v1, v2, v3 = _FakeActionSet("v1", False), _FakeActionSet("v2", True), _FakeActionSet("v3", True)
31 assert _names(get_task_groups([v1, v2, v3])) == [["v1"], ["v2", "v3"]]
Marker which ends a group of action sets that run in parallel.
__init__(self, name, parallel)
The Python-side model of "what happens during one mesh sweep".
Definition __init__.py:1
test_runs_of_parallel_action_sets_form_groups()
test_sequential_action_sets_form_groups_of_their_own()
test_parallel_action_set_after_sequential_one_starts_a_new_group()
test_marker_separates_groups_and_is_not_part_of_any_group()