Task-Based Execution of Nested OpenMP Loops

In this work we propose a novel technique to reduce the overheads related to nested parallel loops in OpenMP programs. In particular we show that in many cases it is possible to replace the code of a nested parallel-for loop with equivalent code that creates tasks instead of threads, thereby limiting parallelism levels while allowing more opportunities for runtime load balancing. In addition we present the details of an implementation of this technique that is able to perform the whole procedure completely transparently. We have experimented extensively to determine the effectiveness of our methods. The results show the actual performance gains we obtain (up to 25% in a particular application) as compared to other OpenMP implementations that are forced to suffer nested parallelism overheads.