Newsgroups: comp.parallel.mpi
From: James Cownie <jcownie@bbn.com>
Subject: Re: MPI pointer cacheing
Organization: BBN
Date: 24 Sep 1996 08:39:22 GMT
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <5286nq$oiq@newsbeta.dircon.co.uk>

supalov@lindengmd.de (Alexander Supalov) wrote:
>Hi, guys,
>
>I tried to put address of FORTRAN 90 array into MPI cache
>(by MPI_PUT_ATTR), with all paraphernalia I deem
>appropriate (see source below).
>
>However, it does not work on IBM SP2 I use.
>
>Now, the questions:
>
>Is it possible to put address to MPI cache in FORTRAN 90?
>Is it possible to retrieve the address previously put and
>use it to reference arrays?

The Fortran binding of the MPI attribute cacheing functions has an INTEGER as 
the cacheable value. Attempting to cache non-integers is very unlikely to work.
(This is not an attempt by the MPI Forum to prevent users from doing what they
want, but a result of the fact that Fortran 77 does not have any pointers
defined in the language).

F90 pointers are much more complex objects,
you normally need at least
	boolean flag    -- is this pointer allocated
	boolean flag2   -- is this pointer allocatable
	pointer to the data
	foreach dimension 
	    base
	    end
	    stride

The MPI cacheing function will only store the first integer from the pointer.
Therefore the code will very likely crash (as you have observed !).

One possible solution would be to have an array of a user defined type 
containing the pointer and save the index into the array then you should be
able to get back to the pointer using the cached index value and the globally
(or module wide) visible array of "pointers".

-- Jim 
James Cownie
Dolphin Toolworks
jcownie@dolphinics.com


