Task-Based Execution of Nested OpenMP Loops

  • Spiros N. Agathos
  • Panagiotis E. Hadjidoukas
  • Vassilios V. Dimakopoulos
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7312)


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.


OpenMP nested parallelism runtime system tasks worksharing constructs 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Agathos, S.N., Hadjidoukas, P.E., Dimakopoulos, V.V.: Design and Implementation of OpenMP Tasks in the OMPi Compiler. In: Proc. of 15th Panhellenic Conference on Informatics, PCI 2011, pp. 265–269. IEEE, Kastoria (2011)CrossRefGoogle Scholar
  2. 2.
    Blumofe, R.D., Joerg, C.F., Kuszmaul, B.C., Leiserson, C.E., Randall, K.H., Zhou, Y.: Cilk: An efficient multithreaded runtime system. J. Parallel Distrib. Comput. 37(1), 55–69 (1996)CrossRefGoogle Scholar
  3. 3.
    Bull, J.M.: Measuring Synchronisation and Scheduling Overheads in OpenMP. In: Proc. of 1st European Workshop on OpenMP, EWOMP, pp. 99–105. Lund, Sweden (September 1999)Google Scholar
  4. 4.
    Dimakopoulos, V.V., Leontiadis, E., Tzoumas, G.: A portable C compiler for OpenMP V.2.0. In: Proc. of 5th European Workshop on OpenMP, EWOMP 2003, Aachen, Germany, pp. 5–11 (September 2003)Google Scholar
  5. 5.
    Hadjidoukas, P.E., Dimakopoulos, V.V., Delakis, M., Garcia, C.: A high-performance face detection system using OpenMP. Concurrency and Computation: Practice and Experience 21, 1819–1837 (2009)CrossRefGoogle Scholar
  6. 6.
    Hadjidoukas, P.E., Dimakopoulos, V.V.: Nested Parallelism in the OMPi OpenMP/C Compiler. In: Kermarrec, A.-M., Bougé, L., Priol, T. (eds.) Euro-Par 2007. LNCS, vol. 4641, pp. 662–671. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  7. 7.
    Leiserson, C.E.: The Cilk++ concurrency platform. J. of Supercomputing 51, 244–257 (2012)CrossRefGoogle Scholar
  8. 8.
    OpenMP ARB: OpenMP Application Program Interface V3.0 (May 2008)Google Scholar
  9. 9.
    OpenMP ARB: OpenMP Application Program Interface V3.1 (July 2011)Google Scholar
  10. 10.
    Reinders, J.: Intel threading building blocks, 1st edn. O’Reilly & Associates, Inc., Sebastopol (2007)Google Scholar
  11. 11.
    Rowley, H., Baluja, S., Kanade, T.: Neural network-based face detection. IEEE Trans. on Pattern Analysis and Machine Intelligence 20, 23–28 (1998)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2012

Authors and Affiliations

  • Spiros N. Agathos
    • 1
  • Panagiotis E. Hadjidoukas
    • 1
  • Vassilios V. Dimakopoulos
    • 1
  1. 1.Department of Computer ScienceUniversity of IoanninaIoanninaGreece

Personalised recommendations