[Omp] Re: PARALLEL DO REDUCTION of array-valued variables?

Daniel Franke franke.daniel at gmail.com
Mon Oct 30 08:25:00 PST 2006


2006/10/30, Hoeflinger, Jay P <jay.p.hoeflinger at intel.com>:
> This is not a valid Fortran program.  You have declared the function to
> have an array-valued return value, but then use the function name (func)
> as a scalar inside the function.  The function doesn't define an array
> to return.  Also, no value is assigned to n, so you have no guarantee on
> the number of iterations for the DO loop.

Jay,
let n in the program part equal 42. Then, the binary created by the
intel compiler happily prints 42 times the number 42 (-g -check all
-warn all). Exactly what it is supposed to do. I am not a fortran
guru, but from what I learned a statement as "func = 0" or "func =
func + 1" is valid, independent from func representing a scalar or an
array. The crash happens, if "-openmp" is added to the command line.
It does not occur, if the REDUCTION-clause is removed.

Since the program works fine without OpenMP-statements (and with an
actual number for n), there must be something wrong the either a) the
statements I added or b) the compiler handling them. If it's any
indication, the GNU people tagged the bug report for gfortran as
ice-on-valid-code ...

      Daniel


More information about the Omp mailing list