pacman.model.resources package

Submodules

pacman.model.resources.abstract_sdram module

class pacman.model.resources.abstract_sdram.AbstractSDRAM[source]

Bases: object

Represents an amount of SDRAM used on a chip in the machine.

fixed

Returns the fixed SDRAM cost

get_total_sdram(n_timesteps)[source]

The total SDRAM.

Parameters:n_timesteps (int) – number of timesteps to cost for
Returns:
per_timestep

Returns extra SDRAM cost for each additional timestep

Warning may well be zero

sub_from(other)[source]

Creates a new SDRAM which is the other less this one

Parameters:other (AbstractSDRAM) – another SDRAM resource
Returns:a New AbstractSDRAM
Return type:AbstractSDRAM

pacman.model.resources.constant_sdram module

class pacman.model.resources.constant_sdram.ConstantSDRAM(sdram)[source]

Bases: pacman.model.resources.abstract_sdram.AbstractSDRAM

Represents an amount of SDRAM used on a chip in the machine.

This is used when the amount of SDRAM needed is not effected by runtime

Parameters:sdram (int) – The amount of SDRAM in bytes
Raises:None – No known exceptions are raised
fixed

Returns the fixed SDRAM cost

get_total_sdram(n_timesteps)[source]

The total SDRAM.

Parameters:n_timesteps (int) – number of timesteps to cost for
Returns:
per_timestep

Returns extra SDRAM cost for each additional timestep

Warning may well be zero

sub_from(other)[source]

Creates a new SDRAM which is the other less this one

Parameters:other (AbstractSDRAM) – another SDRAM resource
Returns:a New AbstractSDRAM
Return type:AbstractSDRAM

pacman.model.resources.core_resource module

class pacman.model.resources.core_resource.CoreResource(chip, n_cores)[source]

Bases: object

Represents the number of cores that need to be allocated.

Parameters:
  • n_cores (int) – The number of cores to allocate
  • chip (spinn_machine.Chip) – chip of where these cores are to be allocated
Raises:

None – No known exceptions are raised

chip
get_value()[source]
Returns:The chip and the cores required on it.
n_cores

pacman.model.resources.cpu_cycles_per_tick_resource module

class pacman.model.resources.cpu_cycles_per_tick_resource.CPUCyclesPerTickResource(cycles)[source]

Bases: object

Represents the number of CPU clock cycles per tick used or available on a core of a chip in the machine.

Parameters:cycles (int) – The number of CPU clock cycles
Raises:None – No known exceptions are raised
get_value()[source]
Returns:The number of CPU clock cycles needed per simulation tick.

pacman.model.resources.dtcm_resource module

class pacman.model.resources.dtcm_resource.DTCMResource(dtcm)[source]

Bases: object

Represents the amount of local core memory available or used on a core on a chip of the machine.

Parameters:dtcm (int) – The amount of DTCM in bytes
Raises:None – No known exceptions are raised
get_value()[source]
Returns:The required amount of DTCM, in bytes.

pacman.model.resources.element_free_space module

class pacman.model.resources.element_free_space.ElementFreeSpace(start_address, size)[source]

Bases: object

size
start_address

pacman.model.resources.iptag_resource module

class pacman.model.resources.iptag_resource.IPtagResource(ip_address, port, strip_sdp, tag=None, traffic_identifier='DEFAULT')[source]

Bases: object

Represents the ability to have a SpiNNaker machine send messages to you during execution.

Parameters:
  • ip_address (str) – The IP address of the host that will receive data from this tag
  • port (int or None) – The port that will
  • strip_sdp (bool) – Whether the tag requires that SDP headers are stripped before transmission of data
  • tag (int or None) – A fixed tag ID to assign, or None if any tag is OK
  • traffic_identifier (str) – The traffic to be sent using this tag; traffic with the same traffic_identifier can be sent using the same tag
get_value()[source]
Returns:The description of the IP tag.
ip_address

The IP address to assign to the tag

