Subject: hpff-doc: new subset-app.tex

From: Mary E Zosel <[email-masked]>
Date: Wed, 22 May 1996 16:00:59 -0700

---------------------------------------------------------------------------
[email-masked] is a mailing list for HPF 2.0 language specification
authors and editors.  Instructions for adding or deleting yourself from this
list appear at the bottom of this message.
---------------------------------------------------------------------------

% File: subset-app.tex

% Contents:
% Subset HPF Appendix for HPF 2.0 document

% Revision history:
% May-10-96	Created by Charles Koelbel, Rice University
%		(from HPF 1.1 document)
% May-22-96     Editted by Mary Zosel, LLNL
%               change the first paragraph to reflect the new status

\chapter{Subset HPF}
\label{ch-subset-app}

{\em
Comments on this chpater should be directed to 
Mary Zosel ({\tt [email-masked]})
and {\tt [email-masked]}.
Please use ``{\tt Comments on Subset HPF}'' as the {\tt Subject:}
line.
\par
}

%This chapter presents a subset of HPF capable of
%being implemented more rapidly than the full HPF.
%A subset implementation will  provide a portable
%interim HPF  capability. Full HPF implementations should
%be developed as rapidly as possible.  The definition of
%the subset  language is intended to be a minimal
%requirement.  A given implementation may support
%additional Fortran 90  and HPF features.

Formally, subset HPF  no longer exists. This section is
included to leave a record of what the subset was. The
intent of the original subset was to develop an interim
HPF capability.  

\section{Fortran 90 Features in Subset High
Performance Fortran}

The items listed here are the features of the HPF subset 
language. For reference, the section numbers from the
Fortran 90 standard are given along with the related
syntax rule numbers:

\sloppy

\begin{itemize}

\item All FORTRAN 77 standard conforming features,
except for storage and sequence association. 
(See Section~\ref{sequence} for detailed discussion of the exception.)

\item The Fortran 90 definitions of MIL-STD-1753 features:

  \begin{itemize}

  \item {\tt DO WHILE} statement (8.1.4.1.1 / R821)

  \item {\tt END DO} statement (8.1.4.1.1 / R825)

  \item {\tt IMPLICIT NONE} statement (5.3 / R540)

  \item {\tt INCLUDE} line (3.4)

  \item scalar bit manipulation intrinsic procedures:
     {\tt IOR}, {\tt IAND}, {\tt NOT}, {\tt IEOR}, {\tt ISHFT}, {\tt ISHFTC},
     {\tt BTEST}, {\tt IBSET}, {\tt IBCLR}, {\tt IBITS}, {\tt MVBITS}  (13.13)

  \item binary, octal and hexadecimal constants for use
  in {\tt DATA} statements (4.3.1.1 / R407 and 5.2.9 / R533)

  \end{itemize}

\item Arithmetic and logical array features:

  \begin{itemize}

  \item array sections (6.2.2.3 / R618--621)

    \begin{itemize}

    \item subscript triplet notation (6.2.2.3.1)

    \item vector-valued subscripts (6.2.2.3.2)

    \end{itemize}

  \item array constructors limited to one level of implied
  {\tt DO} (4.5 / R431)

  \item arithmetic and logical operations on whole arrays and
     array sections (2.4.3, 2.4.5, and 7.1)

  \item array assignment (2.4.5, 7.5, 7.5.1.4, and 7.5.1.5)

  \item masked array assignment (7.5.3)

    \begin{itemize}

    \item {\tt WHERE} statement (7.5.3 / R738)

    \item block {\tt WHERE} . . . {\tt ELSEWHERE} construct (7.5.3 / R739)

    \end{itemize}

  \item array-valued external functions (12.5.2.2)

  \item automatic arrays (5.1.2.4.1)

  \item {\tt ALLOCATABLE} arrays and the {\tt ALLOCATE} and
  {\tt DEALLOCATE} statements
  (5.1.2.4.3, 6.3.1 / R622, and 6.3.3 / R631)

  \item assumed-shape arrays (5.1.2.4.2 / R516)

  \end{itemize}

\item Intrinsic procedures:

The list of intrinsic functions and subroutines below is a combination
of (a) routines which are entirely new to Fortran and (b) routines that have
always been part of Fortran, but now have been extended to new argument
and result types.  The new or extended definitions of these routines
are part of the subset. If a FORTRAN 77 routine is not included in this
list, then only the original FORTRAN 77 definition is part of the
subset.

%\begin{obsolete}
%For all of the intrinsics that have an optional argument {\tt DIM},
%only actual argument expressions for {\tt DIM} that are initialization
%expressions and hence deliver a known shape at compile time are part of
%the subset.  The intrinsics with this constraint are marked with \dag in
%the list below.
%\end(obsolete}

