Visualization Tools Aid Multi-core Development Print E-mail
Jun 05 2007
advertisement:

Visualize Multi-Core Behavior

Hardware breakpoints are great for debugging serial code. Stop the system, look at the stack, read the registers and verify the computation is correct. But understanding multi-core behavior is beyond the reach of traditional debug and profiling tools, which primarily detect problems within single programs. With conventional tools, multi-core system developers have to gather information separately from each core and then somehow combine the information for analysis.

Multi-core tools give developers greater insight into the dynamic interactions between cores, typically using visualization. This provides a powerful picture of behavior because it’s easier to see workload balance, contention, and race conditions.

To take advantage of the true hardware parallelism offered by multi-core processors, software developers have to split up their computations into separate threads that run concurrently. Task-parallel threads are independent code sequences that can run simultaneously. Data-parallel threads are code sequences that perform the same computation over and over on a set of data, such as dimming all of the pixels on an LCD display. When an operation is divided into threads and then distributed over multiple cores, it normally executes much faster than when it runs sequentially on one core.

Workload Balance

Click to enlarge
Figure 1. The QNX Momentics System Profiler Displaying CPU Usage By Thread and Overall CPU Utilization

Click to enlarge
Click to enlarge
Figure 2. The QNX Momentics System Profiler Displaying CPU Usage and Task Migrations

Click to enlarge
The most fundamental benefit from using visual multi-core tools is understanding how the workload is distributed among the cores. Normally, developers want to balance the workload to maximize the compute performance of the system – all cores pulling their own weight. Unique situations may warrant keeping a core lightly loaded so it responds faster to time-critical code, like interrupt servicing. For either case, it’s important to have a tool that clearly displays core usage and shows which threads are running on each core.

In Figure 1, the right screenshot shows the QNX Momentics System Profiler displaying the CPU usage of four cores executing an application over a 22 millisecond time interval. This macro-level perspective helps identify opportunities to balance the workload across the system. The left screenshot displays the names of different threads and how much time they spend running on each core. Four threads are highlighted in the bottom half of the shot, and the CPU cycles they consume are shown in the top half.

Thread migrations are shown in Figure 2, along with a migration histogram. In conjunction with Figure 1, one can detect whether a thread is efficiently taking advantage of the CPU cycles of all the cores or is perhaps incessantly thrashing among them. Again, this type of visual information helps developers control utilization of key system resources.


 

Dedicated to helping you design better products in a digital world... your guide to the latest tools & techniques for digital prototyping, simulation, and analysis of the real-world performance of your ideas.

Visit the Digital Design Center

>> Most Searched

>> Newsletter

Subscribe today to receive the INSIDER, a FREE e-mail newsletter from NASA Tech Briefs featuring exclusive previews of upcoming articles, late breaking NASA and industry news, hot products and design ideas, links to online resources, and much more.

Your name:

Your email:

Please Subscribe me to the Insider