Class SpallocJob

java.lang.Object
uk.ac.manchester.spinnaker.spalloc.SpallocJob
All Implemented Interfaces:
AutoCloseable, SpallocJobAPI

public class SpallocJob
extends Object
implements AutoCloseable, SpallocJobAPI
A high-level interface for requesting and managing allocations of SpiNNaker boards.

Constructing a SpallocJob object connects to a spalloc-server and requests a number of SpiNNaker boards. The job object may then be used to monitor the state of the request, control the boards allocated and determine their IP addresses.

In its simplest form, a SpallocJob can be used as a context manager like so:

 try (var j = new SpallocJob(new CreateJob(6).owner(me))) {
     myApplication.boot(j.getHostname(), j.getDimensions());
     myApplication.run(j.getHostname());
 }
 
In this example a six-board machine is requested and the try-with-resources context is entered once the allocation has been made and the allocated boards are fully powered on. When control leaves the block, the job is destroyed and the boards shut down by the server ready for another job.

For more fine-grained control, the same functionality is available via various methods:

 var j = new SpallocJob(new CreateJob(6).owner(me)));
 j.waitUntilReady();
 myApplication.boot(j.getHostname(), j.getDimensions());
 myApplication.run(j.getHostname());
 j.destroy();
 
Note:
More complex applications may wish to log the following properties of their job to support later debugging efforts:
  • ID — May be used to query the state of the job and find out its fate if cancelled or destroyed. The spalloc-job command can be used to discover the state/fate of the job and spalloc-where-is may be used to find out what boards problem chips reside on.
  • machineName and boards together give a complete record of the hardware used by the job. The spalloc-where-is command may be used to find out the physical locations of the boards used.
See Also:
: How to describe the job to create.