Products & Services Solutions Academia Support User Community Company

Learn more about Real-Time Workshop   

Reducing Build Time for Referenced Models

You can accelerate code generation and compilation for models containing large model reference hierarchies by building referenced models in parallel whenever possible. For example, you can distribute code generation and compilation for each model block across the cores of a multicore host computer.

To take advantage of this feature, you must have the Parallel Computing Toolbox software licensed and installed in your development environment. If the Parallel Computing Toolbox software is available and started with the matlabpool function, the Real-Time Workshop build process builds referenced models in parallel whenever possible.

For example, to use parallel building for a large model reference hierarchy on a desktop machine with four cores perform the following steps.

  1. In the MATLAB Command Window, enter

    matlabpool 4

    The Parallel Computing Toolbox software sets up a pool of four MATLAB workers, one for each core.

  2. Optionally, inspect the model reference hierarchy to determine, based on model dependencies, which models will be built in parallel. In the Simulink model window, select Tools > Model Dependencies > Model Dependency Viewer > Referenced Model Instances.

    A Model Dependency Viewer opens.

  3. Build your model.

    Messages in the MATLAB Command Window record when each parallel or serial build starts and finishes.

The performance gain realized by using parallel builds for referenced models depends on several factors, including how many models can be built in parallel for a given model referencing hierarchy, the size of the referenced models, and host machine attributes such as amount of RAM and number of cores.

Beyond performance benefits, the use of parallel builds for referenced models is transparent, with no differences in resulting code and directory structure between serial and parallel builds.

The following notes apply to using parallel builds for model reference hierarchies.

For information on how to configure a custom embedded target to support parallel builds, see Supporting Model Referencing in the Real-Time Workshop Embedded Coder Developing Embedded Targets documentation.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS