Define execution environment for mapreduce or tall arrays
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 executes
mapreduce algorithms and tall array
calculations. Use this function to set, change, or store the execution
environment to leverage Parallel Computing Toolbox, MATLAB
Parallel Server™, or MATLAB
Compiler™. If you have Parallel Computing Toolbox installed, then when you use the
mapreduce functions MATLAB automatically starts a parallel pool of workers (unless you have
changed the default preferences).
If no toolboxes are available, then
algorithms and tall array calculations automatically run using the local
MATLAB session, and it is unnecessary to specify configuration
mapreducer to use these features.
However, if you have Parallel Computing Toolbox, MATLAB
Parallel Server, or MATLAB
Compiler, then additional
configuration options are available for running in parallel or deployed
mapreducer(0) sets the global execution
environment to be the local MATLAB session.
the global execution environment using a previously created MapReducer
returns a MapReducer object using any of the previous syntaxes. You
mr = mapreducer(___)
mr as a fourth input argument to
you want to explicitly specify the execution environment.
the visibility of MapReducer object
mr = mapreducer(___,'ObjectVisibility','Off')
mr. Use this
syntax to create new MapReducer objects without affecting the global
automatically starts a parallel pool if Parallel Computing Toolbox is available. Otherwise, the execution environment is set to be the local MATLAB session.
You can force MATLAB to use the local session with the command
To query the current global execution environment, use the command
mr— Execution environment
Execution environment, returned as a MapReducer object.
ObjectVisibility property of
'On' (the default), then
the execution environment for all
and tall array calculations. You can optionally pass
mapreduce function to explicitly specify
the execution environment, even if its
is set to
When working with tall arrays, use
set the execution environment prior to creating the tall array with
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
If you have Parallel Computing Toolbox installed, when you use
mapreducer, MATLAB automatically opens a parallel pool of workers on your local machine.
Control parallel behavior with the parallel preferences, including scaling up to a
For details, see Run mapreduce on a Parallel Pool (Parallel Computing Toolbox) or Use Tall Arrays on a Parallel Pool (Parallel Computing Toolbox). For more general information about parallel computing, see Run MATLAB Functions with Automatic Parallel Support (Parallel Computing Toolbox).