Parallel for loop

  • Inside a parallel region, the following compiler directive can be used to parallelize a for-loop:

#pragma omp for
  • Clauses can be added, such as
    • schedule(static, chunk size)
    • schedule(dynamic, chunk size)
    • schedule(guided, chunk size) (non-deterministic allocation)
    • schedule(runtime)
    • private(list of variables)
    • reduction(operator:variable)
    • nowait