[mpiwg-sessions] [EXTERNAL] RE: MPI_Session_init semantics question/poll

Martin Schulz schulzm at in.tum.de
Tue Jan 10 00:36:21 CST 2023


Hi Dan, all,

 

More comments inline.

 

Martin

 

 

--

Prof. Dr. Martin Schulz, Chair of Computer Architecture and Parallel Systems

Department of Informatics, TU-Munich, Boltzmannstraße 3, D-85748 Garching

Member of the Board of Directors at the Leibniz Supercomputing Centre (LRZ)

Email: schulzm at in.tum.de

 

 

From: "Holmes, Daniel John" <daniel.john.holmes at intel.com>
Date: Monday, 9. January 2023 at 16:36
To: Martin Schulz <schulzm at in.tum.de>, MPI Sessions working group <mpiwg-sessions at lists.mpi-forum.org>
Cc: "Pritchard Jr., Howard" <howardp at lanl.gov>
Subject: RE: [mpiwg-sessions] [EXTERNAL] RE: MPI_Session_init semantics question/poll

 

Hi Martin,

 

Responses inline.

 

Best wishes.

Dan.

 

From: Martin Schulz <schulzm at in.tum.de> 
Sent: 06 January 2023 02:14
To: Holmes, Daniel John <daniel.john.holmes at intel.com>; MPI Sessions working group <mpiwg-sessions at lists.mpi-forum.org>
Cc: Pritchard Jr., Howard <howardp at lanl.gov>
Subject: Re: [mpiwg-sessions] [EXTERNAL] RE: MPI_Session_init semantics question/poll

 

Hi Dan,

 

A few comments (kind of many intertwined good discussions 😊 ):

 
Have we ever been able to define the difference between immediate and local? I know there is a perception difference, but what is difference to the user? What is too long for an immediate call? Are we disallowing progress? If so, what happens if the OS switches threads (this “blocks” the current one) and then the other thread makes progress? I don’t we can define this – I think for the user these two things will always be the same (from how they have to program) and an implementation will always have the freedom to do what it wants – there could at most be a performance expectation or advice to implementors.
 

[DAN] This has always been the argument against attempting to differentiate between immediate and local; it has always been a successful argument. It means text stating that persistent point-to-point initialization procedures “involve no communication” (MPI-4.0 section 3.9 page 94 line 37) is an erratum we should fix – how can we say that when the OS might context switch to another thread that does legitimately does communication? Also, we do define the semantic of immediate without naming it – when we describe the independence of basic runtime routines (MPI-4.0 section 2.9.1, page 28, lines 24-27) – all “library routines that are part of the basic language environment” have this unnamed immediate semantic, even though the OS could preempt a call to “printf”, context-switch to a different MPI process, and do MPI things.

 

[MARTIN] I think we agree here then, we need to treat immediate and local as the same from a user’s point of view – is this what you mean?

 
Why should an MPI implementation be prevented from calling the progress engine in a Comm_rank call? Why would it not be able to communicate, if it wants to? E.g., is a PMPI wrapper implementation that sends an acknowledgement that this call has been made to a central location and waits for it being received an incorrect wrapper?
 

[DAN] Permitting poking the (local) progress engine during the call and requiring some (remote) progress to happen before returning from the call are observably different – the first cannot delay until remote action, the second can be arbitrarily delayed by refusing to enter MPI at another MPI process. OTOH, the example you give (reliably log procedure call) is not an MPI progress action, so it is irrelevant to the discussion of immediate vs. local. If the PMPI wrapper used MPI to send the log entry and MPI to ensure it has been received, then the wrapper would be nonlocal, so you cannot mean that. You must be intending usage of some non-MPI communication mechanism, which is a bad idea in the presence of pending MPI communication (MPI-4.0 section 11.10.5 page 549 line 21 says it’s UB), which makes calling your intercepted MPI_COMM_RANK risky.

 

