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.


Define execution environment for mapreduce or tall arrays


mr = mapreducer(___)
mr = mapreducer(___,'ObjectVisibility','Off')


mapreducer, with no arguments, sets the global execution environment to be the default (SerialMapReducer in MATLAB®).

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 Distributed Computing Server™, or MATLAB Compiler™.


In MATLAB, mapreduce algorithms and tall array calculations automatically run using a SerialMapReducer, and it is unnecessary to specify configuration settings using mapreducer to use these features. However, if you have Parallel Computing Toolbox, MATLAB Distributed Computing Server, or MATLAB Compiler, then additional mapreducer configuration options are available for running in parallel or deployed environments.

For more information, see mapreducer in the Parallel Computing Toolbox documentation, or mapreducer in the MATLAB Compiler documentation.

mapreducer(0) sets the global execution environment to be the local MATLAB session.

mapreducer(mr) sets the global execution environment using a previously created MapReducer object, mr.

mr = mapreducer(___) also returns a MapReducer object using any of the previous syntaxes. You can use mr as a fourth input argument to mapreduce when you want to explicitly specify the execution environment.

mr = mapreducer(___,'ObjectVisibility','Off') toggles the visibility of MapReducer object mr. Use this syntax to create new MapReducer objects without affecting the global execution environment.

Output Arguments

collapse all

Execution environment, returned as a MapReducer object.

If the ObjectVisibility property of mr is set to 'On' (the default), then mr defines the execution environment for all mapreduce algorithms and tall array calculations. You can optionally pass mr to the mapreduce function to explicitly specify the execution environment, even if its ObjectVisibility property is set to 'Off'.


  • When working with tall arrays, use mapreducer to set the execution environment prior to creating the tall array with tall(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.

Introduced in R2014b

Was this topic helpful?