Class SpallocJavaMachineManagerImpl

java.lang.Object
uk.ac.manchester.spinnaker.nmpi.machinemanager.SpallocJavaMachineManagerImpl
All Implemented Interfaces:
AutoCloseable, MachineManager

public class SpallocJavaMachineManagerImpl extends Object implements MachineManager
A machine manager that interfaces to the new spalloc service.
  • Constructor Details

    • SpallocJavaMachineManagerImpl

      public SpallocJavaMachineManagerImpl()
  • Method Details

    • close

      public void close() throws Exception
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception
    • getMachines

      public List<SpinnakerMachine> getMachines() throws IOException
      Description copied from interface: MachineManager
      Gets the machines that this manager allocates from.
      Specified by:
      getMachines in interface MachineManager
      Returns:
      collection of machines
      Throws:
      IOException - if there is communication error.
    • getNextAvailableMachine

      public SpinnakerMachine getNextAvailableMachine(int nBoards, String owner, int jobId)
      Description copied from interface: MachineManager
      Get the next available machine of a given size.
      Specified by:
      getNextAvailableMachine in interface MachineManager
      Parameters:
      nBoards - The (minimum) number of boards that the machine needs to have.
      owner - The owner of the job.
      jobId - The ID of the NMPI job.
      Returns:
      a machine.
    • isMachineAvailable

      public boolean isMachineAvailable(SpinnakerMachine machine)
      Description copied from interface: MachineManager
      Test if a specific machine is available.
      Specified by:
      isMachineAvailable in interface MachineManager
      Parameters:
      machine - The machine handle
      Returns:
      true if the machine is available.
    • waitForMachineStateChange

      public boolean waitForMachineStateChange(SpinnakerMachine machine, int waitTime)
      Description copied from interface: MachineManager
      Wait for the machine's availability to change.
      Specified by:
      waitForMachineStateChange in interface MachineManager
      Parameters:
      machine - The machine handle
      waitTime - Maximum wait time (in milliseconds)
      Returns:
      Whether the machine state has changed.
    • releaseMachine

      public void releaseMachine(SpinnakerMachine machine)
      Description copied from interface: MachineManager
      Release an allocated machine.
      Specified by:
      releaseMachine in interface MachineManager
      Parameters:
      machine - The machine handle
    • setMachinePower

      public void setMachinePower(SpinnakerMachine machine, boolean powerOn)
      Description copied from interface: MachineManager
      Turn a machine on or off.
      Specified by:
      setMachinePower in interface MachineManager
      Parameters:
      machine - The machine handle
      powerOn - True to power a machine on, false to turn it off.
    • getChipCoordinates

      public ChipCoordinates getChipCoordinates(SpinnakerMachine machine, int x, int y)
      Description copied from interface: MachineManager
      Find a chip on a machine.
      Specified by:
      getChipCoordinates in interface MachineManager
      Parameters:
      machine - The machine handle
      x - The virtual X coordinate of the chip
      y - The virtual Y coordinate of the chip
      Returns:
      The chip location description