I haven't yet tried the structure approach, since its part of a large
task. The question arises due to a horrific experience dating 5 years
back, in which I send/received fortran 90 sub-arrays and only after a
while discovered that the received packets were ALMOST correct (btw this
was NOT LAM-MPI). On the other hand, although sub-arrays in fortran 90
according to the standard are transferred by value, it would be
meaningful if arrays in a structure were transferred, as you imagine, by
reference.
Anyway, I will give it a bash and let you know if I succeed. If
unsuccesful, I still have a fallback (transfer the array to an
intermediate subroutine, so that the actual transfer to the MPI routine
can be fortran 77 style).
Best regards, Jess Michelsen
On Tue, 2004-01-13 at 08:25, Jeff Squyres wrote:
> Oy -- I'm unfamiliar with the syntax that you've used (I have barely used
> fortran in the past 20 years...). I'm *guessing* that it's ok, but I
> don't know for sure.
>
> What LAM will do is take the address that is passed (all calls to LAM/MPI
> from fortran are actually implemented as C function calls, and Fortran
> passes all parameters to C by reference... so I'm guessing that C gets the
> address of Node(np)%rec).
>
> Have you tried it to see if it would work?
>
>
> On Mon, 12 Jan 2004, jess michelsen wrote:
>
> > Hi everyone!
> >
> > Just a simple question on fortran/LAM-MPI interaction. I intend to call
> > MPI routines using arrays, that are part of a structure, i.e.
> >
> > call MPI_RECV(Node(np)%rec,count(np),MPI_DOUBLE_PRECISION,np-1,np
> > & ,MPI_COMM_WORLD,status,ierr)
> >
> > Would this require anything else (such as fortran 90 bindings or the
> > like) than a standard f77 style call ?:
> >
> > call MPI_RECV(rec,count,MPI_DOUBLE_PRECISION,np-1,np
> > & ,MPI_COMM_WORLD,status,ierr)
> >
> > Best regards, Jess Michelsen
> >
> >
> > _______________________________________________
> > This list is archived at http://www.lam-mpi.org/MailArchives/lam/
> >
>
> --
> {+} Jeff Squyres
> {+} jsquyres_at_[hidden]
> {+} http://www.lam-mpi.org/
> _______________________________________________
> This list is archived at http://www.lam-mpi.org/MailArchives/lam/
|