Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Power on during init #1101

Merged
merged 10 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from spinn_utilities.config_holder import set_config
from spalloc_client.job import JobDestroyedError
from spinn_utilities.ping import Ping
from spinnman.exceptions import SpinnmanIOException
import spinnman.transceiver as transceiver
from spinn_front_end_common.data.fec_data_writer import FecDataWriter
from spinn_front_end_common.interface.config_setup import unittest_setup
Expand Down Expand Up @@ -111,10 +110,6 @@ def testSpin4(self):
if not Ping.host_is_reachable(self.spin4Host):
raise unittest.SkipTest(self.spin4Host + " appears to be down")
trans = transceiver.create_transceiver_from_hostname(self.spin4Host, 5)
try:
trans.ensure_board_is_ready()
except (SpinnmanIOException):
self.skipTest("Skipping as getting Job failed")

machine = trans.get_machine_details()
FecDataWriter.mock().set_machine(machine)
Expand Down Expand Up @@ -156,7 +151,6 @@ def testSpin2(self):
self.skipTest("Skipping as getting Job failed")

trans = transceiver.create_transceiver_from_hostname(hostname, 5)
trans.ensure_board_is_ready()
writer.set_machine(trans.get_machine_details())

m_allocation_controller.close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ def create_transceiver(self):
hostname=self.__hostname,
bmp_connection_data=None,
version=5, auto_detect_bmp=False)
txrx.ensure_board_is_ready()
txrx.discover_scamp_connections()
return txrx

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,14 @@
import re

from spinn_utilities.log import FormatAdapter
from spinnman.constants import POWER_CYCLE_WAIT_TIME_IN_SECONDS
from spinnman.transceiver import create_transceiver_from_hostname
from spinnman.model import BMPConnectionData
from spinn_front_end_common.data import FecDataView
from spinn_front_end_common.utilities.exceptions import ConfigurationException
import time
import logging

logger = FormatAdapter(logging.getLogger(__name__))

POWER_CYCLE_WARNING = (
"When power-cycling a board, it is recommended that you wait for 30 "
"seconds before attempting a reboot. Therefore, the tools will now "
"wait for 30 seconds. If you wish to avoid this wait, please set "
"reset_machine_on_startup = False in the [Machine] section of the "
"relevant configuration (cfg) file.")

POWER_CYCLE_FAILURE_WARNING = (
"The end user requested the power-cycling of the board. But the "
"tools did not have the required BMP connection to facilitate a "
"power-cycling, and therefore will not do so. please set the "
"bmp_names accordingly in the [Machine] section of the relevant "
"configuration (cfg) file. Or use a machine assess process which "
"provides the BMP data (such as a spalloc system) or finally set "
"reset_machine_on_startup = False in the [Machine] section of the "
"relevant configuration (cfg) file to avoid this warning in future.")


def machine_generator(
bmp_details, board_version, auto_detect_bmp,
Expand Down Expand Up @@ -80,23 +61,14 @@ def machine_generator(
hostname=FecDataView.get_ipaddress(),
bmp_connection_data=_parse_bmp_details(bmp_details),
version=board_version,
auto_detect_bmp=auto_detect_bmp)

if reset_machine_on_start_up:
success = txrx.power_off_machine()
if success:
logger.warning(POWER_CYCLE_WARNING)
time.sleep(POWER_CYCLE_WAIT_TIME_IN_SECONDS)
logger.warning("Power cycle wait complete")
else:
logger.warning(POWER_CYCLE_FAILURE_WARNING)
auto_detect_bmp=auto_detect_bmp,
power_cycle=reset_machine_on_start_up)

# do auto boot if possible
if board_version is None:
raise ConfigurationException(
"Please set a machine version number in the "
"corresponding configuration (cfg) file")
txrx.ensure_board_is_ready()
if scamp_connection_data:
txrx.add_scamp_connections(scamp_connection_data)
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ def create_transceiver(self):
if not self.__use_proxy:
return super(SpallocJobController, self).create_transceiver()
txrx = self._job.create_transceiver()
txrx.ensure_board_is_ready()
return txrx

@overrides(AbstractMachineAllocationController.open_sdp_connection)
Expand Down