Composite
Create Composite object
Description
Note
Composite
variables are typically created on the client when
values are returned from the body of an spmd
statement.
Therefore, you rarely need to create Composite
objects directly. For
more information about working with Composite
arrays, see Composites.
creates a C
= Composite()Composite
object on the client using workers from the parallel pool.
A Composite
object contains references to arrays stored on parallel
workers and can contain a different value on each worker. A Composite
object has one entry for each worker; initially each entry contains no data. Entries can
contain different values on each worker. Values can be retrieved using cell-array
indexing. Use either indexing or an spmd
block to define values for the
entries. The actual data on the workers remains available on the workers for subsequent
spmd
execution, so long as the Composite
exists on
the client and the parallel pool remains.
The actual number of workers referenced by the Composite
object
depends on the size of the pool and any existing Composite
objects.
To construct a Composite
object manually, you must do so outside of
any spmd
statements.
creates a C
= Composite(nworkers
)Composite
object on the number of workers in the parallel pool
that matches the specified constraint. nworkers
must be a vector of
length 1
or 2
, containing integers or
Inf
. If nworkers
is of length
1
, it specifies the exact number of workers to use. If
nworkers
is of length 2
, it specifies the minimum
and maximum number of workers to use. The actual number of workers used is the maximum
number of workers compatible with the size of the parallel pool, and with any other
existing Composite
objects. MATLAB® produces an error if the constraints on the number of workers cannot be
met.
Examples
Input Arguments
Output Arguments
Tips
A
Composite
object is created on the workers of the existing parallel pool. If no pool exists, theComposite
function starts a new parallel pool, unless the automatic starting of pools is disabled in your parallel preferences. If there is no parallel pool andComposite
cannot start one, the result is a 1-by-1Composite
object in the client workspace.
Version History
Introduced in R2008a