Class CreateJob
java.lang.Object
uk.ac.manchester.spinnaker.spalloc.CreateJob
public class CreateJob extends Object
An abstract, high-level request to create a job.
- Author:
- Donal Fellows
-
Constructor Summary
Constructors Constructor Description CreateJob()
Build a request for a single board.CreateJob(@javax.validation.constraints.Positive int numBoards)
Build a request for a number of boards.CreateJob(@uk.ac.manchester.spinnaker.machine.board.ValidTriadWidth int width, @uk.ac.manchester.spinnaker.machine.board.ValidTriadHeight int height)
Build a request for a rectangle of boards.CreateJob(@uk.ac.manchester.spinnaker.machine.board.ValidTriadX int x, @uk.ac.manchester.spinnaker.machine.board.ValidTriadY int y, @uk.ac.manchester.spinnaker.machine.board.ValidTriadZ int z)
Build a request for a specific board. -
Method Summary
Modifier and Type Method Description CreateJobCommand
build()
Create the actual command to send.CreateJob
collab(int collab)
Set the collab of the request.Double
getKeepAlive()
CreateJob
group(String group)
Set the group of the request.CreateJob
keepAlive(@javax.validation.constraints.Positive double keepalive)
CreateJob
keepAlive(@NotNull Duration keepalive)
CreateJob
keepAlive(@Positive Double keepalive)
CreateJob
machine(@NotBlank String machine)
CreateJob
maxDeadBoards(@javax.validation.constraints.PositiveOrZero int maxDeadBoards)
CreateJob
maxDeadLinks(@javax.validation.constraints.PositiveOrZero int maxDeadLinks)
CreateJob
minRatio(@javax.validation.constraints.PositiveOrZero double minRatio)
CreateJob
nmpiJob(int nmpiJob)
Set the NMPI Job of the request.CreateJob
owner(@NotBlank String owner)
CreateJob
requireTorus()
Deprecated, for removal: This API element is subject to removal in a future version.You probably can't use this sensibly with the hardware as deployed (or you automatically get it when meaningful).CreateJob
requireTorus(boolean requireTorus)
Deprecated, for removal: This API element is subject to removal in a future version.You probably can't use this sensibly with the hardware as deployed (or you automatically get it when meaningful).CreateJob
tags(@NotBlank String... tags)
-
Constructor Details
-
CreateJob
public CreateJob()Build a request for a single board. -
CreateJob
Build a request for a number of boards.- Parameters:
numBoards
- How many boards to request.
-
CreateJob
public CreateJob(@ValidTriadWidth @uk.ac.manchester.spinnaker.machine.board.ValidTriadWidth int width, @ValidTriadHeight @uk.ac.manchester.spinnaker.machine.board.ValidTriadHeight int height)Build a request for a rectangle of boards.- Parameters:
width
- Horizontal size of rectangle, in triadsheight
- Vertical size of rectangle, in triads
-
CreateJob
public CreateJob(@ValidTriadX @uk.ac.manchester.spinnaker.machine.board.ValidTriadX int x, @ValidTriadY @uk.ac.manchester.spinnaker.machine.board.ValidTriadY int y, @ValidTriadZ @uk.ac.manchester.spinnaker.machine.board.ValidTriadZ int z)Build a request for a specific board.- Parameters:
x
- First coordinatey
- Second coordinatez
- Third coordinate- See Also:
WhereIs
-
-
Method Details
-
build
Create the actual command to send.- Returns:
- The command.
- Throws:
IllegalStateException
- If owner is not given
-
owner
- Parameters:
owner
- The name of the owner of this job. Required.- Returns:
this
(fluent interface)
-
keepAlive
- Parameters:
keepalive
- The maximum number of seconds which may elapse between a query on this job before it is automatically destroyed. Ifnull
, no timeout is used. (Default: 60.0)- Returns:
this
(fluent interface)
-
keepAlive
@CanIgnoreReturnValue public CreateJob keepAlive(@Positive @javax.validation.constraints.Positive double keepalive)- Parameters:
keepalive
- The maximum number of seconds which may elapse between a query on this job before it is automatically destroyed. (Default: 60.0)- Returns:
this
(fluent interface)
-
keepAlive
- Parameters:
keepalive
- The maximum amount of time which may elapse between a query on this job before it is automatically destroyed. (Default: 60 seconds)- Returns:
this
(fluent interface)- Throws:
IllegalArgumentException
- If the duration is negative.
-
machine
- Parameters:
machine
- Specify the name of a machine which this job must be executed on. If not specified, the first suitable machine available will be used, according to the tags selected below. Must be not specified when tags are given.- Returns:
this
(fluent interface)- Throws:
IllegalStateException
- If tags are already given
-
tags
- Parameters:
tags
- The set of tags which any machine running this job must have. If none are supplied, only machines with the “default
” tag will be used. Ifmachine
is given, this argument must be not supplied. (Default: empty list)- Returns:
this
(fluent interface)- Throws:
IllegalStateException
- If machine is already given
-
minRatio
@CanIgnoreReturnValue public CreateJob minRatio(@PositiveOrZero @javax.validation.constraints.PositiveOrZero double minRatio)- Parameters:
minRatio
- The aspect ratio (h/w) which the allocated region must be ‘at least as square as’. Set to0.0
for any allowable shape,1.0
to be exactly square. Ignored when allocating single boards or specific rectangles of triads.- Returns:
this
(fluent interface)
-
maxDeadBoards
@CanIgnoreReturnValue public CreateJob maxDeadBoards(@PositiveOrZero @javax.validation.constraints.PositiveOrZero int maxDeadBoards)- Parameters:
maxDeadBoards
- The maximum number of broken or unreachable boards to allow in the allocated region. If unspecified, any number of dead boards is permitted, as long as the board on the bottom-left corner is alive.- Returns:
this
(fluent interface)
-
maxDeadLinks
@CanIgnoreReturnValue public CreateJob maxDeadLinks(@PositiveOrZero @javax.validation.constraints.PositiveOrZero int maxDeadLinks)- Parameters:
maxDeadLinks
- The maximum number of broken links allow in the allocated region. Whenrequire_torus
is true this includes wrap-around links, otherwise peripheral links are not counted. If unspecified, any number of broken links is allowed.- Returns:
this
(fluent interface)
-
requireTorus
Deprecated, for removal: This API element is subject to removal in a future version.You probably can't use this sensibly with the hardware as deployed (or you automatically get it when meaningful). The default is fine.Equivalent to:requireTorus(true)
.- Returns:
this
(fluent interface)
-
requireTorus
@CanIgnoreReturnValue @Deprecated(forRemoval=true) public CreateJob requireTorus(boolean requireTorus)Deprecated, for removal: This API element is subject to removal in a future version.You probably can't use this sensibly with the hardware as deployed (or you automatically get it when meaningful). The default is fine.- Parameters:
requireTorus
- Iftrue
, only allocate blocks with torus connectivity. In general this will only succeed for requests to allocate an entire machine (when the machine is otherwise not in use!). Must befalse
(the default) when allocating boards.- Returns:
this
(fluent interface)
-
getKeepAlive
- Returns:
- The current keepalive value in the builder.
-
group
Set the group of the request.- Parameters:
group
- The group to set.- Returns:
this
(fluent interface)
-
collab
Set the collab of the request.- Parameters:
collab
- The collab to set.- Returns:
this
(fluent interface)
-
nmpiJob
Set the NMPI Job of the request.- Parameters:
nmpiJob
- The NMPI Job to set.- Returns:
this
(fluent interface)
-