[MARTIN] No, I actually meant using MPI send/recv to send the logs – If I intercept an MPI API with PMPI, I (as the tool writer) need to make sure that the (modified) API is consistent with the MPI standard, i.e., I offer a local semantics in case of calls with Comm_rank. However, how I do this, should be up to me as the tool writer. If I reserve an MPI process for tools work, create a new “fake” COMM_WORLD with that process and then have the application work on that, plus I use that extra process in a way that guarantees that any send to that process from the wrappers is always enabled (in the sense we are trying to define it), I am still honoring that guarantee and keeping Comm_rank local for the application running on top of my PMPI layer. However, if we start distinguishing local and immediate and we disallow such weak local behavior to occur in some calls, then all the tools that use this become incorrect, which would be bad.

 
As for the Sessions API – I agree with most of what you say on local vs. non-local, but this is the user’s perspective. I was more asking about whether there is ever a need for an implementation to wait for something to complete. If we can really exclude that, then we should be good – however, I doubt we can do that for sure going forward.
 

[DAN] We can always exclude that wait because we can always postpone that wait.

 

[MARTIN] That would be good – not 100% convinced, yet, if we can have the needed information handy at this point – but I am happy to be convinced otherwise.

 
As for the waiting for changes – shouldn’t this be part of the query of the process list? Why a separate call?
 

[DAN] No. Because we already have the separate calls and all of them have the necessary semantic. The only process sets that could be *discovered* by a subsequent query call are ones where the calling MPI process is not a member. 

 

[MARTIN] The list of process sets  can grow and hence it should be able to discover new process sets, even with the local process being a member – we just cannot remove processes sets.

 

[DAN] The existing immediate/local query will check for such changes but not delay until such a change happens. 

 

[MARTIN] I did not mean to wait until a change happens, but we probably want some consistency or mechanisms to ensure this. Consider the following code

 

SESSION_INIT

QUERY PROCESS SETS

…

BARRIER

…

QUERY PROCESS SETS

 

If the runtime adds a process set between the first query operation and the barrier that includes more than one MPI process in the communicator that is used in the barrier, would you expect for this process set to show up in the second query calls in all of the MPI processes? If so, there may be the need for some synchronization in the processes set engine. You could do that in each and every barrier, but this could be costly. It is likely very advantageous to have the ability in the query routine to synchronize. If the process sets can be different, what mechanism can the user us to ensure he/she can “trust” the process set information to be accurate, i.e., when can they call a communicator creation safely?

 

[DAN] If you want “I know a change is supposed to happen eventually, delay here until it does and tell me about it” then you need a new probably-nonlocal procedure (it’s return depends on remote action, but not yet an MPI procedure because we have no MPI way to create new process sets). 

 

[MARTIN] From an MPI perspective, this would still be local, as no semantically related MPI procedure call is required.

 

[DAN] This is all very speculative until we define sessions 2.0 with mechanisms to create new process sets. Achieving consensus on the new process set (content and naming) is on our list of semantic concerns in the Sessions WG for such functionality.

 

[MARTIN] Agreed, actually reacting or explicitly waiting for process set changes is something for MPI 5.0.

 
Why do you want to see session_init as an immediate call? Shouldn’t this be able to setup things, which could include allocations possible triggering longer resource negotiations in the OS? That call should not be in the critical path?
 

[DAN] There is no requirement for MPI_Session_init to do anything complex, why do you want to add complexity where there is none and there is no need for it?

 

[MARTIN] See above – we cannot find a clear separation of local and immediate and once this should be a moot point. As for a use case, sending a log message for a tool would be important.

 

 

--

Prof. Dr. Martin Schulz, Chair of Computer Architecture and Parallel Systems

Department of Informatics, TU-Munich, Boltzmannstraße 3, D-85748 Garching

Member of the Board of Directors at the Leibniz Supercomputing Centre (LRZ)

Email: schulzm at in.tum.de

 

 

