Subject: Re: PACK/UNPACK

From: Tony Skjellum <[email-masked]>
Date: Wed, 18 May 94 09:56:33 CDT

Rolf,

Rolf, I think I disagree.  I think we explicitly said that
MPI_PACKED messages had to be received with MPI_PACKED type also.  In fact,
I remember that we voted to that effect.  I recall that Marc proposed the
strategy still currently in the book.

The whole discussion centered around the desire to optimize protocols, and
it was pointed out (probably by Jim) that one wants to make sure one is
getting some real optimizability from a specific design choice.  In many
cases, no optimizability results, as we discussed at length.

What is in the draft is usable, but I do think we departed from the actual
committee decision here in some degree.  Does anyone have the minutes?
Please correct me if I am mistaken.

The implications of the current strategy are, in my opinion,
i) the receiver does not need to know if the sender used PACK/SEND or did 
a single SEND with a datatype... that sounds good, a good portability
requirement from PVM, etc, etc.

ii) The discussion of packing units implies that if two packs of 
type MPI_INT are done, then it is equivalent to a single longer pack,
in a single packing unit.

This requires the implementation to track things like alignment.  Still
doable.

iii) The cryptic discussion of multiple packing units really means that
one can take MPI_PACKED buffers b1, b2 and so on and further MPI_PACK
them, even hierarchically.  That feature sounds good, but the receiver
definitely needs to know what the sender is doing in that case.  I think
we would be better off with regular derived datatyped at this point.
The draft kindly does not require b1 concat b2 to be a packing unit itself.

-Tony

---

From: [email-masked] (James Cownie)
Date: Wed, 18 May 1994 16:46:16 +0000

> Please correct me if I am mistaken.
My notes (which are a little sketchy) have
                                            Y N A
Pack/unpack take a communicator		   13:0:1
Can you mix regular send with packed rx    10:1:6
	and converse
Add new packed type                         9:1:7
Enforce packed type for packed buffers      5:3:9

So my understanding of this is that :-

1) A packed buffer MUST be sent as MPI_PACKED 

2) Anything which is going to be unpacked must be received MPI_PACKED

3) A combination of pack, send MPI_PACKED is indistinguishable at the
   receiver from a send with a datatype whose type signature is the
   concatenation of the ones used in the packing operation(s).

4) The discussion on packing units says (in effect) :-
	A set of pack operations forms a packing unit provided that
        the user does not adjust the position argument between calls.

	A single pack unit can be transferred as above.

	You cannot take more than one pack unit and send them all in
	one message and then treat that as a single pack unit at the
        far end. (So you can't receive this concatenation with a
        normal typed receive and expect to get sense).

What I don't understand (yet) is how to transfer a concatenation of
pack units. MPI_PACKED is definitely wrong, so I guess you use
MPI_BYTE, and it is up to the MPI system to ensure that there is
enough info in the packed message to be able to interpret it correctly
when required.

If you like a pack unit is a record. You can send a single record and
receive it as a normal message with matching type signature, or you
can do a normal send and receive that as a single record. But if you
send multiple records in a single message, then you need to separate
the records to unpack each one independently. 

-- Jim 
James Cownie 
Meiko Limited			Meiko Inc.
650 Aztec West			130C Baker Avenue Ext.
Bristol BS12 4SD		Concord
England				MA 01742

Phone : +44 454 616171		+1 508 371 0088
FAX   : +44 454 618188		+1 508 371 7516
E-Mail: [email-masked]   or    [email-masked]
WWW   : http://www.meiko.com:8080/welcome.html