Using Parallel Reference Code Generation with Embedded Coder

15 visualizzazioni (ultimi 30 giorni)
Hi all,
I am looking to speed up my code gen. I have a large model with several reference models, each of which has references of its own. I checked "Enable parallel model reference builds" to see if I'd get a speed boost. It said I had 6 workers, and I did see a lot of models being built in parallel. However, my overall time was nearly the same as before.
Any tips on what I may do to improve that?
Thanks!

Risposte (1)

Hornett
Hornett il 18 Set 2024
To improve code generation speed for a large Simulink model with nested model references, even after enabling parallel builds, consider the following strategies:
  1. Optimize Model Structure: Review the granularity of your model references. Sometimes, too many small model references can lead to overhead that offsets the benefits of parallel builds. Consolidating smaller models or adjusting the hierarchy can sometimes yield better parallelization and efficiency.
  2. Code Generation Settings: Explore other code generation options in the Configuration Parameters dialog. For instance, enabling or tweaking settings related to code reuse, data type replacement, or inline parameters can impact build times.
  3. Incremental Builds: Ensure incremental code generation is enabled to avoid rebuilding unchanged parts.
  4. Local Storage: Use a local drive instead of a network file system to reduce latency.
  5. Build Profiling: Use Simulink's profiling tools to analyze where the code generation process is spending most of its time. Identifying bottlenecks can help you target specific areas for optimization.
Combining these strategies can help achieve significant improvements in code generation times.
Hope it helps!

Categorie

Scopri di più su Simulink Coder in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by