Simulink ERT Codegen for (openMP) Parelel Run

13 views (last 30 days)
Kraker
Kraker on 12 Dec 2024 at 12:47
Edited: Kraker on 12 Dec 2024 at 12:49

Hi,
I have simulink model thats contains multiple reference models. One them has contionus time solver others have discrete sample.
C++ code(ERT config) is generated from simulink model witouth problem. Also code is builded in Visual studio and .exe is running properly. Both exe and simulink model giving same results.
I want to run model for different input for Monte Carlo analysis. Hence, i added for loop above to step function which changes inputs. It also works.
The issue here is that when I try parelel for loop (used omp lib, such as added "#pragma omp parelel for" ), it is running at different threads. However, for same inputs results are different.
Is there any way to make simulink generated code to run on parelel for loop with different inputs?

Answers (0)

Categories

Find more on Deployment, Integration, and Supported Hardware in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!