For all of the intrinsics that have an optional argument {\tt DIM},
only actual argument expressions for {\tt DIM} that are initialization
expressions  are part of
the subset.  The intrinsics with this constraint are marked with \dag in
the list below.

  \begin{itemize}

  \item the argument presence inquiry function:
      {\tt PRESENT} (13.10.1)

  \item all the numeric elemental functions:
     {\tt ABS}, {\tt AIMAG}, {\tt AINT}, {\tt ANINT}, {\tt CEILING},
     {\tt CMPLX}, {\tt  CONJG}, {\tt  DBLE}, {\tt DIM}, {\tt DPROD},
     {\tt FLOOR}, {\tt INT}, {\tt MAX}, {\tt MIN}, {\tt MOD}, {\tt
     MODULO}, {\tt NINT}, {\tt REAL}, {\tt SIGN} (13.10.2)

  \item all mathematical elemental functions:
     {\tt ACOS}, {\tt ASIN}, {\tt ATAN}, {\tt ATAN2}, {\tt COS}, {\tt
     COSH}, {\tt EXP}, {\tt LOG}, {\tt LOG10}, {\tt SIN}, {\tt SINH},
     {\tt SQRT}, {\tt TAN}, {\tt TANH} (13.10.3)

  \item all the bit manipulation elemental functions :
     {\tt BTEST}, {\tt IAND}, {\tt IBCLR}, {\tt IBITS}, {\tt IBSET},
     {\tt IEOR}, {\tt IOR}, {\tt ISHFT}, {\tt ISHFTC}, {\tt NOT}
     (13.10.10)

  \item all the vector and matrix multiply functions:
    {\tt DOT_PRODUCT}, {\tt MATMUL} (13.10.13)

  \item all the array reduction functions:
     {\tt ALL}\dag, {\tt ANY}\dag, {\tt COUNT}\dag, {\tt
     MAXVAL}\dag, {\tt MINVAL}\dag, {\tt PRODUCT}\dag, {\tt
     SUM}\dag (13.10.14)

  \item all the array inquiry functions:
     {\tt ALLOCATED}, {\tt LBOUND}\dag, {\tt SHAPE}, {\tt
     SIZE}\dag, {\tt UBOUND}\dag (13.10.15)

  \item all the array construction functions:
     {\tt MERGE}, {\tt PACK}, {\tt SPREAD}\dag, {\tt UNPACK}
     (13.10.16)

  \item the array reshape function:
     {\tt RESHAPE} (13.10.17)

  \item all the array manipulation functions:
     {\tt CSHIFT}\dag, {\tt EOSHIFT}\dag, {\tt TRANSPOSE}
     (13.10.18)

  \item all array location functions:
     {\tt MAXLOC}\dag, {\tt MINLOC}\dag (13.10.19)

  \item all intrinsic subroutines:
      {\tt DATE_AND_TIME}, {\tt MVBITS}, {\tt RANDOM_NUMBER}, {\tt
      RANDOM_SEED}, {\tt SYSTEM_CLOCK} (3.11)

  \end{itemize}

\item Declarations:

  \begin{itemize}

  \item Type declaration statements, with all forms of {\it type-spec}
     except {\it kind-selector} and {\tt TYPE}(type-name), and all forms
     of {\it attr-spec}  except {\it access-spec}, {\tt TARGET}, and {\tt
     POINTER}.  (5.1 / R501-503, R510)

  \item attribute specification statements:
     {\tt ALLOCATABLE}, {\tt INTENT}, {\tt OPTIONAL}, {\tt PARAMETER},
     {\tt SAVE} (5.2)

  \end{itemize}

\item Procedure features:

  \begin{itemize}

  \item {\tt INTERFACE} blocks with no {\it generic-spec} or {\it
     module-procedure-stmt} (12.3.2.1)

  \item optional arguments (5.2.2)

  \item keyword argument passing (12.4.1 /R1212)

  \end{itemize}

\item Syntax improvements:

  \begin{itemize}

  \item long (31 character) names (3.2.2)

  \item lower case letters (3.1.7)

  \item use of ``\_'' in names (3.1.3)

  \item ``!'' initiated comments, both full line and trailing
  (3.3.2.1)

  \end{itemize}

\end{itemize}

\section {Discussion of the Fortran 90 Subset Features}

\begin{rationale}
There are many Fortran 90 features which are useful and relatively easy
to implement, but are not included in the subset language.  Features
were selected for the subset language for several reasons.

