Ask a questionAsk a question
 

Answerload balancing

  • Wednesday, October 21, 2009 8:56 AMAyseA Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I need a good tutorial about load balancing for complex nested loops.
    can somebody help me?

Answers

  • Saturday, October 24, 2009 1:34 PMrickmolloyMSFT, OwnerUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Assuming you are using OpenMP as suggested by your previous posts, you should read the documentation for omp_set_nested.  Essentially if you have a nested parallel for loop in OpenMP you will have some peculiarities because the options in OpenMP are to provide full parallelism for the nested loop or to serialize the nested parallel loop and you will likely benefit from flattening the two loops into one if you must use OpenMP.

    If you are using Visual Studio 2010 Beta2 I'd advise you to look at parallel_for in ppl.h. ConcRT and the PPL have been designed to run well with nested parallel loops so you don't have to worry about performance as much. 

    Rick Molloy Parallel Computing Platform : http://blogs.msdn.com/nativeconcurrency http://parallelroads.com/blog

All Replies

  • Saturday, October 24, 2009 1:34 PMrickmolloyMSFT, OwnerUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Assuming you are using OpenMP as suggested by your previous posts, you should read the documentation for omp_set_nested.  Essentially if you have a nested parallel for loop in OpenMP you will have some peculiarities because the options in OpenMP are to provide full parallelism for the nested loop or to serialize the nested parallel loop and you will likely benefit from flattening the two loops into one if you must use OpenMP.

    If you are using Visual Studio 2010 Beta2 I'd advise you to look at parallel_for in ppl.h. ConcRT and the PPL have been designed to run well with nested parallel loops so you don't have to worry about performance as much. 

    Rick Molloy Parallel Computing Platform : http://blogs.msdn.com/nativeconcurrency http://parallelroads.com/blog