Fig. 3.

Download original image
Parallel reduction of an array using the OpenMP directives. “omp parallel” states that the following loop can safely be parallelized and the “reduction(+:a)” indicates that we want to do a reduction using the addition operator on the variable “a”. The final result will be stored in the said variable.