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

Hoeflinger, Jay P jay.p.hoeflinger at intel.com
Mon Oct 30 15:36:30 PST 2006


Yes, you are right.  Sorry - too much Fortran too early on Monday
morning.  I missed the fact that those are array operations.  It appears
to be legal OpenMP.

Jay

-----Original Message-----
From: Jakub Jelinek [mailto:jakub at redhat.com] 
Sent: Monday, October 30, 2006 10:38 AM
To: Hoeflinger, Jay P
Cc: Daniel Franke; omp at openmp.org
Subject: Re: [Omp] PARALLEL DO REDUCTION of array-valued variables?

On Mon, Oct 30, 2006 at 07:57:37AM -0800, Hoeflinger, Jay P wrote:
> 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

AFAICS there is no use of func as scalar in the testcase.
func = 0 and func = func + 1 are both array operations, func isn't
assumed-size nor allocatable array and therefore is valid in a reduction
clause too.

> Also, no value is assigned to n, so you have no guarantee on
> the number of iterations for the DO loop.

Yes, this is an obvious bug in the testcase, but fixing that is trivial.

	Jakub


More information about the Omp mailing list