Returns:An IP address
Return type:str
port

The port of the tag

Returns:The port of the tag
Return type:int
strip_sdp

Whether SDP headers should be stripped for this tag

Returns:True if the headers should be stripped, False otherwise
Return type:bool
tag

The tag required, or None if any tag is OK

Returns:The tag or None
Return type:int
traffic_identifier

The traffic identifier for this IP tag

pacman.model.resources.pre_allocated_resource_container module

class pacman.model.resources.pre_allocated_resource_container.PreAllocatedResourceContainer(specific_sdram_usage=None, specific_core_resources=None, core_resources=None, specific_iptag_resources=None, specific_reverse_iptag_resources=None)[source]

Bases: object

Container object for preallocated resources

Parameters:
core_resources
extend(other)[source]
specific_core_resources
specific_iptag_resources
specific_reverse_iptag_resources
specific_sdram_usage

pacman.model.resources.resource_container module

class pacman.model.resources.resource_container.ResourceContainer(dtcm=None, sdram=None, cpu_cycles=None, iptags=None, reverse_iptags=None)[source]

Bases: object

Container for the types of resources so that ordering is no longer a problem.

Parameters:
  • dtcm (None or pacman.models.resources.dtcm_resource.DTCMResource) – the amount of dtcm used
  • sdram (None or pacman.models.resources.sdram_resource.SDRAMResource) – the amount of SDRAM used
  • cpu_cycles (None or pacman.models.resources.cpu_cycles_per_tick_resource.CPUCyclesPerTickResource) – the amount of CPU used
  • iptags (None or list(pacman.models.resources.iptag_resource.IPtagResource)) – the IP tags required
  • reverse_iptags (None or list(pacman.models.resources.reverse_iptag_resource.ReverseIPtagResource)) – the reverse IP tags required
Return type:

pacman.models.resources.resource_container.ResourceContainer

Raises:

None – does not raise any known exception

cpu_cycles
dtcm
extend(other)[source]
iptags
reverse_iptags
sdram

pacman.model.resources.reverse_iptag_resource module

class pacman.model.resources.reverse_iptag_resource.ReverseIPtagResource(port=None, sdp_port=1, tag=None)[source]

Bases: object

Represents the ability to talk to a SpiNNaker machine by sending UDP packets to it during execution.

Parameters:
  • port (int) – The target port of the tag or None to assign elsewhere
  • port – The UDP port to listen to on the board for this tag
  • sdp_port (int) – The SDP port number to be used when constructing SDP packets from the received UDP packets for this tag
  • tag (int or None) – A fixed tag ID to assign, or None if any tag is OK
get_value()[source]
Returns:The description of the reverse IP tag.
port

The port of the tag

Returns:The port of the tag
Return type:int
sdp_port

The SDP port to use when constructing the SDP message from the received UDP message

tag

The tag required, or None if any tag is OK

Returns:The tag or None
Return type:int

pacman.model.resources.specific_board_iptag_resource module

class pacman.model.resources.specific_board_iptag_resource.SpecificBoardTagResource(board, ip_address, port, strip_sdp, tag=None, traffic_identifier='DEFAULT')[source]

Bases: object

A resource that allocates a tag on a specific board before the class needing it has been built.

Parameters:
  • board (str) – The IP address of the board to which this tag is to be associated with
  • ip_address (str) – The IP address of the host that will receive data from this tag
  • port (int or None) – The port that will
  • strip_sdp (bool) – Whether the tag requires that SDP headers are stripped before transmission of data
  • tag (int) – A fixed tag ID to assign, or None if any tag is OK
  • traffic_identifier (str) – The traffic to be sent using this tag; traffic with the same traffic_identifier can be sent using the same tag
board

The board IP address that this tag is to reside on

Returns:IP address
get_value()[source]
Returns:A description of the specific board’s IP tag required.
ip_address

The IP address to assign to the tag.

Returns:An IP address
Return type:str
port

The port of the tag

Returns:The port of the tag
Return type:int
strip_sdp

