Subject: hpff: Re: Early opionions about DEC F90 and HPF in general

From: [email-masked] (Jonathan Harris)
Date: Thu, 16 May 1996 16:11:18 -0400

---------------------------------------------------------------------------
[email-masked] is a mailing list for announcements related to High
Performance Fortran.  Instructions for adding or deleting yourself
from this list appear at the bottom of this message.
---------------------------------------------------------------------------

Jason,

Let me offer some specific comments on your objections, and then some more
general comments on Digital Fortran, the Fortran and HPF languages and
developing parallel programs.

> "[Digital's HPF compiler and ... the HPF language are] ... NOT geared toward
> simple implementation of the most common real-world applications of Fortran."

and

> DETAILS: I got DEC's HPF F90 documentation kit yesterday.  From page
> 6-3 of D.H.P.F.90:
>
> "For new code, HPF is generally useful in the following cases:
> 
>   o Problems utilizing iterative solution methods
>   o Signal processing
>   o Image processing
>   o Modeling
>   o Grid-based problems in general
>   o In general, most problems expressible as operations on large arrays"
> 
> 	Reading that pretty much solidified my very negative opinions
> as to how simple writing my programs ... would be."

The design center for the first version of HPF was to support data parallel
programming.  Nevertheless, even though your program is not data parallel, HPF
provides several methods for efficiently parallelizing your program.  As it
turns out -- for your program -- the simplest way to do this would be to use
the INDEPENDENT directive (however, see comments below about a hazard you would
run into if you did that).  The INDEPENDENT directive is not yet as
well-optimized under Digital Fortran as it should be -- and will be.  Full HPF
is a big language (in part because it includes full Fortran 90); our customers
told us they would prefer we implement full Fortran 90 and the other HPF
features we implemented before finishing support for INDEPENDENT (we have
supported full Fortran 90 since our first release over a year ago). This
probably comes about because of the prevalence, in scientific computing, of
large physical simulations that are modeled on 2- and 3- dimensional grids.  In
an upcoming release, we will be turning our attention towards some of the
features, such as INDEPENDENT, that users such as yourself have recently begun
to request.

> I was thinking that I should be able to add one !HPF$
> INDEPENDENT line to my code.  Ideally, the compiler should be able to
> figure out the rest, since the above case is so simple.

However, where would you suggest inserting the INDEPENDENT directive?  The DO
loop in your program (as written) is NOT independent!  The WRITE statements
within the DO loop are not independent. Executing the WRITEs out of order
changes the semantics of the program.  This does not mean the code is not
parallelizeable, of course; it just means that it's not as simple as inserting
a single INDEPENDENT directive.  The values written in the WRITE statements
could be stored in arrays and written out later.  Only after this would you
have a DO loop that you could safely mark as INDEPENDENT. OR--would you want us
to relax the restriction and allow the WRITEs out of order?  And, this analysis
assumes that the QAGS and PHI subroutines can be executed independently.

> If I was REALLY young and willing to do this, I wouldn't be using F90; I'd
> probably be using C.

There is no widely-available parallel C for distributed-memory machines.
Further, the C language provides no facilities to allow you to exploit
parallelism.  If you are interested in shared-memory machines, you can use
Digital's "KAP C for Digital Unix" preprocessor, in conjunction with Digital's
C compiler, to parallelize your C program.  However, you have to write your
program in a Fortran style to get good results with this tool.  Alternatively,
you could always write in C with explicit message passing in PVM or MPI.  If
you really want to program in C, your Alpha running DEC UNIX comes with an
excellent C compiler.

Here are some more general comments on Fortran and developing parallel programs:

Digital Fortran is intended to be Digital's premier language for technical and
scientific computing, supported well across all of Digital's platforms. The
objectives of Digital Fortran include:

    support for the Fortran 90, and soon Fortran 95, standards;
    
    compatibility with de facto standard extensions to Fortran 77 so that
    existing programs will compile correctly and run well with the Digital
    Fortran compiler; and
    
    support for the HPF specification to encourage the objectives of the
    HPF Forum to promulgate de facto standard extensions.

Digital provides tools that support a number of programming models for
technical and scientific programming:

    If you are developing new applications that are data parallel and
    appropriate for the array features of Fortran 90 and HPF, Digital Fortran
    with its HPF features will allow you to program at a reasonably high level
    while, at the same time, obtaining reasonable efficiency and portability
    across shared memory and distributed memory architectures.  At last year's
    Supercomputing'95, we demonstrated HPF programs running on a 96-processor
    cluster composed of eight 12-processor shared memory systems
    interconnected.  As you observed, we clearly stated what kinds of
    computations our HPF extensions are tailored for.
    
    If you have existing Fortran 77 code written in a style that allows
    for automatic parallelization, you have several alternatives:
    
        You can use Digital Fortran to obtain good performance on a single
	processor Alpha, relying on Alpha's speed and the quality of the code
	generated by the compiler to provide the performance you need.
	
	You can use the KAP preprocessor to compile your code for one of
	Digital's shared memory systems, which can contain up to 12 Alpha
	processors. KAP is the tool used by most vendors to provide shared
	memory parallelization.
	
	You can use PSR's VAST or APR's products to translate your Fortran 77
	into Fortran 90 with HPF directives and use Digital Fortran 90 to
	provide shared memory or distributed memory parallelization.
	
	You can hand parallelize your code to use DECThreads, Digital's
	implementation of Posix threads, for Digital's shared memory systems.
	
	You can hand parallelize your code to use message passing, using
	either PVM or MPI, both of which are available for Alpha.

The intention of the HPF Forum is to come to consensus on extensions to Fortran
for high performance technical and scientific programming.  The key is the idea
of consensus; the objective is to raise the level of language commonalty
between vendors and not to solve all possible programming problems. HPF has
been successful - a number of language features from HPF 1.1 are being
incorporated into the ISO and ANSI standard definition of Fortran.

We welcome comments by e-mail, fax, reader comment card, or letter about
Digital Fortran. Such comment by users helps us identify areas for improvement.
Fortran 90 and HPF are powerful new tools - it takes time for users to
understand the new and powerful capabilities available to them, and it takes
time for compiler developers to implement these capabilities both correctly and
efficiently.

		The HPF Team at Digital Equipment Corporation
		          [email-masked]
---------------------------------------------------------------------------
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>
---------------------------------------------------------------------------