spinn_machine.ignores package

Module contents

class spinn_machine.ignores.IgnoreChip(x: int | str, y: int | str, ip_address: str | None = None)

Bases: object

Represents a chip to be ignored when building a machine. This is typically because it has a fault in the SpiNNaker router.

Parameters:
  • x (int or str) – X coordinate of a Chip to ignore

  • y (int or str) – Y coordinate of a Chip to ignore

  • ip_address (str or None) – Optional IP address which, if provided, make x and y local coordinates

ip_address
static parse_single_string(downed_chip: str) IgnoreChip[source]

Converts a string into an IgnoreChip object.

The supported format is:

<down_chip_id> = <chip_x>,<chip_y>[,<ip>]

where:

  • <chip_x> is the x-coordinate of a down chip

  • <chip_x> is the y-coordinate of a down chip

  • <ip> is an optional IP address in the 127.0.0.0 format. If provided, the <chip_x>,<chip_y> will be considered local to the board with this IP address.

Two examples:

4,7
6,5,10.11.12.13
Parameters:

downed_chip (str) – representation of one chip to ignore

Returns:

An IgnoreChip Object

Return type:

IgnoreChip

static parse_string(downed_chips: str | None) Set[IgnoreChip][source]

Converts a string into a (possibly empty) set of IgnoreChip objects.

format is:

down_chips = <down_chip_id>[:<down_chip_id]*
<down_chip_id> = <chip_x>,<chip_y>[,<ip>]

where:

  • <chip_x> is the x-coordinate of a down chip

  • <chip_y> is the y-coordinate of a down chip

  • <ip> is an optional* IP address in the 127.0.0.0 format. If provided, the <chip_x>,<chip_y> will be considered local to the board with this IP address.

The string None (case-insensitive) is used to represent no ignores

An example:

4,7:6,5,10.11.12.13
Parameters:

downed_chips (str) – representation of zero or chips to ignore

Returns:

Set (possibly empty) of IgnoreChips

Return type:

set(IgnoreChip)

x
y
class spinn_machine.ignores.IgnoreCore(x: int | str, y: int | str, p: int | str, ip_address: str | None = None)

Bases: object

Represents a core to be ignored when building a machine.

Parameters:
  • x (int or str) – X coordinate of a core to ignore

  • y (int or str) – Y coordinate of a core to ignore

  • p (int or str) – The virtual core ID of a core if > 0, or the physical core if <= 0 (actual value will be negated)

  • ip_address (str or None) – Optional IP address which, if provided, make x and y local coordinates

ip_address
p
static parse_cores(core_string: str) Iterable[int][source]

Parses the “core” part of a string, which might be a single core, or otherwise is a range of cores

Parameters:

str – A string to parse

Returns:

A list of cores, which might be just one

Return type:

list(int)

static parse_single_string(downed_core: str) List[IgnoreCore][source]

Converts a string into an IgnoreCore object.

The format is:

<down_core_id> = <chip_x>,<chip_y>,(<core_id>|<core_range>)[,<ip>]
<core_range> = <core_id>-<core_id>

where:

  • <chip_x> is the x-coordinate of a down chip

  • <chip_x> is the y-coordinate of a down chip

  • <core_id> is the virtual core ID of a core if > 0, or the physical core if <= 0 (actual value will be negated)

  • <ip> is an optional IP address in the 127.0.0.0 format. If provided, the <chip_x>,<chip_y> will be considered local to the board with this IP address

Two examples:

4,7,3
6,5,-2,10.11.12.13
Parameters:

downed_core (str) – representation of one chip to ignore

Returns:

A list of IgnoreCore objects

Return type:

list(IgnoreCore)

static parse_string(downed_cores: str | None) Set[IgnoreCore][source]

Converts a string into a (possibly empty) set of IgnoreCore objects.

The format is:

down_cores = <down_core_id>[:<down_core_id]* <down_core_id> = <chip_x>,<chip_y>,(<core_id>|<core_range>)[,<ip>] <core_range> = <core_id>-<core_id>

where:

  • <chip_x> is the x-coordinate of a down chip

  • <chip_x> is the y-coordinate of a down chip

  • <core_id> is the virtual core ID of a core if > 0, or the physical core if <= 0 (actual value will be negated)

  • <ip> is an optional IP address in the 127.0.0.0 format. If provided, the <chip_x>,<chip_y> will be considered local to the board with this IP address.

The string None (case insensitive) is used to represent no ignores

An example:

4,7,3:6,5,-2,10.11.12.13,2,3,2-17
Parameters:

downed_cores (str) – representation of zero or chips to ignore

Returns:

Set (possibly empty) of IgnoreCores

Return type:

set(IgnoreCore)

property virtual_p: int

The virtual processor ID.

When the processor is given as a physical processor, this is converted to a virtual core ID using the typical virtual/physical core map; the mapping in a real machine may be different!

x
y

Bases: object

Represents a link that should be ignored when building a machine.

Parameters:
  • x (int or str) – X coordinate of a chip with a link to ignore

  • y (int or str) – Y coordinate of a chip with a link to ignore

  • link (int or str) – ID of the link to ignore

  • ip_address (str or None) – Optional IP address which, if provided, makes x and y be local coordinates

ip_address
static parse_single_string(downed_link: str) IgnoreLink[source]

Converts a string into an IgnoreLink object.

The format is:

<down_link> = <chip_x>,<chip_y>,<link_id>[,<ip>]

where:

  • <chip_x> is the x-coordinate of a down chip

  • <chip_x> is the y-coordinate of a down chip

  • <link_id> is the link ID

  • <ip> is an optional IP address in the 127.0.0.0 format. If provided, the <chip_x>,<chip_y> will be considered local to the board with this IP address.

Parameters:

downed_link (str) – representation of one link to ignore

Returns:

An IgnoreLink object

Return type:

IgnoreLink

static parse_string(downed_links: str | None) Set[IgnoreLink][source]

Converts a string into a (possibly empty) set of IgnoreLink objects

The format is:

down_links = <down_link_id>[:<down_link_id]*
<down_link_id> = <chip_x>,<chip_y>,<link_id>[,<ip>]

where:

  • <chip_x> is the x-coordinate of a down chip

  • <chip_x> is the y-coordinate of a down chip

  • <link_id> is the link ID

  • <ip> is an optional IP address in the 127.0.0.0 format. If provided, the <chip_x>,<chip_y> will be considered local to the board with this IP address

The string None (case insensitive) is used to represent no ignores

Parameters:

downed_cores (str) – representation of zero or chips to ignore

Returns:

Set (possibly empty) of IgnoreLinks

Return type:

set(IgnoreLink)

x
y