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 Details

    • CreateJob

      public CreateJob()
      Build a request for a single board.
    • CreateJob

      public CreateJob​(@Positive @javax.validation.constraints.Positive int numBoards)
      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 triads
      height - 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 coordinate
      y - Second coordinate
      z - Third coordinate
      See Also:
      WhereIs
  • Method Details

    • build

      public CreateJobCommand 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

      @CanIgnoreReturnValue public CreateJob keepAlive​(@Positive @Positive Double keepalive)
      Parameters:
      keepalive - The maximum number of seconds which may elapse between a query on this job before it is automatically destroyed. If null, 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

      @CanIgnoreReturnValue public CreateJob keepAlive​(@NotNull @NotNull Duration 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. If machine 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 to 0.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. When require_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 - If true, 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 be false (the default) when allocating boards.
      Returns:
      this (fluent interface)
    • getKeepAlive

      public Double getKeepAlive()
      Returns:
      The current keepalive value in the builder.
    • group

      @CanIgnoreReturnValue public CreateJob group​(String group)
      Set the group of the request.
      Parameters:
      group - The group to set.
      Returns:
      this (fluent interface)
    • collab

      @CanIgnoreReturnValue public CreateJob collab​(int collab)
      Set the collab of the request.
      Parameters:
      collab - The collab to set.
      Returns:
      this (fluent interface)
    • nmpiJob

      @CanIgnoreReturnValue public CreateJob nmpiJob​(int nmpiJob)
      Set the NMPI Job of the request.
      Parameters:
      nmpiJob - The NMPI Job to set.
      Returns:
      this (fluent interface)