Subject: subset revision

From: [email-masked] (Mary E Zosel)
Date: Wed, 23 Sep 92 12:37:01 -0700

F90 group
Following is the text for Chapter 9 that I propose to send in for
the post-September-meeting HPF document.  Taking a hint from Rob,
I have included a "yet-to-do" list as comments on the beginning.
I should also have included "spell-check".  The last two items
are simply mechanical latex items that I don't know how to do - 
help welcome.

   -mary-

----

%hpf-subset.tex

%list of work needed for this chapter before October meeting.
%
% comments and volunteers welcome
%
%- general review of the new text in section x.3
%
%- want F90 references added to all of the x.2 items 
%
%- need to research the proper thing to propose about DIM
%restrictions. Is it "constant-expressions" or is something
%more restrictive required.
%
%- need to check out NAMELIST in the standard and see if it needs
%further commetn.
%
%-need proposal from the foreign routines people about what
%subset restriction to propose.
%
%-need to learn how to do an item list with a single item so that
%NAMELIST doesn't have the empty line following.
%
%-need to learn how to reference another chapter so I don't have
%the hard-reference to Chapter 8 in the text.
%

%Version of Sept 23, 1992 - D. Loveman, DEC, M. Zosel LLNL

\chapter{Subset High Performance Fortran\protect\footnote{Version of
Sept 23, 1992 - David Loveman, Digital Equipment Corporation, Mary Zosel LLNL,
with assistance from members of Fortran 90 subgroup.}}
\label{subset}

\section{Overview}
High Performance Fortran is defined as full Fortran 90 with 
restrictions on storage association and augmented by
language features in three areas:

\begin{itemize}

\item directives in the form of structured comments which, although
they do not change the meaning of a program, provide information to
 a compiler to enable optimization,

\item a FORALL statement, and

\item extended intrinsic functions and library.

\end{itemize}

This chapter presents a subset of HPF capable of being implemented
by multiple implementors more rapidly than the full HPF.  
A subset implementation will  provide a standard
interim capability and 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.

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

\sloppy

\begin{itemize}

\item FORTRAN 77 standard conforming, except for sequence and 
   storage association.  See chapter 8.

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

\begin{itemize}

\item DO WHILE statement

\item END DO statement

\item IMPLICIT NONE statement

\item INCLUDE statement (line)

\item scalar bit manipulation intrinsic functions:  
     IOR, IAND, NOT, IEOR, ISHFT, ISHFTC, 
     BTEST, IBSET, IBCLR, IBITS, MVBITS (subroutine)

\item octal and hexadecimal constants for use in DATA statements:  
     O'. . .', Z'. . . '

\end{itemize}

\item arithmetic and logical array features

\begin{itemize}

\item array sections

\begin{itemize}

\item subscript triplet notation

\item vector-valued subscripts

\end{itemize}

\item array constructors limited to one level of implied DO

\item arithmetic and logical operations on whole arrays and 
     array sections

\item array assignment

\item masked array assignment

\begin{itemize}

\item WHERE statement

\item block WHERE . . . ELSEWHERE construct

\end{itemize}

\item array-valued external functions

\item AUTOMATIC arrays

\item ALLOCATABLE arrays and the ALLOCATE and DEALLOCATE statements

\item assumed-shape arrays

\end{itemize}

\item scalar, inquiry, elemental, and transformational 
intrinsic functions

\begin{itemize}

\item argument presence inquiry function:  PRESENT

\item numeric scalar and array elemental functions:  
     ABS, AIMAG, AINT, ANINT, CEILING, CMPLX, CONJG, 
     DBLE, DIM, DPROD, FLOOR, INT, MAX, MIN, MOD, 
     MODULO, NINT, REAL, SIGN

\item mathematical scalar and array elemental functions:  
     ACOS, ASIN, ATAN, ATAN2, COS, COSH, EXP, LOG, 
     LOG10, SIN, SINH, SQRT, TAN, TANH

\item character scalar functions:  
     CHAR, ICHAR, INDEX, LGE, LGT, LLE, LLT

