Class SpallocMachineManagerImpl
java.lang.Object
uk.ac.manchester.spinnaker.nmpi.machinemanager.SpallocMachineManagerImpl
- All Implemented Interfaces:
AutoCloseable
,MachineManager
public class SpallocMachineManagerImpl extends Object implements MachineManager
A machine manager that interfaces to the old spalloc service.
-
Constructor Summary
Constructors Constructor Description SpallocMachineManagerImpl()
Make a machine manager that talks to Spalloc to do its work. -
Method Summary
Modifier and Type Method Description void
close()
ChipCoordinates
getChipCoordinates(SpinnakerMachine machine, int x, int y)
Find a chip on a machine.List<SpinnakerMachine>
getMachines()
Gets the machines that this manager allocates from.SpinnakerMachine
getNextAvailableMachine(int nBoards, String jobOwner, int jobId)
Get the next available machine of a given size.boolean
isMachineAvailable(SpinnakerMachine machine)
Test if a specific machine is available.void
releaseMachine(SpinnakerMachine machine)
Release an allocated machine.void
setMachinePower(SpinnakerMachine machine, boolean powerOn)
Turn a machine on or off.boolean
waitForMachineStateChange(SpinnakerMachine machine, int waitTime)
Wait for the machine's availability to change.
-
Constructor Details
-
SpallocMachineManagerImpl
public SpallocMachineManagerImpl()Make a machine manager that talks to Spalloc to do its work.
-
-
Method Details
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
getMachines
Description copied from interface:MachineManager
Gets the machines that this manager allocates from.- Specified by:
getMachines
in interfaceMachineManager
- Returns:
- collection of machines
-
getNextAvailableMachine
Description copied from interface:MachineManager
Get the next available machine of a given size.- Specified by:
getNextAvailableMachine
in interfaceMachineManager
- Parameters:
nBoards
- The (minimum) number of boards that the machine needs to have.jobOwner
- The owner of the job.jobId
- The ID of the NMPI job.- Returns:
- a machine.
-
releaseMachine
Description copied from interface:MachineManager
Release an allocated machine.- Specified by:
releaseMachine
in interfaceMachineManager
- Parameters:
machine
- The machine handle
-
isMachineAvailable
Description copied from interface:MachineManager
Test if a specific machine is available.- Specified by:
isMachineAvailable
in interfaceMachineManager
- Parameters:
machine
- The machine handle- Returns:
- true if the machine is available.
-
waitForMachineStateChange
Description copied from interface:MachineManager
Wait for the machine's availability to change.- Specified by:
waitForMachineStateChange
in interfaceMachineManager
- Parameters:
machine
- The machine handlewaitTime
- Maximum wait time (in milliseconds)- Returns:
- Whether the machine state has changed.
-
setMachinePower
Description copied from interface:MachineManager
Turn a machine on or off.- Specified by:
setMachinePower
in interfaceMachineManager
- Parameters:
machine
- The machine handlepowerOn
- True to power a machine on, false to turn it off.
-
getChipCoordinates
Description copied from interface:MachineManager
Find a chip on a machine.- Specified by:
getChipCoordinates
in 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
-