views:

226

answers:

3

Is it possible to send a structure as a datatype in Open MPI?

+1  A: 

Yes, have a look first at MPI_TYPE_CREATE_STRUCT, or if your implementation does not include MPI-2 features, the older MPI_TYPE_STRUCT.

High Performance Mark
A: 

Yes, but you'll need to define a new MPI datatype that desribes the memory layout of your struct. More info here.

suszterpatt
A: 

If you are using C and your cluster uses the same hardware on every node you can memcopy the structs in and out of an MPI_BYTE array when passing them around. You do have to be careful of offsets and endian issues. Works for one of "script" type programs but you would never want to do this in production unless you had a standard API for marshalling.

Chad Brewbaker