J3/14-129r1
To: J3
From: Dan Nagle
Subject: repairing forall to concurrent (UK-10.2f)
Date: 2014 February 13
Reference: 13-323r1, 14-106
This paper is an attempt to deprecate forall and move
the text still needed to the do-concurrent section.
Edits against 14-007
{make the following global changes}
<> change to <>
<> change to <>
<> change to <>
<> change to <>
{line-by-line edits}
{add a comment in the Intro}
[Intro] add to the new features list
"FORALL is now specified to be obsolescent."
{repair branch target}
{no need to specify forall-stmt because its an action-stmt}
[4:34] set in obs font "<>"
[31:23] set in obs font "<>"
[31:43] set in obs font "<>"
[47:23+] in the table, set in obs font "END FORALL"
[141:7] Also obs font for
", or the \si{forall-limit}s and \si{forall-step}s
in a FORALL statement (7.2.4)"
{move the renamed <> and friends
to the do concurrent section}
{replace the forall stuff with a pointer to the D-C stuff}
[167:17-26] replace with
The values of the index variables are determined
as they are for the DO CONCURRENT statement
(reference DO CONCURRENT here).
[167:30-168:2+] {the note moves with the rest}
replace with
The mask expression is evaluated as it is
for the DO CONCURRENT statement (reference DO CONCURRENT statement).
[166:31-167:4] move to [177:10+] and renumber as needed
{now go back and clobber the old forall stuff}
[166:8-170:16] set in obs font section 7.2.4
{add and reword the forall header description to do concurrent}
[178:2-3] replace with {the names have already been changed}
The forall-limit and forall-step expressions
in the forall-triplet-spec-list are evaluated. These expressions may be
evaluated in any order. The set of values that a particular
index-name variable assumes is determined as follows.
(1) The lower bound m1, the upper bound m2, and the step m3 are
of type integer with the same kind type parameter as the index-name.
Their values are established by evaluating the first forall-limit,
the second forall-limit, and the forall-step expressions,
respectively, including, if necessary, conversion to the kind type
parameter of the index-name according to the rules for numeric
conversion (Table 7.9). If forall-step does not appear, m3 has the
value 1. The value m3 shall not be zero.
(2) Let the value of max be (m2 m1 + m3)/m3. If max 0 for some
index-name, the execution of the construct is complete. Otherwise,
the set of values for the index-name is
m1 +(k1)m3 where k = 1, 2, ..., max.
The set of combinations of index-name values is the Cartesian product
of the sets defined by each triplet specification. An index-name becomes
defined when this set is evaluated.
The scalar-mask-expr, if any, is evaluated for each combination
of index-name values. If there is no scalar- mask-expr, it is as if it
appeared with the value true. The index-name variables may be primaries
in the scalar-mask-expr .
The set of active combinations of index-name values is the subset
of all possible combinations (7.2.4.2.2) for which
the scalar-mask-expr has the value true.
The range of a DO CONCURRENT construct is executed for every
active combination of the index-name values. Each execution
of the range is an iteration. The executions may occur in any order.
{obs and repair forall stmt target thingie}
[188:15] set in obs font "<>,"
before the above, add <>,
[317:1-] in Note 12.49, change
safe to reference in constructs such as DO CONCURRENT
to
"safe to reference in constructs such as DO CONCURRENT
\obs{and FORALL}"
and much later "FORALL statements"
[317:1-] set in obs font
in Note 12.50 FORALL <>s"
[448:15-16] set in obs font "or as an index-name in a FORALL statement"
and "FORALL or".
[448:32] Change "FORALL statement or FORALL or"
to "\obs{FORALL statement, FORALL construct, or}".
[448:36-37] set in obs font "FORALL or" twice
and "FORALL statement or" once
[449:1-4] set in obs font
"FORALL statement, FORALL construct, or" twice.
[449:5] set in obs font "FORALL or"
[460:5] set in obs font "or FORALL assignment statement"
[460:7] set in obs font "or FORALL assignment statement"
[461:21] set in obs font "FORALL or"
{add to list of obsolescent features in B.3}
[472:26+] add to the list
(x) FORALL statements and constructs (reference)
[474:20+] add
"B3.12+ FORALL construct and statement
The FORALL construct and statement were added to the language in the
expectation that they would enable highly efficient execution, especially
on parallel processors. However, experience indicates that they are too
complex and have too many restrictions for compilers to take advantage of
them. They are redundant with the DO CONCURRENT loop, and many of the
manipulations for which they might be used can be done more effectively
using pointers, especially using pointer rank remapping."
{obs font the C section examples}
[488:32-492:1]
make obs font C.4.5 and C.4.6