When to use OpenMP directives?

If some section of your code can be parallelized and you have more than one processor, you should definitely speed up the execution of your program using OpenMP directives.

In short, before using OpenMP, you need to take a look at the following:

  • profile your code
  • determine the sections where the most time is spent and see if it can be parallelized
  • use Amdahl's Law to determine potential speed up
  • put directives in the code and measure run times on serial and parallel runs

Read the full article for further details
This is a companion discussion topic for the original entry at http://iq.opengenus.org/when-to-use-openmp-directives/