Concurrent Execution support in SimWB

MLToolkit supports generating multi-threaded code that can be executed in multiple processors using Simulink feature called Concurrent Execution.

Concurrent execution of different parts of the model offers several advantages for Hardware-In-the-Loop (HIL) simulation such as:

  1. Bigger computing horsepower
    It is now possible to partition a big, complex, and computationally intensive model into smaller parts and execute them in different processors. This opens up many possibilities and allows the customers to utilize the modern multi-processor systems effectively.
  2. Simulate the effects of data dependency
    When executing different part of the model in different processors, there is an inherent delay in exchanging data. Concurrent execution allows the customers to simulate the effects before deploying the algorithm.
  3. Scalable
    Large monolithic models result in huge computational cost. Scalability of Concurrent execution allows more complex models to be executed in real-time.

For an overview of Concurrent Execution, please refer to the Simulink documentation.

Supported MATLAB® versions for Concurrent Execution

Configuring the models for Concurrent Execution support

When you generate code from a model, the MLToolkit automatically changes the model to have certain settings so that concurrent execution is possible. These settings can be configured either automatically or manually as explained below.

Automatic Configuration of the referenced models

To automatically configure all the referenced models in a top level model that is needed to be built for SimWB, please use the SimWB helper function named simwbConfigConcurExecution. For example, the command simwbConfigConcurExecution('SYS') configures all the models referenced in the model 'SYS' to work with MLToolkit and saves them. It also saves a backup copy of all those models be default. Additional arguments must be supplied as name-value pairs. Allowed names are:

Options are case-insensitive on all platforms.

Manually Configuring Concurrent Execution for both Top and referenced Models

For each model, you need to change the settings as explained below. Before completing individual settings, you need to convert the model configuration to support concurrent execution. For this, please see the Simulink documentation section named 'Creating a Concurrent Execution Configuration Set'. After converting the configuration to Concurrent Execution, you need to configure the settings listed below for the referenced models (used on the top model above) in order for the concurrent execution to work.

Limitations in Concurrent Execution Support

  1. The RTDB variables need to be manually configured by using the RTDBIn or RTDBOut blocks from MLToolkit library accessible by the command simwbSfunlib and should be inside the referenced models.
  2. You can not have multiple instances of models that have RTDB variables configured in them. You can still have multiple instances of models that do not have any RTDB variables.
  3. You need to generate code from MATLAB installed in Linux. Simulink does not generate Linux POSIX threads for its Windows version if you use GRT.

See Also