A reduction expression is an OpenMP stylized expression that is relevant to reduction clauses. It is either a combiner expression or an initializer expression.
Restrictions
Restrictions to reduction expressions are as follows:If execution of a reduction expression results in the execution of an OpenMP construct or an OpenMP API call, the behavior is unspecified.
A combiner expression specifies how a reduction combines partial results into a single value.
In the definition of a combiner expression, omp_in and omp_out correspond to two special variable identifiers that refer to storage of the type of the reduction list item to which the reduction applies. If the list item is an array or array section, the identifiers to which omp_in and omp_out correspond each refer to an array element. Each of the two special variable identifiers denotes one of the values to be combined before executing the combiner expression. The special omp_out identifier refers to the storage that holds the resulting combined value after executing the combiner expression. The number of times that the combiner expression is executed and the order of these executions for any reduction clause are unspecified.
If a generic name is used in a combiner expression and the list item in the corresponding reduction clause is an array or array section, it is resolved to the specific procedure that is elemental or only has scalar dummy arguments.
Restrictions
Restrictions to combiner expressions are as follows:The only variables allowed in a combiner expression are omp_in and omp_out.
An initializer expression determines the initializer for the private copies of reduction list items. If the initialization of the copies is not determined a priori, the syntax of an initializer expression is as follows:
or
or
or
In the definition of an initializer expression, the omp_priv special variable identifier refers to the storage to be initialized. The special variable identifier omp_orig can be used in an initializer expression to refer to the storage of the original variable to be reduced. The number of times that an initializer expression is evaluated and the order of these evaluations are unspecified.
Restrictions
Restrictions to initializer expressions are as follows:If an initializer expression modifies the variable omp_orig, the behavior is unspecified.