mapreducer
Define execution environment for mapreduce or tall arrays
Syntax
Description
mapreducer
, with no arguments, sets the global execution environment to be the default: a parallel pool if you have Parallel Computing Toolbox™ available, or else the local MATLAB®session.mapreducer
is a configuration function that changes how MATLAB executesmapreduce
algorithms and tall array calculations. Use this function to set, change, or store the execution environment to leverage Parallel Computing Toolbox,MATLAB Parallel Server™, orMATLAB Compiler™。If you have Parallel Computing Toolbox installed, then when you use thetall
ormapreduce
functions MATLAB automatically starts a parallel pool of workers (unless you have changed the default preferences).
Note
If no toolboxes are available, thenmapreduce
algorithms and tall array calculations automatically run using the local MATLAB session, and it is unnecessary to specify configuration settings usingmapreducer
to use these features. However, if you have Parallel Computing Toolbox,MATLAB Parallel Server, orMATLAB Compiler, then additionalmapreducer
configuration options are available for running in parallel or deployed environments.
For more information, seemapreducer
(Parallel Computing Toolbox)in the Parallel Computing Toolbox documentation, ormapreducer
(MATLAB Compiler)in theMATLAB Compilerdocumentation.
mapreducer(0)
sets the global execution environment to be the local MATLAB session.
mapreducer(
sets the global execution environment using a previously created MapReducer object,mr
)mr
。
also returns a MapReducer object using any of the previous syntaxes. You can usemr
= mapreducer(___)mr
as a fourth input argument tomapreduce
when you want to explicitly specify the execution environment.
toggles the visibility of MapReducer objectmr
= mapreducer(___,'ObjectVisibility','Off')mr
。Use this syntax to create new MapReducer objects without affecting the global execution environment.
Examples
Output Arguments
Tips
When working with tall arrays, use
mapreducer
to set the execution environment prior to creating the tall array withtall(ds)
。Tall arrays are bound to the current global execution environment when they are constructed. If the global execution environment is subsequently changed, then the tall array becomes invalid and must be reconstructed.