Whether SDP headers should be stripped for this tag

Returns:True if the headers should be stripped, False otherwise
Return type:bool
tag

The tag required, or None if any tag is OK.

Returns:The tag or None
Return type:int
traffic_identifier

The traffic identifier for this IP tag

pacman.model.resources.specific_board_reverse_iptag_resource module

class pacman.model.resources.specific_board_reverse_iptag_resource.ReverseIPtagResource(board, port=None, sdp_port=1, tag=None)[source]

Bases: object

Represents the ability to talk to a specific board of a SpiNNaker machine by sending UDP packets to it during execution.

Parameters:
  • board (str) – A board IP address which is where this reverse IP tag is to be placed
  • port (int) – The target port of the tag or None to assign elsewhere
  • port – The UDP port to listen to on the board for this tag
  • sdp_port (int) – The SDP port number to be used when constructing SDP packets from the received UDP packets for this tag.
  • tag (int or None) – A fixed tag ID to assign, or None if any tag is OK
board

A board IP address which is where this reverse IP tag is to be placed.

Returns:str
get_value()[source]
Returns:A description of the specific board’s reverse IP tag required.
port

The port of the tag

Returns:The port of the tag
Return type:int
sdp_port

The SDP port to use when constructing the SDP message from the received UDP message.

tag

The tag required, or None if any tag is OK

Returns:The tag or None
Return type:int

pacman.model.resources.specific_chip_sdram_resource module

class pacman.model.resources.specific_chip_sdram_resource.SpecificChipSDRAMResource(chip, sdram_usage)[source]

Bases: object

Represents the SDRAM required for this Chip

Parameters:
  • sdram_usage (AbstractSDRAM The amount of SDRAM in bytes needed to be preallocated) – The amount of SDRAM in bytes needed to be pre-allocated
  • chip (spinn_machine.Chip) – chip of where the SDRAM is to be allocated
Raises:

None – No known exceptions are raised

chip
get_value()[source]
Returns:The chip for which it is required, and the amount of SDRAM required thereon, in bytes.
sdram_usage

pacman.model.resources.specific_core_resource module

class pacman.model.resources.specific_core_resource.SpecificCoreResource(chip, cores)[source]

Bases: object

Represents specific cores that need to be allocated.

Parameters:
  • cores (iterable(int)) – The specific cores that need to be allocated (list of processor IDs)
  • chip (spinn_machine.Chip) – chip of where these cores are to be allocated
Raises:

None – No known exceptions are raised

chip
cores
get_value()[source]
Returns:The chip and the cores required on it.

pacman.model.resources.variable_sdram module

class pacman.model.resources.variable_sdram.VariableSDRAM(fixed_sdram, per_timestep_sdram)[source]

Bases: pacman.model.resources.abstract_sdram.AbstractSDRAM

Represents an amount of SDRAM used on a chip in the machine.

This is where the usage increase as the run time increases

Parameters:sdram (int) – The amount of SDRAM in bytes
Raises:None – No known exceptions are raised
fixed

Returns the fixed SDRAM cost

get_total_sdram(n_timesteps)[source]

The total SDRAM.

Parameters:n_timesteps (int) – number of timesteps to cost for
Returns:
per_timestep

Returns extra SDRAM cost for each additional timestep

Warning may well be zero

sub_from(other)[source]

Creates a new SDRAM which is the other less this one

Parameters:other (AbstractSDRAM) – another SDRAM resource
Returns:a New AbstractSDRAM
Return type:AbstractSDRAM

Module contents

class pacman.model.resources.AbstractSDRAM[source]

Bases: object

Represents an amount of SDRAM used on a chip in the machine.

fixed

Returns the fixed SDRAM cost

get_total_sdram(n_timesteps)[source]

The total SDRAM.

Parameters:n_timesteps (int) – number of timesteps to cost for
Returns:
per_timestep

Returns extra SDRAM cost for each additional timestep

Warning may well be zero

