Several Sfunction or one is better?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
My next Simulink project can be:
- one S-function with all the comnplexity inside
- several S-function with an easy to debug situation ..
Of course I'd like to divide the problem in easy to solve small problems, but the question is:
will a lot of S-function turn my simulation in a slaw, useless design? Or several S-function will be exectuted in different core of the processor (if possible, due to the parallelism of my design) or at lest should reduce the speed as little as I even don't appreciate it?
Thanks
2 comentarios
Walter Roberson
el 1 de Nov. de 2021
Simulink itself cannot execute different blocks in parallel.
If I understand correctly, Simulink Real Time (the one deployed to SpeedGoat systems) can execute blocks in parallel.
In places, Simulink might need to solve algebraic equations between blocks, potentially using linear algebra. When running with Rapid Acceleration turned off, or with Rapid Acceleration on its lowest setting, those operations would be executed at the MATLAB level, using multiple cores. With Rapid Acceleration set to higher levels, so that Simulink is generating code, I do not know whether the generated code will take advantage of multiple cores (not something I have happened to have reason to investigate.)
Inside S functions coded in MATLAB, the same considerations would apply about multiple cores: math being done at the interpreter level could potentially use multiple cores, and I do not have information about whether generated code would use multiple cores or not.
Are you planning to deploy to Simulink Real Time ?
Respuestas (0)
Ver también
Categorías
Más información sobre Block and Blockset Authoring en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!