pacman.model.resources package

Submodules

pacman.model.resources.abstract_resource module

class pacman.model.resources.abstract_resource.AbstractResource[source]

Bases: object

Represents some finite resource

get_value()[source]

Get the amount of the resource used or available

Returns:The amount of the resource
Return type:int

pacman.model.resources.core_resource module

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

Bases: pacman.model.resources.abstract_resource.AbstractResource

Represents the number of cores that need to be allocated

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

None – No known exceptions are raised

chip
get_value()[source]
n_cores

pacman.model.resources.cpu_cycles_per_tick_resource module

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

Bases: pacman.model.resources.abstract_resource.AbstractResource

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]

Get the amount of the resource used or available

Returns:The amount of the resource
Return type:int

pacman.model.resources.dtcm_resource module

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

Bases: pacman.model.resources.abstract_resource.AbstractResource

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]

Get the amount of the resource used or available

Returns:The amount of the resource
Return type:int

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: pacman.model.resources.abstract_resource.AbstractResource

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

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) – 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]

Get the amount of the resource used or available

Returns:The amount of the resource
Return type:int
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 iptag

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 pre-allocated resources

Container object for the types of resources

Parameters:
  • specific_sdram_usage (iterable of pacman.model.resources.SpecificSDRAMResource) – iterable of SpecificSDRAMResource which states that specific chips have missing SDRAM
  • specific_core_resources (iterable of pacman.model.resources.SpecificCoreResource) – states which cores have been preallocated
  • core_resources (iterable of pacman.model.resources.CoreResource) – states a number of cores have been pre allocated but don’t care which ones they are
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 object for the types of resources so that ordering is no longer a risk

Container object for the types of resources

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 of pacman.models.resources.iptag_resource.IPtagResource) – the iptags required
  • reverse_iptags (None or list of pacman.models.resources.reverse_iptag_resource.ReverseIPtagResource) – the reverse iptags 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
sdram_tags

pacman.model.resources.reverse_iptag_resource module

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

Bases: pacman.model.resources.abstract_resource.AbstractResource

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

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]

Get the amount of the resource used or available

Returns:The amount of the resource
Return type:int
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.sdram_resource module

class pacman.model.resources.sdram_resource.SDRAMResource(sdram)[source]

Bases: pacman.model.resources.abstract_resource.AbstractResource

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

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

Get the amount of the resource used or available

Returns:The amount of the resource
Return type:int See pacman.model.resources.abstract_resource        .AbstractResource.get_value()

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: pacman.model.resources.abstract_resource.AbstractResource

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]

Get the amount of the resource used or available

Returns:The amount of the resource
Return type:int
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 IPTag

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: pacman.model.resources.abstract_resource.AbstractResource

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

Parameters:
  • board (str) – A board IP address which is where this reverse IPTag 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 IPTag is to be placed

Returns:str
get_value()[source]

Get the amount of the resource used or available

Returns:The amount of the resource
Return type:int
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: pacman.model.resources.abstract_resource.AbstractResource

Represents the number of cores that need to be allocated

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

None – No known exceptions are raised

chip
get_value()[source]
sdram_usage

pacman.model.resources.specific_core_resource module

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

Bases: pacman.model.resources.abstract_resource.AbstractResource

Represents specific cores that need to be allocated

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

None – No known exceptions are raised

chip
cores
get_value()[source]

Module contents

class pacman.model.resources.AbstractResource[source]

Bases: object

Represents some finite resource

get_value()[source]

Get the amount of the resource used or available

Returns:The amount of the resource
Return type:int
class pacman.model.resources.CPUCyclesPerTickResource(cycles)[source]

Bases: pacman.model.resources.abstract_resource.AbstractResource

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]

Get the amount of the resource used or available

Returns:The amount of the resource
Return type:int
class pacman.model.resources.DTCMResource(dtcm)[source]

Bases: pacman.model.resources.abstract_resource.AbstractResource

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]

Get the amount of the resource used or available

Returns:The amount of the resource
Return type:int
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: pacman.model.resources.abstract_resource.AbstractResource

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

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) – 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]

Get the amount of the resource used or available

Returns:The amount of the resource
Return type:int
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 iptag

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

Bases: object

container object for the types of resources so that ordering is no longer a risk

Container object for the types of resources

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 of pacman.models.resources.iptag_resource.IPtagResource) – the iptags required
  • reverse_iptags (None or list of pacman.models.resources.reverse_iptag_resource.ReverseIPtagResource) – the reverse iptags 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
sdram_tags
class pacman.model.resources.ReverseIPtagResource(port=None, sdp_port=1, tag=None)[source]

Bases: pacman.model.resources.abstract_resource.AbstractResource

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

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]

Get the amount of the resource used or available

Returns:The amount of the resource
Return type:int
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.SDRAMResource(sdram)[source]

Bases: pacman.model.resources.abstract_resource.AbstractResource

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

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

Get the amount of the resource used or available

Returns:The amount of the resource
Return type:int See pacman.model.resources.abstract_resource        .AbstractResource.get_value()
class pacman.model.resources.CoreResource(chip, n_cores)[source]

Bases: pacman.model.resources.abstract_resource.AbstractResource

Represents the number of cores that need to be allocated

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

None – No known exceptions are raised

chip
get_value()[source]
n_cores
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 pre-allocated resources

Container object for the types of resources

Parameters:
  • specific_sdram_usage (iterable of pacman.model.resources.SpecificSDRAMResource) – iterable of SpecificSDRAMResource which states that specific chips have missing SDRAM
  • specific_core_resources (iterable of pacman.model.resources.SpecificCoreResource) – states which cores have been preallocated
  • core_resources (iterable of pacman.model.resources.CoreResource) – states a number of cores have been pre allocated but don’t care which ones they are
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: pacman.model.resources.abstract_resource.AbstractResource

Represents the number of cores that need to be allocated

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

None – No known exceptions are raised

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

Bases: pacman.model.resources.abstract_resource.AbstractResource

Represents specific cores that need to be allocated

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

None – No known exceptions are raised

chip
cores
get_value()[source]