Newsgroups: comp.parallel.mpi
From: maggie@cherry340.cray.com (Margaret Cahir)
Subject: Re: Dynamic memory allocation in Fortran
Organization: Cray Research a subsidiary of Silicon Graphics, Inc.
Date: 17 Sep 1996 17:00:49 GMT
Message-ID: <51mlg1$rrl@walter.cray.com>


Marc Snir writes:

>  Current design for put/get in MPI2 assumes that some of the communication functions will be
>  available only on systems that support dynamic memory allocation.  This requires, in Fortran,
>  support for nonstandard C-like/Cray-like pointers (integer variables that hold an address).
>  The type of code that is assumed to be supported is as shown below
>
>  REAL A
>  POINTER (P, A(100,100))  ! P is an integer pointer variable, pointing to A
>  CALL MPI_MEM_ALLOC(400, COMM, P, IERR) ! allocates memory and returns in P address
>  ! Now array A can be used
>
>  Questions:
>
>  1. Can somebody point me to a Fortran system that does not support such syntax?
>  2. Can someobdy point me to a Fortran system that does not support at all this functionality,
>  i.e., does not allow to return an address in an integer variable, and have this address used
>  as the starting address for an array?  (These are not Fortran 90 pointers!)
>  3. What should be the type of the 3rd dummy argument of MPI_MEM_ALLOC, on 64 bit systems?

Marc,

On CRAYs, the Cray pointer is of type Cray pointer (i.e., you don't add any
other declarations). From the F90 manual:

   The value of a Cray pointer occupies one machine word on Cray PVP systems
   other than T90 systems.  The value of a Cray pointer occupies 2 machine
   words on T90 systems, T3E systems and SPARC systems.  Its range of values
   depends on the size of memory for the machine in use.


What I wonder, though, is why use Cray pointers instead of F90 pointers?
I would think F90 pointers would be more standard. (It's what we have
choosen to go with for our F-- work).

Margaret Cahir
maggie@cray.com
-- 
--------------------------------------------------------------------------
Margaret A. Cahir                       Scalable Applications & Algorithms 
maggie@cray.com                         Cray Research, Inc.
                                        655E Lone Oak Rd., Eagan, MN 55121

