English | 中文 | Русский | Français
2,671 Posts served
8,464 Conversations started
One of the most useful aspects of Intel® Parallel Advisor Lite is its ability to model parallelism in my application without actually running the code in parallel. Simply by doing this modeling it can tell me potential race conditions and correctness issues while still running everything serially. At first glance I ask myself “Why do I need this modeling? Shouldn’t I just try the parallel code and let another tool, like Parallel Inspector, find the race conditions?”
Some parallel frameworks, like OpenMP, can parallelize my for loop with a single pragma. The fact of the matter is that this can work sometimes, but other times it may provide incorrect output data or crash my application before a tool like Inspector can find the race conditions. When this happens, it can be very difficult to debug. Crashes in parallel applications may occur non-deteministically and may not be repeatable. This type of bug can be very time consuming to find and correct. By using a modeler I can ensure that my serial testing framework will still work, and the output will be the same as a run without the modeler.
Here is an example of an application that works fine serially, but could crash if parallelized:
This code fills two arrays of integer pointers with the addresses of integers. One array points to integers in counting order, the other in reverse order. It then prints out the integers by dereferencing the pointers in the arrays. When run serially, this code works fine and prints the numbers 0-99 then 99-0. Without a modeler like Parallel Advisor Lite, I could add the #pragma (currently commented out) to parallelize the loop and let another tool check for races. However, this could crash my application. Since there is a data race on both index variables, some pointers may not be initialized. When they are dereferenced in the printing loops they may throw an exception and never allow my code to finish.
Thus, modeling parallelism as opposed to implementing it can be a very useful step in parallelizing serial code.
You can download a free copy of Parallel Advisor Lite and an evaluation copy of Intel® Parallel Studio to try them out.
