Definition
The reduction clause indicates that the variables passed are, as its name suggests, used in a reduction. Each implicit task or SIMD lane creates a private copy initialises it to the initialiser value of the reduction identifier, that is, 0 for a sum or 1 for a product to name a few. After the end of the region, the original list item is updated with the values of the private copies using the combiner associated with the reduction identifier.
By default, the reduction computation is complete at the end of the construct. However, if nowait is specified on the construct, this is no longer guaranteed. Indeed, accesses to the original list item will create a data race and, thus, have unspecified effect unless synchronisation ensures that they occur after all threads have executed all of their iterations or section constructs, and the reduction computation has completed and stored the computed value of that list item. This can most simply be ensured through a barrier synchronisation.
reduction([modifier, ]identifier: list)