The MIL-STD-1753 features have been implemented so widely that many
users have forgotten that they are not part of FORTRAN 77.  They are
included in the HPF subset.

The biggest addition to FORTRAN 77 in the HPF subset language is the
inclusion of the array language. A number of vendors have identified
the usefulness of array operations for concise expression of
parallelism and  already support these features. However, the character
array language is not part of the subset.  

The new storage classes such as allocatable, automatic, and
assumed-shape objects are included in the subset.  They provide an
important alternative to the use of storage association features such
as {\tt EQUIVALENCE} for memory management.

Interface blocks have been added to the subset in order to facilitate
use of the HPF directives across subroutine boundaries.  The interface
blocks provide a mechanism to specify the expected mapping of data, in
addition to the types and intents of the arguments.

There were other Fortran 90 features considered for the subset. Some
features such as {\tt CASE} or {\tt NAMELIST} were recognized as popular
features of Fortran 90, but had no direct bearing on high performance.  Other
features such as support for double precision complex (via {\tt KIND}) or
procedureless {\tt MODULES} were rejected because of the perception that the
additional implementation complexity might delay release of subset
compilers. It was not a goal of HPFF to define an ``ideal'' subset of
Fortran 90 for all purposes.

Additional syntactic improvements are included, such as long names and
the ``!'' form of comments, because of their general usefulness in
program documentation, including the description of HPF itself.
\end{rationale}

\section{HPF Features Not in Subset High Performance Fortran}

All HPF directives  and language extensions are included
in the HPF subset language with the following exceptions:

\begin{itemize}

\item The {\tt REALIGN}, {\tt REDISTRIBUTE}, and {\tt DYNAMIC} directives;

%\begin(obsolete}
%\item 
%The {\tt INHERIT} directive used with a {\it dist-format-clause}
%or
%{\it dist-target} that is transcriptive (``lone star'') either
%explicitly or implicitly;
%\end(obsolete}

\item  
The {\tt INHERIT} directive.

\item The {\tt PURE} function attribute;

\item The {\it forall-construct};

\item The HPF library and the {\tt HPF_LIBRARY} module;

\item Actual argument expressions corresponding to optional {\tt DIM}
arguments to the Fortran 90 {\tt MAXLOC} and {\tt MINLOC} intrinsic
functions that are not initialization expressions; and

\item The {\tt EXTRINSIC} function attribute.

\end{itemize}

\section {Discussion of the HPF Extension Subset}

\begin{rationale}
The data mapping features of the HPF subset are limited to static
mappings, plus the possible remapping of arguments across the interface
of subprogram boundaries. Since the subset language does not include
{\tt MODULES}, and {\tt COMMON} block variables cannot be remapped,
this restriction only impacts remapping of local variables and
additional remapping of arguments, after the subprogram boundary.

%\begin{obsolete}
%The {\tt INHERIT} directive may be used in the subset, but the user must
%provide an explicit descriptive or prescriptive distribution for
%the dummy argument in question.
%\end{obsolete}

The {\tt INHERIT} directive is no longer included in the subset. The
case where it is most useful (to describe the template of the full
array, when only a section of an array is passed as an argument)
cannot not  be declared properly with the former restriction on use of
transcriptive distributions, combined with the fact that processor
directives cannot be used to describe only parts of the processor set.
Only the simplest version of {\tt FORALL} statement is required in the
subset. Note that the omission of the {\tt PURE} attribute from the
subset means that only HPF and Fortran 90 intrinsic functions can be
called from the {\tt FORALL} statement.  No other subprograms can be
called.

Only the intrinsics which are useful for declaration of variables and
mapping inquiries are included in the subset.  The full set of
extended operations proposed for the  HPF library is not required and
since {\tt MODULE} is not part of the subset, the {\tt HPF_LIBRARY} module
is also not part of the subset. The extrinsic interface attribute is
also not in the subset.  This includes any specific extrinsic models
such as the model described in the Annex~\ref{LOCAL-ANNEX}.

All of these HPF language reductions are made in the spirit of
allowing  vendors to produce a usable subset version of HPF quickly so
that initial experimentation with the language can begin. This list of
HPF features excluded from the subset should not be interpreted as
requiring implementors to omit the features from the subset.
Implementations  with as many HPF features as possible are encouraged.
The list does, however, establish the features a user should avoid if
an HPF application is expected to be moved between different HPF subset
implementations.
\end{rationale}

\fussy

---------------------------------------------------------------------------
To (un)subscribe to this list, send mail to [email-masked].
Leave the subject line blank, and in the body put the line
(un)subscribe <email-address>
---------------------------------------------------------------------------