Class ExecuteDataSpecification
java.lang.Object
uk.ac.manchester.spinnaker.front_end.BoardLocalSupport
uk.ac.manchester.spinnaker.front_end.dse.ExecuteDataSpecification
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
FastExecuteDataSpecification
,HostExecuteDataSpecification
public abstract class ExecuteDataSpecification extends BoardLocalSupport implements AutoCloseable
Common base for executing data specifications.
- Author:
- Donal Fellows
-
Nested Class Summary
Nested classes/interfaces inherited from class uk.ac.manchester.spinnaker.front_end.BoardLocalSupport
BoardLocalSupport.BoardLocal
-
Field Summary
Fields Modifier and Type Field Description protected DSEDatabaseEngine
db
The database. -
Constructor Summary
Constructors Modifier Constructor Description protected
ExecuteDataSpecification(TransceiverInterface txrx, Machine machine, DSEDatabaseEngine db)
-
Method Summary
Modifier and Type Method Description void
close()
protected void
processTasksInParallel(List<DSEStorage.Ethernet> tasks, Function<DSEStorage.Ethernet,BasicExecutor.SimpleCallable> mapper)
Run the tasks in parallel.
-
Field Details
-
db
The database.
-
-
Constructor Details
-
ExecuteDataSpecification
@MustBeClosed protected ExecuteDataSpecification(TransceiverInterface txrx, Machine machine, DSEDatabaseEngine db) throws IOException, ProcessException, InterruptedException, StorageException, URISyntaxException- Parameters:
txrx
- The transceiver for talking to the SpiNNaker machine.machine
- The description of the SpiNNaker machine.db
- The DSE database.- Throws:
IOException
- If the transceiver can't talk to its sockets.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If communications are interrupted.IllegalStateException
- If something really strange occurs with talking to the BMP; this constructor should not be doing that!StorageException
- If the database cannot be read.URISyntaxException
- If the proxy URI is specified but not valid.
-
-
Method Details
-
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
IOException
InterruptedException
-
processTasksInParallel
protected final void processTasksInParallel(List<DSEStorage.Ethernet> tasks, Function<DSEStorage.Ethernet,BasicExecutor.SimpleCallable> mapper) throws StorageException, IOException, ProcessException, InterruptedExceptionRun the tasks in parallel. Submits toexecutor
and detoxifies the exceptions.- Parameters:
tasks
- The tasks to run.mapper
- Gets how to implement a task.- Throws:
StorageException
- If the database can't be talked to.IOException
- If the transceiver can't talk to its sockets.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If communications are interrupted.IllegalStateException
- If an unexpected exception occurs in any of the parallel tasks.
-