Looking for Portable MPI I/O Implementation?
rikt writes "I am trying to implement MPI I/O for our CFD product. I am facing a problem with the portability of the generated data files. MPI2 interface describes a way to achieve this either by using 'external32' or user defined data representations. The problem is that ROMIO, the most widely available MPI I/O implementation, has not implemented support for any data representation other than 'native'. Do you know of any MPI I/O implementation that supports this, and is available on various platforms? I know IBM and Sun supports this, but I am looking for a solution on Linux and Windows (both 32 & 64 bit) as well."
Go away and read.
/. This type of question is great, it usually means I'll go off and read up on this stuff.
I hate the drivel question asked on
Think of it this way.
typedef struct MessageStruct {
int messageType;
int messageSize;
} Message;
Message msg;
msg.type = messageType;
msg.size = sizeof(Message);
msg.data = someData; /* repeat for each part of the message struct*/
SendMessage(&msg, msg.size);
MPIMessage msg;
if (msg.size == sizeof(Message)) {
Message *msg = &msg;
}
I think something along these lines should work. Just make a struct for each type of message your app has. Then check the size and type elements of the structs to determine which type of message you have recieved. You can also just make a struct with just a type and size field and copy the first 8 bytes of the message into that and use that to determine the type of message. I'm sure I am missing some implementation details, but something like this should handle your problem.
"Those that start by burning books, will end by burning men."