Newsgroups: comp.parallel
From: Daniele Rizzi <D.Rizzi@qmw.ac.uk>
Subject: A question about HPF_LOCAL
Organization: lpac
Date: 7 Sep 1995 19:35:00 GMT
Message-ID: <42nhh4$ph1@usenet.srv.cis.pitt.edu>

Hi all

I'm working on a 4-node Alpha Farm coupled with a HPF v1.0 compiler,
and I'm supposed to write a parallel program using the Master-Slave 
model.
Shortly described, such a program could be described (in pseudo-language)
by a loop:

        PARDO i = 1, number_of_processors()
                call foo(a, b, c, ...)
        END PARDO

which forks copies of himself through the available peers; the program
running on the master and on the slaves is the same, but the instructions
executed depend on the type of the node, and on the data it has to 
process.

Unfortunately, it seems that this computer paradigm is not well-supported
in HPF, because:

        + a DO loop is never compiled as a parallel construct;

        + and a FORALL loop is parallelized only if the included subroutine
          (in this case, foo() ) is declared PURE, which in turn means
          that it cannot:    

                - modify global variables;
                - define variables with SAVE attribute;
                - use dummy arguments without INTENT(IN) statement;
                - call a function or a subroutine non-PURE;
                etc.

In a few words, there is no way to communicate or to share data between
the different slaves, or between the master and the slaves.

"HPF Handbook" and "DEC F90 Manual" suggest what they call "Loosely 
Synchronous Parallel Execution" model: "Although all processors execute
the same program, the processors are not necessarily processing the
exact same instruction at the same time". This should be implemented
using the EXTERNAL(HPF_LOCAL) declaration, but, oddly enough, no
working example is provided, and there still remains open the question
about the communication between the peers. The DEC Manual states:
"it is up to you to insert whatever SENDs and RECEIVEs are necessary",
without giving any information about the syntax of SEND and RECEIVE
calls.

At the end of the day, I finally state my question:
Is available any example, or any fragment of code, describing
how an explicit comm. can be carried out inside HPF?
(or is such an approach simply forbidden by the Standard?) 

Thanks for the time you've spent reading this message

dany -> d.rizzi@lpac.ac.uk

