parallel.Future

Request function execution on parallel pool workers

Constructors

parfeval, parfevalOnAll

Container Hierarchy

Parent

parallel.Pool.FevalQueue

Types

The following table describes the available types of future objects.

Future TypeDescription
parallel.FevalFutureSingle parfeval future instance
parallel.FevalOnAllFutureparfevalOnAll future instance

Description

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.

Methods

Future objects have the following methods. Note that some exist only for parallel.FevalFuture objects, not parallel.FevalOnAllFuture objects.

MethodDescription
cancelCancel queued or running future
fetchNextRetrieve next available unread future outputs (FevalFuture only)
fetchOutputsRetrieve all outputs of future
isequalTrue if futures have same ID (FevalFuture only)
waitWait for futures to complete

Properties

Future objects have the following properties. Note that some exist only for parallel.FevalFuture objects, not parallel.FevalOnAllFuture objects.

PropertyDescription
DiaryText produced by execution of function
ErrorError information
FunctionFunction to evaluate
IDNumeric identifier for this future
InputArgumentsInput arguments to function
NumOutputArgumentsNumber of arguments returned by function
OutputArgumentsOutput arguments from running function
ParentFevalQueue containing this future
ReadIndication if outputs have been read by fetchNext or fetchOutputs (FevalFuture only)
StateCurrent state of future

Help

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

Introduced in R2013b

Was this topic helpful?