Skip to content

Latest commit

 

History

History
13 lines (9 loc) · 534 Bytes

README.md

File metadata and controls

13 lines (9 loc) · 534 Bytes

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.