Skip to content
Snippets Groups Projects
Commit 03ecf153 authored by Oscar Gustafsson's avatar Oscar Gustafsson :bicyclist:
Browse files

More deterministic sorting of processes

parent 4c3f8211
No related branches found
No related tags found
1 merge request!433More deterministic sorting of processes
Pipeline #103290 passed
...@@ -30,9 +30,17 @@ class Process: ...@@ -30,9 +30,17 @@ class Process:
self._name = name self._name = name
def __lt__(self, other): def __lt__(self, other):
return self._start_time < other.start_time or ( return (
self._start_time == other.start_time self._start_time < other.start_time
and self.execution_time > other.execution_time or (
self._start_time == other.start_time
and self.execution_time > other.execution_time
)
or ( # Sorting on name to possibly get deterministic behavior
self._start_time == other.start_time
and self.execution_time == other.execution_time
and self._name < other.name
)
) )
@property @property
......
...@@ -191,7 +191,12 @@ memories[3].assign() ...@@ -191,7 +191,12 @@ memories[3].assign()
arch.move_process('cmul2.0', 'memory1', 'memory0') arch.move_process('cmul2.0', 'memory1', 'memory0')
arch.move_process('bfly3.0', 'memory0', 'memory1') arch.move_process('bfly3.0', 'memory0', 'memory1')
arch.move_process('bfly3.1', 'memory4', 'memory0') arch.move_process('cmul3.0', 'memory4', 'memory0')
memories[0].assign() memories[0].assign()
memories[1].assign() memories[1].assign()
memories[4].assign() memories[4].assign()
for memory in memories:
memory.show_content(title=f"Improved {memory.entity_name}")
arch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment