Subject: Re: inter-communication

From: [email-masked] (Tom Henderson)
Date: Mon, 26 Jul 93 15:35:08 MDT

Tony writes:  

> Comment:
> 
> 	Make context opaque
> 	Make flatten/unflatten for it
> 	Add attribute to contexts (at creation)
> 		intra-communicator only (default)
> 		inter-communication OK
> 
> This adds to safety, allows one to hide the dual context nature in
> communicators, and should allay concerns of Jim Cownie about unsafe
> contexts.  It euphemizes implementations, so there would be much
> more freedom in implementation, with the opaque context.
> 
> This upsets Sandians, because it limits ability to access contexts
> like well-known ports.
> 
> What do you think?  Does it help with inter-communication?
> - Tony

First off, I like the idea of an opaque context.  This would certainly solve 
the "security" problem of:  

  MPI_COMM_BIND(groupA, 5, commA);

Opaque contexts are clearly managed by MPI.  

It don't think opaque contexts solve the problem of binding the same context 
to multiple groups:  

  MPI_CONTEXTS_RESERVE(1, &contextA);
  MPI_COMM_BIND(groupA, contextA, commA);
  MPI_COMM_BIND(groupB, contextA, commB);
  userStartOp(commA, ...);
  userStartOp(commB, ...);                                     /* now what? */
  ...
  userEndOp(commB, ...);
  userEndOp(commA, ...);

...of course, this program may be "erroneous".  :-)  

However:  what if a "bind" operation "destroys" a context object?  This would 
eliminate the possibility of multiple bindings.  An "unbind" would "re-create" 
the context object (in user space).  

I'm a bit confused by flatten/unflatten and by what it means to send a context 
to another process.  If context registration is managed by a global context 
server (visible to all processes) and if context creation routines (like 
MPI_CONTEXTS_RESERVE()) communicate with the server to generate new contexts, 
then I understand what I get when I unflatten a context (because any context 
is globally unique).  If not, how do I interpret the context I get from 
unflatten?  

If I call MPI_CONTEXTS_RESERVE() after unflattening a context, is it possible 
that I can get the "same" context?  If not, then the context unflattening 
operation must update some internal table so I don't accidentally get the same 
context later.  If I update a table, what happens if the unflattened context 
is already in the table?  

Another possibility is that the user could maintain a list of contexts in use 
and manage any conflicts explicitly, in which case I need a routine that will 
tell me if two contexts are the same.  I also need a routine that will enter a 
context in the "local registry" by "value".  Since contexts are opaque, this 
does not necessarily destroy "security".  

These questions also apply to MPI_COMM_FLATTEN() and MPI_COMM_UNFLATTEN() in 
the current draft.  I think I understand flattening and unflattening a 
group...  :-)  

As far as an (intra-communication/inter-communication) attribute, we 
definitely need this.  We could attach this attribute either to a communicator 
or to a context.  Which is the "best" place?  Does attaching it to a context 
imply that an implementation could use different methods for managing 
"intra-group" and "inter-group" contexts?  Seems like this ought to be a good 
thing.  I need to think about this some more...  

That's enough for now, my brain hurts...  

Tom