Interface SpallocClient.Job

Enclosing interface:
SpallocClient

public static interface SpallocClient.Job
The services offered relating to a Spalloc job. Jobs run on machines, and have boards allocated to them while they do so. Those boards (which will be connected) are a fundamental resource that allows SpiNNaker programs to be run.
  • Method Details

    • describe

      JobDescription describe(boolean waitForChange) throws IOException
      Get a description of a job. Includes the state of the job.
      Parameters:
      waitForChange - If true, will wait until the jobs may have changed. (Best-effort only; waiting time is bounded at 30 seconds.)
      Returns:
      The job description & state. Check the state to see whether the job has had resources allocated yet.
      Throws:
      IOException - If communication fails.
    • describe

      default JobDescription describe() throws IOException
      Get a description of a job. Includes the state of the job.
      Returns:
      The job description & state. Check the state to see whether the job has had resources allocated yet.
      Throws:
      IOException - If communication fails.
    • keepalive

      void keepalive() throws IOException
      Must be periodically called to prevent the service watchdog from culling the job.
      Throws:
      IOException - If communication fails.
    • delete

      void delete(String reason) throws IOException
      Mark a job as deleted.
      Parameters:
      reason - Why the job is to be deleted.
      Throws:
      IOException - If communication fails.
    • machine

      AllocatedMachine machine() throws IOException
      Get a description of what's been allocated to the job.
      Returns:
      a description of the allocated resources
      Throws:
      IOException - If communication fails, the resources have not yet been allocated, or the job is deleted.
    • getPower

      boolean getPower() throws IOException
      Get whether the boards of the machine are all switched on.
      Returns:
      true iff the boards are all on.
      Throws:
      IOException - If communication fails, the resources have not yet been allocated, or the job is deleted.
    • setPower

      boolean setPower(boolean switchOn) throws IOException
      Set the power state of the boards of the machine. Note that actually changing the power state of the boards may take some time.
      Parameters:
      switchOn - true to switch the boards on, false to switch them off.
      Returns:
      true iff the boards are all on.
      Throws:
      IOException - If communication fails, the resources have not yet been allocated, or the job is deleted.
    • whereIs

      WhereIs whereIs(@NotNull @Valid @NotNull @Valid HasChipLocation chip) throws FileNotFoundException, IOException
      Given the location of a chip within an allocation, return more info about a board.
      Parameters:
      chip - Chip location (relative to the root of the allocation).
      Returns:
      Board information
      Throws:
      FileNotFoundException - If the board doesn't exist or no boards are allocated to the job currently.
      IOException - If communication fails or the job is deleted.
    • getTransceiver

      Create a proxied transceiver for talking to the boards of the job. The transceiver will be configured so that it can talk to all the boards of the job and nothing else; the BMP(s) will not be accessible by this transceiver.
      Returns:
      The transceiver. It is the caller's responsibility to close this transceiver at the right time.
      Throws:
      IOException - If communication fails or the job is deleted.
      InterruptedException - If interrupted waiting for the connection to be set up.
      SpinnmanException - If transceiver construction fails.
    • waitForPower

      default void waitForPower() throws IOException
      Wait until the job's boards are powered on or the job is destroyed.
      Throws:
      IOException - If communication fails.
    • writeMemory

      void writeMemory(HasChipLocation chip, MemoryLocation baseAddress, ByteBuffer data) throws IOException
      Write memory directly using the Spalloc API.
      Parameters:
      chip - The chip to write to
      baseAddress - The base address to write to
      data - The data to write
      Throws:
      IOException - If communications fail.
    • readMemory

      ByteBuffer readMemory(HasChipLocation chip, MemoryLocation baseAddress, int length) throws IOException
      Read memory directly using the Spalloc API.
      Parameters:
      chip - The chip to read from
      baseAddress - The base address to read from
      length - The number of bytes to read
      Returns:
      The data read
      Throws:
      IOException - If communications fail.
    • fastWriteData

      void fastWriteData(CoreLocation gathererCore, IPTag iptag, HasChipLocation chip, MemoryLocation baseAddress, ByteBuffer data) throws IOException
      Fast write data directly with a job. Assumes it has been set up.
      Parameters:
      gathererCore - The core to use on the Ethernet chip.
      iptag - The tag ID to use for reading responses.
      chip - The chip to write to.
      baseAddress - The base address to write to.
      data - The data to write.
      Throws:
      IOException - If communications fail.
    • fastReadData

      ByteBuffer fastReadData(ChipLocation gathererChip, IPTag iptag, HasCoreLocation monitorCore, MemoryLocation baseAddress, int length) throws IOException
      Fast read data directly with a job. Assumes it has been set up.
      Parameters:
      gathererChip - The chip where the gatherer core is.
      iptag - The Tag ID to use for reading responses.
      monitorCore - The monitor core to read from.
      baseAddress - The SDRAM address to read from.
      length - The number of bytes to read.
      Returns:
      The data read.
      Throws:
      IOException - If communications fail.