Subject: hpff-external: Descriptors

From: Doug MacDonald <[email-masked]>
Date: Wed, 13 Sep 95 11:57:48 EDT

---------------------------------------------------------------------------
[email-masked] is a mailing list for discussion of external
interfaces between HPF and other languages/systems.  Instructions for
adding or deleting yourself from this list appear at the bottom of this
message.
---------------------------------------------------------------------------

   From: [email-masked] (Scott B. Baden)
   Date: Tue, 12 Sep 1995 17:06:51 -0700 (PDT)

   Rob,

   As a follow on to this: what about the converse, that is
   calling HPF from another languge (e.g. C++)? In this case
   HPF is viewed as the extrinsic language.

   This has gotten somewhat bogged down (apparently in part
   due to leadership changes in the C++ committee),
   but it would be nice to discuss this next week.

   I've had some prelimenary discussions with Chuck.
   It appears that Annex A is a good source of ideas for
   deriving  the facilities that would be needed on the C++ end.
   (This isn't surprising since we are in effect providing
   facilities that mirror the HPF-to-external interface)

   To get the ball rolling.  Let's say we have an SPMD program,
   that is a group of processors (e.g. an MPI communicator)
   all executing the same program in loosely synchronous fashion.

This is very much along the lines of what I have in mind.  However, I think
that Chuck K. had a good point in an earlier communication when he said
that it would be difficult (and possibly a bad idea as well) to try to get
implementors to standardize on the _implementation_ of a descriptor set.

For one thing, depending on what language features belong to the subset of
HPF implemented by the compiler used to compile the HPF routine called by
the C routine, the descriptor set may be more or less complex.  For
example, if CYCLIC and CYCLIC(n) distributions aren't supported, or if
non-unit-strided and offset alignments aren't supported, the descriptor set
might be much simpler.  Standard creation/inquiry functions probably are
more realistic.

Doug

   What we need need an etry to initialize the HPF run time system
   i.e. to identify global processor arrangments.  We also need
   a routine much like your create_mapped_array_descriptor(), with arguments
   that specify the global shape, the processor array, distribution
   and alignment and so on.

   Our SPMD program collectively allocates mapped arrays,
   collectively calls HPF routines.  There would have to be
   some agreements worked out,  i.e. that on entry to an HPF routine
   from C++ a scalar must have the same value on all processors,
   (this mirrors the languge in Annex A for calling C from HPF)
   and that mapped arrays called from C++ would
   have to promise to match the declarations on the HPF end and so on.

   We can also support task parallelism, through the use of
   multiple MPI communicators.  Then we could think of multiple
   SPMD programs calling different HPF routines.  

   Though the facility should work in principle with any language,
   at this point I would tend to be biased to C++.

   Comments?

   Scott

   >  
   >  ---------------------------------------------------------------------------
   >  [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.
   >  ---------------------------------------------------------------------------
   >  
   >  I think that a standard descriptor format would be
   >  a good idea, but it should be in the form of a fortran 90
   >  derived type, that can be replicated, for example, and passed as
   >  an ordinary parameter to an extrinsic routine; then a library
   >  routine would be used to set it up:
   >  
   >  	interface
   >  	   extrinsic (c_local) function c_local_fn(desc)
   >             integer c_local_fn
   >             type (mapped_array_descriptor) desc
   >          end interface
   >  
   >  	type (mapped_array_descriptor) x_desc
   >  	real, x(100,200)
   >  !hpf$ distribute x(block, *)
   >  
   >  !
   >  !   call an hpf library routne to create the exportable 
   >  !   array descriptor for x
   >  !
   >  	x_desc = create_mapped_array_descriptor(x)
   >  	call c_local_fn(x_desc)
   >  
   >  ---------------------------------------------------------------------------
   >  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>
   >  ---------------------------------------------------------------------------
   >  

---------------------------------------------------------------------------
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>
---------------------------------------------------------------------------