Request function execution on parallel pool workers
Parent | parallel.Pool.FevalQueue |
The following table describes the available types of future objects.
Future Type | Description |
---|---|
parallel.FevalFuture | Single parfeval future instance |
parallel.FevalOnAllFuture | parfevalOnAll future instance |
A parallel.FevalFuture represents a single instance of a function
to be executed on a worker in a parallel pool. It is created when
you call the parfeval
function. To create multiple
FevalFutures, call parfeval
multiple times; for
example, you can create a vector of FevalFutures in a for
-loop.
An FevalOnAllFuture represents a function to be executed on
every worker in a parallel pool. It is created when you call the parfevalOnAll
function.
Either type of parallel.Future object is a local object and can be accessed only in the MATLAB® session that created it.
Future objects have the following methods. Note that some exist only for parallel.FevalFuture objects, not parallel.FevalOnAllFuture objects.
Method | Description |
---|---|
cancel | Cancel queued or running future |
fetchNext | Retrieve next available unread future outputs (FevalFuture only) |
fetchOutputs | Retrieve all outputs of future |
isequal | True if futures have same ID (FevalFuture only) |
wait | Wait for futures to complete |
Future objects have the following properties. Note that some exist only for parallel.FevalFuture objects, not parallel.FevalOnAllFuture objects.
Property | Description |
---|---|
Diary | Text produced by execution of function |
Error | Error information |
Function | Function to evaluate |
ID | Numeric identifier for this future |
InputArguments | Input arguments to function |
NumOutputArguments | Number of arguments returned by function |
OutputArguments | Output arguments from running function |
Parent | FevalQueue containing this future |
Read | Indication if outputs have been read by fetchNext or fetchOutputs (FevalFuture
only) |
State | Current state of future |
To get further help on either type of parallel.Future object, including a list of links to help for its properties, type:
help parallel.FevalFuture help parallel.FevalOnAllFuture