\item bit manipulation elemental functions : 
     BTEST, IAND, IBCLR, IBITS, IBSET, 
     IEOR, IOR, ISHFT, ISHFTC, NOT

\item vector and matrix multiply functions:  
     DOT_PRODUCT, MATMUL

\item array reduction functions:  
     ALL, ANY, COUNT, MAXVAL, MINVAL, PRODUCT, SUM

\item array inquiry functions:  
     ALLOCATED, LBOUND, SHAPE, SIZE, UBOUND

\item array construction functions:  
     MERGE, PACK, SPREAD, UNPACK

\item array reshape function:  
     RESHAPE

\item array manipulation functions:  
     CSHIFT, EOSHIFT, TRANSPOSE

\item array location functions:  
     MAXLOC, MINLOC

\item intrinsic elemental subroutine:  
      MVBITS

\item intrinsic subroutines:  
      DATE_AND_TIME, RANDOM_NUMBER, 
      RANDOM_SEED,  SYSTEM_CLOCK

\end{itemize}

(change to be proposed):{\it  For all of the intrinsics which have an optional
argument DIM, only values of DIM which deliver known shape are
part of the subset. A precise statement of this is needed.}

\item declarations

\begin{itemize}

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

\item attribute specification statements:  
     ALLOCATABLE, INTENT, OPTIONAL, PARAMETER, SAVE

\end{itemize}

\item procedure features

\begin{itemize}

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

\item optional arguments

\item keyword argument passage

\end{itemize}

\item I/O features

\begin{itemize}

\item NAMELIST (proposed for consideration at Oct. meeting)

\item  ...

\end{itemize}

\item syntax improvements

\begin{itemize}

\item long (31 character) names

\item lower case letters

\item use of ``\_'' in names

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

\end{itemize}

\end{itemize}

\section {Discussion of the Fortran 90 Subset Features}

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.

Additional syntactic improvements are included, such
as long names and the "!" form of comments because of
their general usefulness in program documentation, 
including description of HPF itself.

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 to
concise expression of parallelism and  already
support these features.

The new storage classes such as allocatable, 
automatic, and assumed-shape objects are included in
the subset.  They provide an important alternative to
reduce the use of storage association features such 
as EQUIVALENCE in order to "save space".  

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 intent
of the arguments. 

\section{HPF Features in Subset High Performance Fortran}

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

\begin{itemize}

\item  directives for REALIGN, REALIGNABLE, REDISTRIBUTE, and
REDISTRIBUTABLE are not required in the subset.  

\item the {\it for-all-construct} is not
part of the subset, leaving only the single statement
FORALL.

\item the NUMBER_OF_PROCESSORS, PROCESSORS_SHAPE,
and ILEN  intrinsics are part of the subset.  All other new
intrinsics are not.

\item the addition of an optional DIM argument to the Fortran 90
MAXLOC and MINLOC intrinsics is part of the subset. Only values
of DIM which are constant-expressions are part of the subset.

\item the HPF library is not  required in the subset.

\item {\it some statement about limited form of foreign procedures
interface}.

\item explicit mapping  of sequential variables and aggregate covers, 
as defined in Chapter 8 is not part of the subset.

\end{itemize}

\section {Discussion of the HPF Extension Subset}

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 MODULES, and COMMON block variables cannot be remapped,
this restriction only impacts remapping of local variables and
additional remapping of arguments, after the subprogram boundary.

Only the simplest version of FORALL is required in the subset.

The interface to
foreign procedures defined is intended to allow calling of
system libraries.  A more powerful interface to routines which will
operate on data local to a processor not included in the subset. 

Only the basic intrinsics needed for declarations of variables
and mappings are included in the subset, with the full set of 
extened operations proposed for the library omitted.

The restriction on explicit mapping of sequential variables
and covers is to avoid  possible cases where the mapping might
cause spliting of data values across processors.

All of these HPF language reductions are made in the spirit of allowing 
vendors to get a usable (subset) version of HPF to users
quickly so that initial experimentation with the language
can begin.  

\fussy

\end{document}