From jls@uxb.liv.ac.uk Tue Feb  9 10:28:15 1993
Received: from ib.rl.ac.uk by dkuug.dk with SMTP id AA29010
  (5.65c8/IDA-1.4.4j for <SC22WG5@dkuug.dk>); Tue, 9 Feb 1993 11:29:07 +0100
Received: from mail.liv.ac.uk by ib.rl.ac.uk (IBM VM SMTP V2R1) with TCP;
   Tue, 09 Feb 93 10:28:29 GMT
Received: from uxb.liverpool.ac.uk by mailhub.liverpool.ac.uk with SMTP (PP) 
          id <25522-0@mailhub.liverpool.ac.uk>; Tue, 9 Feb 1993 10:28:35 +0000
From: jls <jls@uxb.liv.ac.uk>
Message-Id: <446.9302091028@uxb.liv.ac.uk >
Subject: HPF 1.0 comments, chapter 4
To: hpf-comments@cs.rice.edu
Date: Tue, 9 Feb 93 10:28:15 GMT
Cc: SC22WG5@dkuug.dk (SC22/WG5 members)
X-Mailer: ELM [version 2.3 PL11]
X-Charset: ASCII
X-Char-Esc: 29

                                  Comment on HPF 1.0, Jan'93

Further Comments on Chapter 4, Statements
In a previous comment on this chapter I suggested that the PURE and
INDEPENDENT directives would be much better as Language syntax
and that they be more tightly tied to the entity they qualify. I have not
changed my mind on this but I can appreciate why at this stage it is
considered desirable for the comment nature of these directives to be
preserved. However, I feel strongly that if at some future date HPF
functionality is to be included in the official Fortran language standard
then the correct linking of these directive to the entity qualified is
critical. I would therefore like to suggest a compromise position. Since
Fortran 90 allows ! initiated comments to appear inline in both source
forms, I would propose that both the PURE directive and the
INDEPENDENT directive be recast as inline comments that qualify the
proper defining statement for the entity in question.
      For the PURE directive this would mean that it would always
appear as a trailing comment on the qualified FUNCTION or
SUBROUTINE header statement. The PURE directive does not then need
to specify the procedure name since this is provided by the header that
is involved. Subsequent incorporation as a part of the language proper
will then be simple and the modification if necessary of any existing
programs trivial.
      Similarly, the INDEPENDENT directive should be attached to the
DO loop it qualifies as a trailing comment. Again as it applies to a
single loop not to a nest it does not need to specify the index; this is
specified elsewhere in the statement. I strongly believe this qualification
of a nest by qualifying the individual loops to be essential because the
DO statements setting up each loop of a nest may be separated from
each other by many lines of code. In fact there is no need for there to
be only a single inner loop nested within an outer. The following
situation is perfectly allowable Fortran,
DO i1=1,n1
   .....
   DO i2=1,n2
      .....
   ENDDO
   .....     
   DO i2=1,m2 
      .....
   ENDDO
   .....
ENDDO
The independence or otherwise of these loops depends on the code
contained within their individual loop bodies. It would be perfectly
possible for the loop over i1 to be independent but for one of the
nested loops over i2 not to be independent. This also underlines that
index variable name is not a suitable name for indentifying a loop. The
only name that has this function is the loop construct name which is by
definition a unique identifier for a loop. 
      If the intent of the nested loop single independent directive is
intended to mean that the distinction between inner and outer loop is
also of no significance, then qualifying the DO loop syntax is a highly
undesirable vehicle for such an assertion. It would probably be better
to look at the FORALL construct as the vehicle in this case or some
similar but new syntactic entity.

      Although, the general aim of the facilities defined in this chapter
is reasonable and reasonably clear, the specific details of the syntax and
semantics as set out in the current draft are far from adequate. There
are too many problems, too many loop-holes caused by a lack of
precision in the syntax definitions and the semantic rules. The
functionality being proposed would be very unlikely, in my opinion, 
suitable for inclusion in a future Fortran standard without substantial
alteration. It is clearly not desirable for an important extension proposal
like HPF to become widespread unless there is a good prospect of it
being incorporated without major changes in a future Fortran standard.

-- 
Dr.J.L.Schonfelder
Director, Computing Services Dept.
University of Liverpool, UK
Phone: +44(51)794 3716
FAX  : +44(51)794 3759
email: jls@liv.ac.uk   

