Search found 41 matches

by nathanweeks
Sun Sep 23, 2012 4:29 pm
Forum: OpenMP 3.1 API Specifications
Topic: C/C++ min/max reduction with real floating type
Replies: 1
Views: 35348

C/C++ min/max reduction with real floating type

For C/C++ min/max reduction operators with list items of type float, double, or long double, what should the initial values of the private copies be? E.g., for a min reduction, the initial value of the private copy should be the "largest representable value in the reduction list item type" (OpenMP 3...
by nathanweeks
Fri Sep 14, 2012 8:53 am
Forum: OpenMP 3.1 API Specifications
Topic: C/C++ min/max reduction with _Bool/bool
Replies: 2
Views: 16544

Re: C/C++ min/max reduction with _Bool/bool

Arguments to printf() are subject to default argument promotions, which, for a type _Bool argument, results in an integer promotion; specifically, it will be converted to an int before being printed---the C11 standard states on pp. 50-51: The rank of _Bool shall be less than the rank of all other st...
by nathanweeks
Fri Sep 14, 2012 4:55 am
Forum: OpenMP 3.1 API Specifications
Topic: C/C++ min/max reduction with _Bool/bool
Replies: 2
Views: 16544

C/C++ min/max reduction with _Bool/bool

The OpenMP 3.1 API spec states on p. 104, l. 1, that the private copy of a list item in a reduction clause is initialized as follows for min and max operators: max Least representable value in the reduction list item type min Largest representable value in the reduction list item type How should the...
by nathanweeks
Tue Aug 21, 2012 5:32 am
Forum: OpenMP 3.1 API Specifications
Topic: Data-sharing attribute rules for host association
Replies: 2
Views: 12574

Data-sharing attribute rules for host association

The Fortran-specific part of Section 2.9.1.2 ( Data-sharing Attribute Rules for Variables Referenced in a Region but not in a Construct ) of the OpenMP 3.1 spec doesn't explicitly address variables declared in a main program and accessed by host association in an internal subprogram. Two questions: ...
by nathanweeks
Sat Aug 18, 2012 12:01 pm
Forum: OpenMP 3.1 API Specifications
Topic: Example A.15.13 data race
Replies: 1
Views: 11454

Example A.15.13 data race

There's a data race in Examples A.15.13c and A.15.13f from the OpenMP 3.1 spec. Consider the following program that implements bin_search() from Example A_15_13.c, where, to more easily illustrate the problem, the LIMIT macro has been modified so that all generated tasks are final tasks: // A_15_13....
by nathanweeks
Sun Dec 11, 2011 9:34 am
Forum: OpenMP 3.1 API Specifications
Topic: Example A.22.1c and A.22.1f differences
Replies: 1
Views: 10582

Example A.22.1c and A.22.1f differences

The resulting values of the x and y arrays are different between examples A.22.1c and A.22.1f. It's probably no big deal, as the OpenMP concepts are implemented correctly, though it could result in some confusion for someone who attempts to run both programs and compare the results. The former examp...
by nathanweeks
Sat Oct 08, 2011 11:43 am
Forum: OpenMP 3.1 API Specifications
Topic: Example A.7 clarification
Replies: 1
Views: 11895

Example A.7 clarification

I have a question regarding Example A.7. Lines 11-15 on p. 177 state: The call to the omp_set_dynamic routine with argument 0 in C/C++, or .FALSE. in Fortran, disables the dynamic adjustment of the number of threads in OpenMP implementations that support it. In this case, 10 threads are provided. No...
by nathanweeks
Wed Aug 04, 2010 10:55 am
Forum: OpenMP 3.0 API Specifications
Topic: firstprivate/reduction restriction
Replies: 3
Views: 14310

Re: firstprivate/reduction restriction

With respect to explicit tasks, there's already a stronger restriction on page 99, lines 25-26:
A list item that appears in a reduction clause of the innermost enclosing worksharing or parallel construct may not be accessed in an explicit task.
by nathanweeks
Wed Jul 28, 2010 4:53 pm
Forum: OpenMP 3.0 API Specifications
Topic: firstprivate/reduction restriction
Replies: 3
Views: 14310

Re: firstprivate/reduction restriction

The OpenMP 3.0 API spec defines a "closely nested region" on p. 6, lines 1-2, as: A region nested inside another region with no parallel region nested between them. The "Non-conforming code" example involves task regions that are closely-nested in the parallel region with the reduction clause, while...