How to Run Simulink Simulations Faster Using Dataflow
Learn how to run Simulink® simulations faster using dataflow. Dataflow is a new execution domain that allows parallel simulation of computationally intensive applications modeled in Simulink.
This video outlines how to enable the dataflow execution domain and speed up your simulation using multiple cores.
Published: 21 Jun 2020
Hi, I'm Katalin, software development manager in the Simulink Core development team. I'm going to show you a quick video about how to make Simulink simulations faster using dataflow. Dataflow is a new execution domain that enables better simulation using multiple cores for computational intensive applications. The example model simulates a communications system containing three receivers.
The top receiver performs hard decision demodulation and decoding. The second receiver has a demodulator configured to compute LLRs, followed by self-decision decoding. And the third receiver also includes an LLR demodulator, but it's using unquantized decoding. Let's simulate the model and measure its execution time in order to have a baseline to see how much faster we can go. I am using tic toc commands to measure the simulation time. While the simulation is running, you can see the BER performance computed for each receiver and displayed in the display blocks.
The simulation finished, and it took about 20 seconds. In order to make the simulation faster, you can use Dataflow execution domain. For that, select the subsystem that models the receivers. Open the Property Inspector, go to the Execution tab, and set the execution domain to be Dataflow. Now, the subsystem is configured for Dataflow domain. After that, you can open the Dataflow assistant and click on Analyze. This action analyzes the model, profiles it to calculate the execution time of each block, finds existing parallelism in the model, and partitions it into multiple threads.
It also suggests a latency value for further increasing the simulation throughput by pipelining the execution of the blocks. Let's accept the suggested latency value. Now we can resimulate the model. See, again, the BER performance results being calculated for each receiver. Meanwhile, the simulation finished, and it took about 7.5 seconds by running it using multiple threads on multiple cores, which is almost a three times speed up from the previous simulation.
So I showed you how to speed up simulation of a model using multiple cores and Dataflow domain. For further information, you can try one of the examples included in a product that are linked below. For additional tools to improve model simulation time, check out the Simulink performance advisor also linked below. Thanks for watching.