Intel® Advisor 2013 Help

Input Data, Execution Time, and Code Coverage

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:

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.

See Also


Submit feedback on this help topic