Skip to content

Commit

Permalink
Changes for larger machines.
Browse files Browse the repository at this point in the history
  • Loading branch information
mundya committed Apr 6, 2016
1 parent 3ab6d62 commit 9376087
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions nengo_spinnaker/simulator.py
Expand Up @@ -294,9 +294,8 @@ def _run_steps(self, steps):
io_thread.start()

# Wait for all cores to hit SYNC1
self.controller.wait_for_cores_to_reach_state(
"sync1", len(self.netlist.vertices)
)
self._wait_for_transition(AppState.sync0, AppState.sync1,
len(self.netlist.vertices))
logger.info("Running simulation...")
self.controller.send_signal("sync1")

Expand Down Expand Up @@ -344,7 +343,10 @@ def _wait_for_transition(self, from_state, desired_to_state, num_verts):
time.sleep(1.0)

# Check if any cores haven't exited cleanly
if self.controller.count_cores_in_state(desired_to_state) != num_verts:
num_ready = self.controller.wait_for_cores_to_reach_state(
desired_to_state, num_verts, timeout=5.0)

if num_ready != num_verts:
# Loop through all placed vertices
for vertex, (x, y) in six.iteritems(self.netlist.placements):
p = self.netlist.allocations[vertex][Cores].start
Expand All @@ -353,6 +355,7 @@ def _wait_for_transition(self, from_state, desired_to_state, num_verts):
print("Core ({}, {}, {}) in state {!s}".format(
x, y, p, status.cpu_state))
print(self.controller.get_iobuf(p, x, y))

raise Exception("Unexpected core failures before reaching %s "
"state." % desired_to_state)

Expand Down

0 comments on commit 9376087

Please sign in to comment.