Fortran User's Guide

-reduction

Recognize reduction operations in loops.

    SPARC: 77/90

Analyze loops for reduction operations during automatic parallelization. There is potential for roundoff error with the reduction.

A loop that transforms the elements of an array into a single scalar value is called a reduction operation. For example, summing the elements of a vector is a typical reduction operation. Although these operations violate the criteria for parallelizability, the compiler can recognize them and parallelize them as special cases when -reduction is specified. See the Fortran Programming Guide chapter Parallelization for information on reduction operations recognized by the compilers.

This option applies only with the automatic parallelization options -autopar or -parallel. It is ignored otherwise. Explicitly parallelized loops are not analyzed for reduction operations.

Example: Automatically parallelize with reduction:


demo% f77 -parallel -reduction any.f