Intel® Advisor 2013 Help
When you run your program with the Dependencies tool
, it is very important that you choose appropriate input data for the specified parallel sites. There are two concerns:
Execution time: Running the Dependencies tool is expensive. A program may take 50 to hundreds of times longer to run than it does normally. For example, if you run your program with an input data set that would normally take 25 minutes to process, the Dependencies tool may take a day or more to run your program. The Dependencies tool only collects data as it executes within the parallel sites. To minimize increased program run times, choose input data sets that minimize the number of instructions executed within a parallel site while thoroughly exercising your program's control flow paths. For example, the same data sharing problem will be detected whether you execute a loop once or a million times - but executing a loop a million times takes much longer.
Code coverage: It is even more important to choose input data that will cause most of the code within the parallel sites to be executed with the same sort of control flow as when it is processing real data. The Dependencies tool is an excellent tool, but it is not magic. The only information that Intel Advisor has about your program comes from watching the data accessed by the code executed within parallel sites, including interleaved parallel operations within parallel tasks. It can find potential conflicts, but only between operations that are executed.
For example, consider this code:
int best_thing(thing *array, int size) { int best = array[0]; ANNOTATE_SITE_BEGIN(site_array); for (int i = 1; i < size; ++i) { ANNOTATE_ITERATION_TASK(task_array); if (better(array[i], array[best])) best = array[i]; } ANNOTATE_SITE_END(); return best; }
This code has a potential conflict between the write to best in one task and the write to best in any other task, and a potential conflict between the read of best in one task and the write to best in any other task. Intel Advisor will report these conflicts - if the write to best is executed.
But what will happen if, with the input data provided for the Dependencies tool run, the first thing in the array is the best thing? In that case, there will be no writes to best executed in any iteration of the loop. Since the Dependencies tool will not see any writes to best, it will not be able to report the potential conflicts.
So, you should choose input data for your Dependencies run that will thoroughly exercise your program's control flow paths, but will not make your program run any longer than necessary.