Re: GM-2, send/recv and size of messages
Patrick Geoffray <[email protected]> Wed, 05 May 2004 12:24:00 -0400
| Newsgroups | gmane.network.myrinet.general |
|---|---|
| Organization | Myricom, Inc. |
| Message-ID | <[email protected]> |
Hi Thomas, Thomas Traub wrote: > I am working with GM-2. After reading the docu: > http://www.myri.com/scs/GM-2/doc/html/Receiving_Messages.html#receiving > it says that the size of the incomming message and the size of the buffer provided for receiving must match EXACTLY. > This is very strange and uncomfortable. Well, this is the world of the GM API :-) It took me a while to get it right, but the catch is that the "size" is not the "length". The size in the GM API can be seen as a tag, something to use to match incoming messages with posted receive buffers. GM used to enforce a complicate relationship between length and size (the length of a receive buffer should be at least the power of 2 of the size, aka gm_max_length_for_size(), but it was dropped in the implementation because it was confusing, evil and useless IMHO). But there is one remaining catch, this minimum length for the size if still needed somehow for small messages. To be safe and to not follow the weird restrictions on the length, I use the GM size as a tag between the value 9 and 31 and I don't have to deal with minimum lengths. > #define GMPI_PKT_GM_SIZE 30 That means I am using the tag 30 for the data packets (whatever their length is). I used to use another tag, 31, for the initialization packet but not anymore. As you can guess, a tag range as small as 9 to 31 is pretty useless for MPI that uses much more complex matching rules. So I pick one GM size for everything and do the matching myself in the MPICH-GM lib. In MX, the matching space is 64 bit maskable, and there is no relationship between matching information and length of the send or the receive. It's night and day. Hope it helps Patrick -- Patrick Geoffray Myricom, Inc. http://www.myri.com