Newsgroups: comp.parallel.mpi
From: supalov@lindengmd.de (Alexander Supalov)
Subject: MPI pointer cacheing
Keywords: MPI, cacheing, pointer
Organization: GMD/SCAI.NUM
Date: 23 Sep 1996 11:06:44 GMT
Message-ID: <525r04$48j@omega.gmd.de>

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?
If yes for both above, what's wrong about my code?

Alexander

Source:

--- 8< ----------------------------------------------- >8---
      program t

      include 'mpif.h'

      double precision, allocatable, dimension(:)       :: a
      double precision, pointer, dimension(:)   :: pa
      integer key,extra,adr
      logical flag

      call MPI_INIT(code)

      allocate(a(3))

      a(1) = 1
      a(2) = 2
      a(3) = 3

      write(0,*) 'before: a =',a

      call MPI_KEYVAL_CREATE(
     &  MPI_NULL_COPY_FN,MPI_NULL_DELETE_FN,
     &  key,extra,code)
      call MPI_ADDRESS(a,adr)
      call MPI_ATTR_PUT(MPI_COMM_WORLD,key,adr,code)

      call MPI_ATTR_GET(MPI_COMM_WORLD,key,pa,flag,code)

      if (flag) write(0,*) 'after: pa =',pa

      call MPI_FINALIZE(code)

      end
--- 8< ----------------------------------------------- >8---

Trace:

--- 8< ----------------------------------------------- >8---
 before: a = 1.00000 2.00000 3.00000

ERROR: 0031-250  task 0: Segmentation fault
--- 8< ----------------------------------------------- >8---

Dr. Alexander Supalov
GMD  -- German National Research Center for Information Technology
SCAI -- Institute for Algorithms and Scientific Computing
Schloss Birlinghoven                    phone:  +49 2241 14 2371
53754 Sankt Augustin                    fax:    +49 2241 14 2102
Germany                                 e-mail: supalov@gmd.de