sub_from(other)[source]

Creates a new SDRAM which is the other less this one

Parameters:other (AbstractSDRAM) – another SDRAM resource
Returns:a New AbstractSDRAM
Return type:AbstractSDRAM
class pacman.model.resources.ConstantSDRAM(sdram)[source]

Bases: pacman.model.resources.abstract_sdram.AbstractSDRAM

Represents an amount of SDRAM used on a chip in the machine.

This is used when the amount of SDRAM needed is not effected by runtime

Parameters:sdram (int) – The amount of SDRAM in bytes
Raises:None – No known exceptions are raised
fixed

Returns the fixed SDRAM cost

get_total_sdram(n_timesteps)[source]

The total SDRAM.

Parameters:n_timesteps (int) – number of timesteps to cost for
Returns:
per_timestep

Returns extra SDRAM cost for each additional timestep

Warning may well be zero

sub_from(other)[source]

Creates a new SDRAM which is the other less this one

Parameters:other (AbstractSDRAM) – another SDRAM resource
Returns:a New AbstractSDRAM
Return type:AbstractSDRAM
class pacman.model.resources.CoreResource(chip, n_cores)[source]

Bases: object

Represents the number of cores that need to be allocated.

Parameters:
  • n_cores (int) – The number of cores to allocate
  • chip (spinn_machine.Chip) – chip of where these cores are to be allocated
Raises:

None – No known exceptions are raised

chip
get_value()[source]
Returns:The chip and the cores required on it.
n_cores
class pacman.model.resources.CPUCyclesPerTickResource(cycles)[source]

Bases: object

Represents the number of CPU clock cycles per tick used or available on a core of a chip in the machine.

Parameters:cycles (int) – The number of CPU clock cycles
Raises:None – No known exceptions are raised
get_value()[source]
Returns:The number of CPU clock cycles needed per simulation tick.
class pacman.model.resources.DTCMResource(dtcm)[source]

Bases: object

Represents the amount of local core memory available or used on a core on a chip of the machine.

Parameters:dtcm (int) – The amount of DTCM in bytes
Raises:None – No known exceptions are raised
get_value()[source]
Returns:The required amount of DTCM, in bytes.
class pacman.model.resources.ElementFreeSpace(start_address, size)[source]

Bases: object

size
start_address
class pacman.model.resources.IPtagResource(ip_address, port, strip_sdp, tag=None, traffic_identifier='DEFAULT')[source]

Bases: object

Represents the ability to have a SpiNNaker machine send messages to you during execution.

Parameters:
  • ip_address (str) – The IP address of the host that will receive data from this tag
  • port (int or None) – The port that will
  • strip_sdp (bool) – Whether the tag requires that SDP headers are stripped before transmission of data
  • tag (int or None) – A fixed tag ID to assign, or None if any tag is OK
  • traffic_identifier (str) – The traffic to be sent using this tag; traffic with the same traffic_identifier can be sent using the same tag
get_value()[source]
Returns:The description of the IP tag.
ip_address

The IP address to assign to the tag

Returns:An IP address
Return type:str
port

The port of the tag

Returns:The port of the tag
Return type:int
strip_sdp

Whether SDP headers should be stripped for this tag

Returns:True if the headers should be stripped, False otherwise
Return type:bool
tag

The tag required, or None if any tag is OK

Returns:The tag or None
Return type:int
traffic_identifier

The traffic identifier for this IP tag

class pacman.model.resources.ResourceContainer(dtcm=None, sdram=None, cpu_cycles=None, iptags=None, reverse_iptags=None)[source]

Bases: object

Container for the types of resources so that ordering is no longer a problem.

Parameters:
  • dtcm (None or pacman.models.resources.dtcm_resource.DTCMResource) – the amount of dtcm used
  • sdram (None or pacman.models.resources.sdram_resource.SDRAMResource) – the amount of SDRAM used
  • cpu_cycles (None or pacman.models.resources.cpu_cycles_per_tick_resource.CPUCyclesPerTickResource) – the amount of CPU used
  • iptags (None or list(pacman.models.resources.iptag_resource.IPtagResource)) – the IP tags required
  • reverse_iptags (None or list(pacman.models.resources.reverse_iptag_resource.ReverseIPtagResource)) – the reverse IP tags required
