Subject: Re: Restricted contexts

From: [email-masked] (Tom Henderson)
Date: Tue, 2 Feb 93 09:47:49 MST

A few (probably dumb) questions about Jim's context proposal:  

> MPI_CONTEXT MPI_NEWCONTEXT(MPI_GROUP group);
> Allocate a new context for use within the given group (may be
> MPI_NO_GROUP, in which case the allocation is entirely local). Returns
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> MPI_NO_CONTEXTS if there are no suitable free contexts left. 
> If the group is not MPI_NO_GROUP, then this is a barrier
> synchronisation of all the processes in the group, and the result of
> the function is the same in all of the participating processes.

In what situations would I want a context that is entirely local?  Would I 
need to send this context to a process I intend to communicate with?  

I like the idea of being able to create a context within a group for 
scalability reasons.  How do I know that two groups will not get the "same" 
new context returned from separate calls to MPI_NEWCONTEXT()?  Is this even 
a problem?  

> One of the arguments to the send routines (both diadic and collective)
> would then be an MPI_CONTEXT to which the message will be sent.

Does this mean that MPI_CONTEXT is NOT a required argument to a receive 
routine?  (Maybe I'm missing the whole point of this proposal!  If so, please 
educate me.  A pseudo-code examle might be very helpful.)  

> Although this is a long message I'm not offering beer. [The pound is
> now down to $1.45 and still falling !]

This whole beer thing is getting pretty scary.  I think I'll keep all my 
messages short!  :)

Tom Henderson
[email-masked]

---

From: [email-masked] (James Cownie)
Date: Tue, 2 Feb 93 17:51:15 GMT

> A few (probably dumb) questions about Jim's context proposal:  
Not dumb.

> need to send this context to a process I intend to communicate with?  
The basic model I have is that contexts are very similar to Unix file
descriptors (maybe I should have said this more explicitly). Therefore
you can create them locally, however if someone is going to send a
message to one of your contexts the they need to know its identity. So the
answer to the second question is YES, you'll have to send it to them
[hence the bootstrap problem...].

> new context returned from separate calls to MPI_NEWCONTEXT()?  Is this even 

Since contexts are allocated within a group and context creation is a
barrier synchronisation there are two cases to consider :-

1) the two groups creating contexts are disjoint.
   In this case the contexts are independently created, and may indeed
   be given the same number. (Just as opening files in two processes
   can return the same file descriptor). I don't think this is a
   problem.

2) The two groups share some members.
   In this case we only have a problem if we have threads (since
   otherwise a single thread needs to be at two barriers
   simultaneously, which it can't.) If we do have threads, then there
   will have to be a lock in the library to ensure that different
   results are given to the two groups.
   
> educate me.  A pseudo-code examle might be very helpful.)  
No you do need a context in the receive (though it might be optional
in the "simple" versions with some specific default value).

The issue I was addressing was whether a send needed to specify one
context (that at the target), or two (that at the target and that at
the sender). I was tending towards the former solution.

I'll try to write some examples tomorrow.

-- Jim
James Cownie 
Meiko Limited			Meiko Inc.
650 Aztec West			Reservoir Place
Bristol BS12 4SD		1601 Trapelo Road
England				Waltham
				MA 02154

Phone : +44 454 616171		+1 617 890 7676
FAX   : +44 454 618188		+1 617 890 5042
E-Mail: [email-masked]   or    [email-masked]