Re: MPI_Type_resize

Dick Treumann (treumann@kgn.ibm.com)
Mon, 21 Apr 1997 16:06:10 -0400

I agree with Rajeev's statement that the meaning of MPI_TYPE_RESIZE
created lb and ub markers is not defined well enough. I suggest that
the cleanest view is that the markers placed by MPI_UB and MPI_LB are
strong or sticky markers. The MPI_TYPE_RESIZE call creates a new type
which has weak LB and UB markers. A weak marker is one that has the
same genetic force as the displacement of real data. An application of
a datatype which has an explicit but weak UB behaves AS IF it were
carrying a data implied UB. (Except when passed to MPI_GET_TRUE_EXTENT.)

If I have MPI_Datatype T1S which was created with a strong UB (using
MPI_UB) at displacement 16 and then use it to create T2 which has a T1S
at zero and an MPI_INT at 100 I get a strong UB at 16 in T2. Even if I
create T2 with an MPI_UB at 10 I still get the UB at 16 in my resulting
T2. The MPI_UB in T1S is sticky.

If I make T1W which has a weak UB at 16 and an MPI_INT at 100 then any
use of T1W in communication, IO or type construction contributes that UB
of 16 with the same force as a UB which comes from data. Therefor, if I
make T2 with 2*T1W at 0 and an MPI_INT at 8, the UB of T2 is 32. If I
make T2 with 2*T1W at 0 and an MPI_INT at 100, the T2 UB is 104.

Any MPI_TYPE_STRUCT call which uses MPI_LB or MPI_UB overrides a weak LB
or UB and it makes no difference whether that weak LB/UB came from data
locations or MPI_TYPE_RESIZE calls. The strong MPI_LB/UB is there in
the new datatype and only an MPI_TYPE_RESIZE call or a lower-MPI_LB or
higher-MPI_UB can knock it loose.

I think this view is consistent with the general usefulness of pseudo
UB, LB and extent. In the rare conditions where the user really needs
to get back to LB,UB and extent that are based on actual data positions
he can call MPI_GET_TRUE_EXTENT and then use MPI_TYPE_RESIZE.

-- 
Dick Treumann                               IBM RS/6000 Division
(Internet) treumann@pok.ibm.com             Poughkeepsie, NY
(VNET)     TREUMANN at KGNVMC               Tel: (914) 433-7846
(internal) treumann@windsurf.pok.ibm.com    Fax: (914) 433-8363