From: "Holmes, Daniel John" <daniel.john.holmes at intel.com>
Date: Thursday, 5. January 2023 at 02:50
To: Martin Schulz <schulzm at in.tum.de>, MPI Sessions working group <mpiwg-sessions at lists.mpi-forum.org>
Cc: "Pritchard Jr., Howard" <howardp at lanl.gov>
Subject: RE: [mpiwg-sessions] [EXTERNAL] RE: MPI_Session_init semantics question/poll

 

Hi Martin,

 

This seems like the best reason so far for differentiating “immediate” as the term that refers to the stronger semantic.

 

immediate = prohibited to delay its return – neither until (remote) progress nor until (remote) specific semantically-related MPI procedure call

local = permitted to delay its return until (remote) progress but not until (remote) specific semantically-related MPI procedure call

nonlocal = permitted to delay its return (remote) progress and/or until (remote) specific semantically-related MPI procedure call

 

 

Permitting progress in an API that was intended to be “lightweight” is bad. Progress could mean that MPI_Session_init delays its return while it pushes a few GB of buffered-mode send message data into a network – correctness is not affected, but performance expectations are. The canonical example is whether MPI_Comm_rank can delay its return while it does (remote) progress – currently “yes because local, but why would anyone implement it that way? It should be immediate.” The recent debate about whether MPI_Put is nonlocal is relevant here – correctness allows us to say “it doesn’t matter if MPI_Put is nonlocal because the user cannot create a deadlock” but the performance expectations of separating synchronisation from data movement instructions suggest that MPI_Put should be immediate, not even local, but definitely not nonlocal.

 

I would be much happier with some kind of explicit “update the list of process set names” API that has whatever semantic is needed, rather than allowing (remote) progress in any of the existing immediate APIs: “initialise a session”, “get the number of process set names”, “get the nth process set name”, and “make a group from this process set name”.

 

The trouble is: what is the appropriate semantic for the “update the list of process set names” API? We already have MPI_Session_init that will give an updated list of process set names if it is already different to previous lists given by previous sessions. We only need a “delay until something changes” semantic. What needs to change to satisfy this semantic? Is the first difference sufficient? Can/should the user specify what they are looking for? Is any difference actually necessary (should it have a timeout, in case nothing changes)? Is it collective (over which group)? Those questions are currently answered by the mechanism(s) that could possibly cause change to the list of process sets – spawn is an MPI operation, connect/accept are MPI operations, and so on. Initialising another session after one of these operations has completed will already get the up-to-date list of process sets (whether it changed because of the dynamic process model operation or not). Any future proposal for an API that extends/modifies/prunes the list of process set names needs to have a semantic that permits the appropriate consensus in its implementation. The consensus is needed by operations like “give me more resources”, “take these resources back”, etc – not by query functions.

 

Best wishes,

Dan.

 

From: Martin Schulz <schulzm at in.tum.de> 
Sent: 04 January 2023 22:43
To: Holmes, Daniel John <daniel.john.holmes at intel.com>; MPI Sessions working group <mpiwg-sessions at lists.mpi-forum.org>
Cc: Pritchard Jr., Howard <howardp at lanl.gov>
Subject: Re: [mpiwg-sessions] [EXTERNAL] RE: MPI_Session_init semantics question/poll

 

Hi Dan,

 

I fully agree with you on the difference between MPI and PVM and the need to keep things constant from the user’s perspective. They should not be impacted by this and hence also the agreement that none of this can be non-local (as this will impact the user).

 

However, at some point the underlying runtime will have to come to a consensus and that may come after a user would expect it relative to a local procedure call. This is not likely or probably not even possible with the current static scheme and implementation, but it will likely happen when we add more dynamic behavior.

 

An example could be newly spawned processes  and when they are ready and have established all their individual process set memberships. This could be, of course, pushed off to the user who would need to ensure the right timing, but it may also be better to give the runtime some leeway – again, not in the sense of non-local, but in the sense of weak progress.

 

