Class SpallocJavaMachineManagerImpl
java.lang.Object
uk.ac.manchester.spinnaker.nmpi.machinemanager.SpallocJavaMachineManagerImpl
- All Implemented Interfaces:
AutoCloseable,MachineManager
A machine manager that interfaces to the new spalloc service.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()getChipCoordinates(SpinnakerMachine machine, int x, int y) Find a chip on a machine.Gets the machines that this manager allocates from.getNextAvailableMachine(int nBoards, String owner, int jobId) Get the next available machine of a given size.booleanisMachineAvailable(SpinnakerMachine machine) Test if a specific machine is available.voidreleaseMachine(SpinnakerMachine machine) Release an allocated machine.voidsetMachinePower(SpinnakerMachine machine, boolean powerOn) Turn a machine on or off.booleanwaitForMachineStateChange(SpinnakerMachine machine, int waitTime) Wait for the machine's availability to change.
-
Constructor Details
-
SpallocJavaMachineManagerImpl
public SpallocJavaMachineManagerImpl()
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
getMachines
Description copied from interface:MachineManagerGets the machines that this manager allocates from.- Specified by:
getMachinesin interfaceMachineManager- Returns:
- collection of machines
- Throws:
IOException- if there is communication error.
-
getNextAvailableMachine
Description copied from interface:MachineManagerGet the next available machine of a given size.- Specified by:
getNextAvailableMachinein interfaceMachineManager- 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
Description copied from interface:MachineManagerTest if a specific machine is available.- Specified by:
isMachineAvailablein interfaceMachineManager- Parameters:
machine- The machine handle- Returns:
- true if the machine is available.
-
waitForMachineStateChange
Description copied from interface:MachineManagerWait for the machine's availability to change.- Specified by:
waitForMachineStateChangein interfaceMachineManager- Parameters:
machine- The machine handlewaitTime- Maximum wait time (in milliseconds)- Returns:
- Whether the machine state has changed.
-
releaseMachine
Description copied from interface:MachineManagerRelease an allocated machine.- Specified by:
releaseMachinein interfaceMachineManager- Parameters:
machine- The machine handle
-
setMachinePower
Description copied from interface:MachineManagerTurn a machine on or off.- Specified by:
setMachinePowerin interfaceMachineManager- Parameters:
machine- The machine handlepowerOn- True to power a machine on, false to turn it off.
-
getChipCoordinates
Description copied from interface:MachineManagerFind a chip on a machine.- Specified by:
getChipCoordinatesin interfaceMachineManager- Parameters:
machine- The machine handlex- The virtual X coordinate of the chipy- The virtual Y coordinate of the chip- Returns:
- The chip location description
-