Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] Fortran derived types
From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2010-05-05 08:07:01


Yes, you can use derived datatypes in MPI -- but be sure to read the language chapter in the MPI-2.2 spec to be aware of a series of issues with Fortran.

We're actively working on "better" Fortran MPI bindings that won't have issues with sending Fortran derived types (the current "medium" sized OMPI F90 bindings won't compile with Fortran derived types because they use function overloading to only accept a fixed number of types for MPI choice buffers).

On May 4, 2010, at 4:31 PM, Vedran Coralic wrote:

> Yes, all the component arrays of the derived type vector are of the same size, though I am not sure that that actually makes the task any easier?
>
> I suspected, just as you said, that copying the data into a contiguous block of memory might be the best solution. I was hoping though that I could make it more elegant/efficient using the MPI derived type feature.
>
> Thanks for the quick response Derek
>
> 2010/5/4 Cole, Derek E <derek.e.cole_at_[hidden]>
> Others may be able to chime in more, because I am no fortran expert, but you probably will have to copy it into a contiguous block in memory. Working with derived types is hard, especially if they are not uniform. MPI can probably technically handle it, but the programming effort is harder. Are your arrays all equal length, same type?
>
>
> Derek
>
>
> From: users-bounces_at_[hidden] [mailto:users-bounces_at_[hidden]] On Behalf Of Vedran Coralic
> Sent: Tuesday, May 04, 2010 3:25 PM
> To: users_at_[hidden]
> Subject: [OMPI users] Fortran derived types
>
>
> Hello,
>
>
> In my Fortran 90 code I use several custom defined derived types. Amongst them is a vector of arrays, i.e. v(:)%f(:,:,:). I am wondering what the proper way of sending this data structure from one processor to another is. Is the best way to just restructure the data by copying it into a vector and sending that or is there a simpler way possible by defining an MPI derived type that can handle it?
>
>
> I looked into the latter myself but so far, I have only found the solution for a scalar fortran derived type and the methodology that was suggested in that case did not seem naturally extensible to the vector case.
>
>
>
> Thanks any help you can give me!
>
>
> --
> Vedran Coralic
>
>
> _______________________________________________
> users mailing list
> users_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/users
>
>
>
> --
> Vedran Coralic
> _______________________________________________
> users mailing list
> users_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/users

-- 
Jeff Squyres
jsquyres_at_[hidden]
For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/