主要内容

MapReducer

Define execution environment for mapreduce or tall arrays

Description

example

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®会议。MapReduceris a configuration function that changes how MATLAB executesMapReducealgorithms 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™。如果安装了并行计算工具箱,则使用tall或者MapReduce功能MATLAB会自动启动并行的工人池(除非您更改了默认的首选项)。

Note

If no toolboxes are available, thenMapReducealgorithms and tall array calculations automatically run using the local MATLAB session, and it is unnecessary to specify configuration settings usingMapReducer使用这些功能。但是,如果您具有并行计算工具箱,MATLAB Parallel Server, orMATLAB Compiler, then additionalMapReducerconfiguration options are available for running in parallel or deployed environments.

For more information, seeMapReducer(Parallel Computing Toolbox)在里面Parallel Computing Toolbox documentation, orMapReducer(MATLAB Compiler)在里面MATLAB Compiler文档。

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,先生

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

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

Examples

collapse all

The command

MapReducer

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

MapReducer(0)

要查询当前的全局执行环境,请使用命令

GCMR

Output Arguments

collapse all

Execution environment, returned as a MapReducer object.

If theObjectVisibilityproperty of先生被设定为'On'(the default), then先生定义所有人的执行环境MapReducealgorithms and tall array calculations. You can optionally pass先生to theMapReducefunction to explicitly specify the execution environment, even if itsObjectVisibilityproperty is set to'Off'

Tips

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

Extended Capabilities

Version History

在R2014b中引入