This was actually my understanding of weak progress anyway – that any MPI routine could delay return for weak progress, but he hardened that only recently to operations only. For the current set of MPI routines that actually does not make a difference in execution, but here we could – by accident – add a limiter for future implementations and this is what I would like to avoid by opening up the chance for these routines to participate in progress.

 

Martin

 

 

--

Prof. Dr. Martin Schulz, Chair of Computer Architecture and Parallel Systems

Department of Informatics, TU-Munich, Boltzmannstraße 3, D-85748 Garching

Member of the Board of Directors at the Leibniz Supercomputing Centre (LRZ)

Email: schulzm at in.tum.de

 

 

From: "Holmes, Daniel John" <daniel.john.holmes at intel.com>
Date: Wednesday, 4. January 2023 at 10:17
To: Martin Schulz <schulzm at in.tum.de>, MPI Sessions working group <mpiwg-sessions at lists.mpi-forum.org>
Cc: "Pritchard Jr., Howard" <howardp at lanl.gov>
Subject: RE: [mpiwg-sessions] [EXTERNAL] RE: MPI_Session_init semantics question/poll

 

Hi Martin,

 

MPI is not PVM. We do not wait to see which/how many processes start and join the group/process set before deciding on the membership of the group/process set. The names and the membership of all (built-in/predefined) process sets are known a priori without coordination during the initialisation procedure call(s). Deviation from that membership (e.g. a process fails to start or fails to join up with the other processes) is a fault, which will cause a failure (e.g. a collective operation cannot complete), which will manifest as an error. The process set still exists and a group can still be formed from it; the communicator creation procedure that uses that group will raise an error.

 

For scenarios/implementations where additional process sets “appear” during the execution, those new process sets might not appear until all involved processes will see the same new set name (depending on what the implementation can support); that might mean every involved process will have to have done some progress after the process set was created internally before any process will expose it to the user via MPI calls. That delay must never happen for the built-in/predefined process sets, so we have no conflict or difficulty.

 

Best wishes,

Dan.

 

From: Martin Schulz <schulzm at in.tum.de> 
Sent: 04 January 2023 19:43
To: MPI Sessions working group <mpiwg-sessions at lists.mpi-forum.org>; Holmes, Daniel John <daniel.john.holmes at intel.com>
Cc: Pritchard Jr., Howard <howardp at lanl.gov>
Subject: Re: [mpiwg-sessions] [EXTERNAL] RE: MPI_Session_init semantics question/poll

 

Hi all,

 

I agree with this interpretation – I always thought that was the original intent; non-local work should be able to be push off to the first communicator creation. 

 

The question about it being an operation and/or a local call is interesting, though – I tend to also see it the same as Dan, but is there a scenario in implementations that may require some kind of progress in other MPI processes (e.g., to internally synchronize on process sets)? If so, would we have to classify at least some calls (perhaps only the query of the process sets) as (local) operations so we can mandate progress? Or maybe “have to” is to harsh, but it would implementations to be more efficient?

 

Martin

 

 

--

Prof. Dr. Martin Schulz, Chair of Computer Architecture and Parallel Systems

Department of Informatics, TU-Munich, Boltzmannstraße 3, D-85748 Garching

Member of the Board of Directors at the Leibniz Supercomputing Centre (LRZ)

Email: schulzm at in.tum.de

 

 

From: mpiwg-sessions <mpiwg-sessions-bounces at lists.mpi-forum.org> on behalf of "Pritchard Jr., Howard via mpiwg-sessions" <mpiwg-sessions at lists.mpi-forum.org>
Reply to: MPI Sessions working group <mpiwg-sessions at lists.mpi-forum.org>
Date: Wednesday, 4. January 2023 at 09:30
To: "Holmes, Daniel John" <daniel.john.holmes at intel.com>, MPI Sessions working group <mpiwg-sessions at lists.mpi-forum.org>
Cc: "Pritchard Jr., Howard" <howardp at lanl.gov>
Subject: Re: [mpiwg-sessions] [EXTERNAL] RE: MPI_Session_init semantics question/poll

 

