Skip to content

Commit e7a07bb

Browse files
committed
Catch errors and handle
1 parent e4eebee commit e7a07bb

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

spinn_front_end_common/interface/interface_functions/application_runner.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
from typing import Optional
2020
from spinn_utilities.log import FormatAdapter
2121
from spinnman.messages.scp.enums import Signal
22-
from spinnman.model.enums import ExecutableType
22+
from spinnman.model.enums import ExecutableType, CPUState
23+
from spinnman.exceptions import SpinnmanException
2324
from spinn_front_end_common.data import FecDataView
2425
from spinn_front_end_common.utilities.exceptions import (
2526
ConfigurationException)
@@ -123,9 +124,19 @@ def run_app(
123124
ExecutableType.USES_SIMULATION_INTERFACE)
124125
n_cores = len(core_subsets)
125126

126-
SendPauseProcess(
127-
FecDataView.get_scamp_connection_selector()).send_pause(
128-
core_subsets, n_cores)
127+
try:
128+
SendPauseProcess(
129+
FecDataView.get_scamp_connection_selector()).send_pause(
130+
core_subsets, n_cores)
131+
except SpinnmanException as e:
132+
# Check if cores have failed now
133+
rte_cores = self.__txrx.get_core_state_count(
134+
self.__app_id, CPUState.RUN_TIME_EXCEPTION)
135+
136+
# If there are no cores in the RTE state, then re-raise the
137+
# original exception, otherwise the wait_for_end will handle it
138+
if rte_cores == 0:
139+
raise e
129140
self._wait_for_end()
130141

131142
process = GetCurrentTimeProcess(

0 commit comments

Comments
 (0)