From owner-hpff-interpret  Wed Sep 20 20:26:14 1995
Received: by cs.rice.edu (UAA12854); Wed, 20 Sep 1995 20:26:14 -0500
Received: from pacific.pgroup.com by cs.rice.edu (UAA12828); Wed, 20 Sep 1995 20:25:49 -0500
Received: from hoagie.pgroup.com (hoagie [192.124.124.41]) by pacific.pgroup.com (8.6.12/8.6.11) with ESMTP id SAA02454; Wed, 20 Sep 1995 18:25:45 -0700
From: Vince Schuster <vinces@pgroup.com>
Received: (vinces@localhost) by hoagie.pgroup.com (8.6.11/8.6.11) id VAA08130; Wed, 20 Sep 1995 21:28:45 -0400
Date: Wed, 20 Sep 1995 21:28:45 -0400
Message-Id: <199509210128.VAA08130@hoagie.pgroup.com>
To: hpff-interpret@cs.rice.edu
Subject: hpff-interpret: INDEPENDENT DO w/ PURE EXTR
Sender: owner-hpff-interpret
Precedence: bulk

---------------------------------------------------------------------------
hpff-interpret@cs.rice.edu is a mailing list for corrections,
clarifications, and interpretations related to High Performance Fortran.
Instructions for adding or deleting yourself from this list appear at the
bottom of this message.
---------------------------------------------------------------------------


HPFers,

This may be a naive question, but I raised a question at PGI
concerning the ability to handle calls to PURE EXTRINSIC
(e.g. f77_local) routines inside of INDEPENDENT DO loops.

One non-pgi hpf guru indicates that all EXTRINSICS will have side
effects, so the notion of PURE EXTRINSIC is nonsense.

- Does anyone think this makes sense or is valuable?
  If not, i apologize for taking your time & please skip next
  two questions.  :-)

- How would you expect this to be treated?  Call the EXTRINSIC in
  the same manner as if EXTRINSIC were not in INDEP DO?

- It would appear to be problematic to always determine if communications
  were needed inside the EXTRINSIC; hence, would the additional
  constraint that the EXTRINSIC require no comms be OK?

Answers would be needed rather quickly if it is to make it into
our new pghpf release.

thanks for your wisdom,

Vince

+================================+================================+
| Vince Schuster - president     | vinces@pgroup.com              |
| The Portland Group, Inc  (PGI) | http://www.pgroup.com          |
| 9150 SW Pioneer Ct.  Ste H     | 01 (503) 682-2806 <ph>         |
| Wilsonville OR, 97070, USA     | 01 (503) 682-2637 <fax>        |
+================================+================================+

---------------------------------------------------------------------------
To (un)subscribe to this list, send mail to
hpff-interpret-request@cs.rice.edu.
Leave the subject line blank, and in the body put the line
(un)subscribe <email-address>
---------------------------------------------------------------------------

From owner-hpff-interpret  Mon Sep 25 11:55:20 1995
Received: by cs.rice.edu (LAA15748); Mon, 25 Sep 1995 11:55:20 -0500
Received: from icarus.riacs.edu by cs.rice.edu (LAA15724); Mon, 25 Sep 1995 11:55:11 -0500
Received: from frey.riacs.edu by icarus.riacs.edu (8.6.12/2.7G)
	   id JAA05255; Mon, 25 Sep 1995 09:55:05 -0700
Received: by frey.riacs.edu (8.6.12/2.0N)
	   id JAA09616; Mon, 25 Sep 1995 09:59:13 -0700
Message-Id: <199509251659.JAA09616@frey.riacs.edu>
Date: Mon, 25 Sep 1995 09:59:13 -0700
From: Rob Schreiber <schreibr@riacs.edu>
To: hpff-interpret@cs.rice.edu, vinces@pgroup.com
Subject: Re:  hpff-interpret: INDEPENDENT DO w/ PURE EXTR
Sender: owner-hpff-interpret
Precedence: bulk

---------------------------------------------------------------------------
hpff-interpret@cs.rice.edu is a mailing list for corrections,
clarifications, and interpretations related to High Performance Fortran.
Instructions for adding or deleting yourself from this list appear at the
bottom of this message.
---------------------------------------------------------------------------

Vince Schuster writes:

	This may be a naive question, but I raised a question at PGI
	concerning the ability to handle calls to PURE EXTRINSIC
	(e.g. f77_local) routines inside of INDEPENDENT DO loops.

	One non-pgi hpf guru indicates that all EXTRINSICS will have side
	effects, so the notion of PURE EXTRINSIC is nonsense.

Vince,

We're already debating this question, as I BEAT YOU TO IT, and sent
in a CCI recently, asking whether

a.  an extrinsic(foo_local) routine could be pure (for foo = HPF, F77, C, etc.)
b.  if so, would we allow them in foralls?
c.  whether pure or not, are they allowed in independent loops.


We discussed this at some length at the meeting, in subgroup C, and concluded
nothing.

We made these observations:

1.  If an extrinsic routine is of HPF type (HPF< HPF_SERIAL, or HPF_LOCAL)
then the same syntactic rules that constrain PURE functions could be enforced
by the HPF compiler.

2.  Pure routines can call only pure routines, and no message passing library
that we know of has been "certified" as pure, so there is not
much one could do in a pure local extrinsic.   HPF_SERIAL, however, maybe
fine.

3.  We didnt see any semantic reason for disallowing extrinsic local
routines in an independent loop; recall that they need not be PURE.
Here is an example of why you might want to do it:


           real x(100, nprocs)
           !hpf$ distribute x(*, block)

           !hpf$ independent
           do row = 1, 100
              x(row, :) = extrinsic_local_fn(x(row,:))
           enddo


The implementation we have in mind is that 100 threads are started on each processor.

For HPF_LOCAL, the documentation says that there is a barrier before and after each
call.   If so, the load balancing possibilities of the example above are lost.
So, we have in mind the following possible improved implementation.  In such a loop,
there is a barrier before the first and after the last call, but not before/after the
intervening ones.

Now there are lots of interesting questions about thread-safety, i.e.,
how do I keep messages due to the ith call from interfering with those generated
by the other 99 calls, which might be running concurrently on other processors.


Rob

---------------------------------------------------------------------------
To (un)subscribe to this list, send mail to
hpff-interpret-request@cs.rice.edu.
Leave the subject line blank, and in the body put the line
(un)subscribe <email-address>
---------------------------------------------------------------------------