HI Dan,

 

Yes that was my interpretation as well.

 

We can discuss at our next meeting 1/9/23 if there’s time.

 

Howard

 

 

From: "Holmes, Daniel John" <daniel.john.holmes at intel.com>
Date: Wednesday, January 4, 2023 at 12:05 PM
To: MPI Sessions working group <mpiwg-sessions at lists.mpi-forum.org>
Cc: "Pritchard Jr., Howard" <howardp at lanl.gov>
Subject: [EXTERNAL] RE: MPI_Session_init semantics question/poll

 

Hi Howard,

 

It was always intended that MPI_Session_init was a local procedure. In fact, “initialise a session” is not even an MPI operation, so it doesn’t make sense for it to be expressed via a nonlocal procedure.

 

Further, it was intended that the nonlocal portion of the work done by MPI_Init that is eventually needed in the pure sessions pattern would be done during the first nonlocal procedure call in that pattern, as follows:

 

MPI_Session_init // local – PMIx fence prohibited

MPI_Group_from_pset // local – PMIx fence prohibited

MPI_Comm_create_from_group // nonlocal – PMIx fence permitted, if needed

 

The nonlocal work should be unnecessary until the first nonlocal procedure call, so this should all work out fine (modulo some refactoring/debugging).

 

Best wishes,

Dan.

 

From: mpiwg-sessions <mpiwg-sessions-bounces at lists.mpi-forum.org> On Behalf Of Pritchard Jr., Howard via mpiwg-sessions
Sent: 04 January 2023 18:32
To: MPI Sessions working group <mpiwg-sessions at lists.mpi-forum.org>
Cc: Pritchard Jr., Howard <howardp at lanl.gov>
Subject: [mpiwg-sessions] MPI_Session_init semantics question/poll

 

Hi All,

 

First, Happy New Year!

 

I’ve got a question about the semantics of MPI_Session_init.  In particular, I’d be interested in knowing  people’s opinion on whether this function is nonlocal or local.

We don’t have any text in the current version of the standard that states whether or not MPI_Session_init is a nonlocal operation.

 

I’m considering options for handling this issue:  https://github.com/open-mpi/ompi/issues/11166 .  It turns out that the way to properly resolve this issue depends on whether or not MPI_Session_init has local or nonlocal semantics.

 

I had been working under the assumption that we had intended session initialization to be a local function, but considering how to resolve issue 11166 made me begin to question this assumption.

 

Thanks for any ideas,

 

Howard

 


—

 

Howard PritchardResearch ScientistHPC-ENV Los Alamos National Laboratoryhowardp at lanl.gov 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mpi-forum.org/pipermail/mpiwg-sessions/attachments/20230110/9824d6f4/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 4354 bytes
Desc: not available
URL: <http://lists.mpi-forum.org/pipermail/mpiwg-sessions/attachments/20230110/9824d6f4/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 1985 bytes
Desc: not available
URL: <http://lists.mpi-forum.org/pipermail/mpiwg-sessions/attachments/20230110/9824d6f4/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 1521 bytes
Desc: not available
URL: <http://lists.mpi-forum.org/pipermail/mpiwg-sessions/attachments/20230110/9824d6f4/attachment-0007.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 1338 bytes
Desc: not available
URL: <http://lists.mpi-forum.org/pipermail/mpiwg-sessions/attachments/20230110/9824d6f4/attachment-0008.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image005.png
Type: image/png
Size: 1003 bytes
Desc: not available
URL: <http://lists.mpi-forum.org/pipermail/mpiwg-sessions/attachments/20230110/9824d6f4/attachment-0009.png>


More information about the mpiwg-sessions mailing list