Skip to content

Latest commit

 

History

History

reduction

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Reduction and critical

Fix the model "solution" of the previous exercise that still contains a race condition (sum.cpp or sum.F90).

  1. Use reduction clause to compute the sum correctly.

  2. (Bonus) Implement an alternative version where each thread computes its own part to a private variable and the use a critical section after the loop to compute the global sum.

Try to compile and run your code also without OpenMP.