Main Content

Generate parallel for-loops

Optimization for parallel for-loops

Model Configuration Pane: Code Generation / Optimization

Description

Specify, whether for-loops in the generated code are implemented in parallel for the MATLAB Function block, the MATLAB System block, and the For Each Subsystem block with large input data sizes. The MATLAB Function block and MATLAB System block are executed in parallel when the MATLAB code contains parfor-loops instead of traditional for-loops. This parameter also enables Automatically schedule for-loops.

Category: Optimization

Dependencies

This parameter requires that Parallel Computing Toolbox™ be installed.

Settings

off (default) | on
On

Executes OpenMP parallel for-loops by using multiple threads.

Off

Executes for-loops using a single thread.

Recommended Settings

ApplicationSetting
DebuggingOff
TraceabilityOff
EfficiencyOn (execution speed)
Safety precautionNo impact

Programmatic Use

Parameter: MultiThreadedLoops
Type: character vector
Value: 'on' | 'off'
Default: 'off'

Version History

Introduced in R2019a