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
2010-04-22 16:41:04
A:
Yes, but you'll need to define a new MPI datatype that desribes the memory layout of your struct. More info here.
suszterpatt
2010-04-23 11:07:52
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
2010-07-01 17:56:10