This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

parallel.Future

Request function execution on parallel pool workers or MATLAB client

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
parallel.AfterAllFutureafterAll future instance
parallel.AfterEachFutureafterEach 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 parallel.FevalOnAllFuture represents a function to be executed on every worker in a parallel pool. It is created when you call the parfevalOnAll function.

parallel.AfterAllFuture represents an instance of a single function to be executed after all parallel.Future provided to afterAll complete. It is created when you call the afterAll function.

parallel.AfterEachFuture represents a function to be executed after each parallel.Future provided to afterEach complete. It is created when you call the afterEach function.

parallel.Future objects are local objects 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 all parallel.Future objects.

MethodDescription
afterAllSpecify a function to invoke after all parallel.Future complete
afterEachSpecify a function to invoke after each parallel.Future completes
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 all parallel.Future objects.

PropertyDescription
CreateDateTimeDate and time when this future was created
DiaryText produced by execution of function (FevalFuture and FevalOnAllFuture only)
ErrorError information
FinishDateTimeDate and time when this future finished running
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 (FevalFuture and FevalOnAllFuture only)
ReadIndication if outputs have been read by fetchNext or fetchOutputs (FevalFuture only)
StartDateTimeDate and time when this future started running
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
help parallel.AfterAllFuture
help parallel.AfterEachFuture

Introduced in R2013b