Return type:

pacman.models.resources.resource_container.ResourceContainer

Raises:

None – does not raise any known exception

cpu_cycles
dtcm
extend(other)[source]
iptags
reverse_iptags
sdram
class pacman.model.resources.ReverseIPtagResource(port=None, sdp_port=1, tag=None)[source]

Bases: object

Represents the ability to talk to a SpiNNaker machine by sending UDP packets to it during execution.

Parameters:
  • port (int) – The target port of the tag or None to assign elsewhere
  • port – The UDP port to listen to on the board for this tag
  • sdp_port (int) – The SDP port number to be used when constructing SDP packets from the received UDP packets for this tag
  • tag (int or None) – A fixed tag ID to assign, or None if any tag is OK
get_value()[source]
Returns:The description of the reverse IP tag.
port

The port of the tag

Returns:The port of the tag
Return type:int
sdp_port

The SDP port to use when constructing the SDP message from the received UDP message

tag

The tag required, or None if any tag is OK

Returns:The tag or None
Return type:int
class pacman.model.resources.PreAllocatedResourceContainer(specific_sdram_usage=None, specific_core_resources=None, core_resources=None, specific_iptag_resources=None, specific_reverse_iptag_resources=None)[source]

Bases: object

Container object for preallocated resources

Parameters:
core_resources
extend(other)[source]
specific_core_resources
specific_iptag_resources
specific_reverse_iptag_resources
specific_sdram_usage
class pacman.model.resources.SpecificChipSDRAMResource(chip, sdram_usage)[source]

Bases: object

Represents the SDRAM required for this Chip

Parameters:
  • sdram_usage (AbstractSDRAM The amount of SDRAM in bytes needed to be preallocated) – The amount of SDRAM in bytes needed to be pre-allocated
  • chip (spinn_machine.Chip) – chip of where the SDRAM is to be allocated
Raises:

None – No known exceptions are raised

chip
get_value()[source]
Returns:The chip for which it is required, and the amount of SDRAM required thereon, in bytes.
sdram_usage
class pacman.model.resources.SpecificCoreResource(chip, cores)[source]

Bases: object

Represents specific cores that need to be allocated.

Parameters:
  • cores (iterable(int)) – The specific cores that need to be allocated (list of processor IDs)
  • chip (spinn_machine.Chip) – chip of where these cores are to be allocated
Raises:

None – No known exceptions are raised

chip
cores
get_value()[source]
Returns:The chip and the cores required on it.
pacman.model.resources.SpecificBoardIPtagResource

alias of pacman.model.resources.specific_board_iptag_resource.SpecificBoardTagResource

pacman.model.resources.SpecificBoardReverseIPtagResource

alias of pacman.model.resources.specific_board_reverse_iptag_resource.ReverseIPtagResource

class pacman.model.resources.VariableSDRAM(fixed_sdram, per_timestep_sdram)[source]

Bases: pacman.model.resources.abstract_sdram.AbstractSDRAM

Represents an amount of SDRAM used on a chip in the machine.

This is where the usage increase as the run time increases

Parameters:sdram (int) – The amount of SDRAM in bytes
Raises:None – No known exceptions are raised
fixed

Returns the fixed SDRAM cost

get_total_sdram(n_timesteps)[source]

The total SDRAM.

Parameters:n_timesteps (int) – number of timesteps to cost for
Returns:
per_timestep

Returns extra SDRAM cost for each additional timestep

Warning may well be zero

sub_from(other)[source]

Creates a new SDRAM which is the other less this one

Parameters:other (AbstractSDRAM) – another SDRAM resource
Returns:a New AbstractSDRAM
Return type:AbstractSDRAM