[Mpi3-ft] Defining the state of MPI after an error

Bronis R. de Supinski bronis at llnl.gov
Tue Sep 21 15:54:08 CDT 2010


Dick:

Re:
> The current MPI standard does not say the MPI implementation is totally 
> broken once there is an error.  Saying MPI state is undefined after an 
> error simply says that the detailed semantic of the MPI standard can no 
> longer be promised. In other words, after an error you leave behind the 
> security of a portable standard semantic.  You are operating at your own 
> risk. You do not need to read more than that into it.

Perhaps my problem with this position is that I come from the
background of language definitions for compilers. When you
read "undefined" in the OpenMP specification then you are
being told that things are broken and the implementation does
need to do anything or even tell you what they actually do (and
I believe the same is true for the C and C++ standards). An
alternative is "implementation defined", which requires the
implementer to document what they actually do. Without that,
you cannot even rely on actions with a specific implementation
(unless you believe "My tests so far have not failed so I am OK").

I strongly feel "undefined" should be reserved for situations that
mean "your program is irrevocably broken and the implementer does
not need to worry about what happens to it after encountering them."

> IBM MPI does not make any attempt to prevent future calls into libmpi 
> from working. If they work in the way you expect, cool.  If you want to 
> use MPI communication in a tool that runs on its own threads and helps 
> with failure analysis. go for it. If you want to keep using MPI to 
> design an airplane wing, please warn me. I do not want to be on that 
> plane. MPI may look like it is still working perfectly but not be. For a 
> tool, it is no big deal but for an airplane wing design, it is.

This position is contradictory to providing any sort of fault
tolerance support with MPI. That is Josh's point and I agree.

> I think having an MPI implementation return MPI_ERR_CANNOT_CONTINUE for 
> every MPI call after the error is way beyond what the standard intends. 
> The use case Bronis offered would be totally broken by this idea.

But I would know that it was and I could try some alternative.
Otherwise I am left to guess.

> In IBM MPI, if you set MPI_ERRORS_RETURN and call MPI_Allreduce  on 
> MPI_COMM_WORLD but have a bad MPI_Op on some, the ranks with the bad OP 
> will return and the ones with no error will hang forever. You will never 
> break the hung threads free.  The threads that returned  (on the ranks 
> with an error) can call MPI_Abort and kill the job.

As I stated before that would be fine. However, you are making
guarantees that are not in the standard.

> On the other hand, if you already have a dup of MPI_COMM_WORLD called 
> MPI_tool_world and a tool thread on each task, you can communicate among 
> tool threads using MPI_tool_world and I would expect that to work fine. 
> As far as I know, everything in the MPI standard that does not depend on 
> MPI_COMM_WORLD will still work.  An attempt to do a collective call on 
> MPI_COMM_WORLD may go wrong.

Also, as I said before, this is even better.

> Does that make passing a bad MPI_Op to MPI_Allreduce a CAN or CANNOT 
> CONTINUE?  How would I decide?

OK, now I see that your point is that Josh's proposal is too
simplified and does not capture the range of possibilities.
The problem is that we need to document something. Perhaps
a solution is to make the state "implementation defined". A
first implementation definition could be FUBAR (nothing will
work). Your definition is somewhat captured above. What's more,
I could go to a specific implementer and ask "Is it really
hopeless or will this use case work?"

I admit this is not as good as having a way to define what
the situation is precisely. It is better than having no
definition whatsoever.

> BTW - If new functions that may be unsuccessful without damage to MPI 
> state are added to the standard they use a TRY semantic. Just avoid 
> using the return code to report that the try did not succeed.  The 
> simplest example would be:
>
> MPI_TRY_ALLOC_MEM(size, info, baseptr, flag)
>
> If size is a negative number, this could return an error in class 
> MPI_ERR_ARG but it would never return an error for a memory shortage. 
> The flag would tell the user if the memory had been allocated. A flag of 
> FALSE and an RC of MPI_SUCCESS allows MPI to stay in a defined state and 
> the user to try again with a smaller memory request.

Yes, that is a better solution. Too bad we can't apply it
to existing functionality.

Bronis



>         Dick
>
>
>
>
>
>
> Dick Treumann  -  MPI Team
> IBM Systems & Technology Group
> Dept X2ZA / MS P963 -- 2455 South Road -- Poughkeepsie, NY 12601
> Tele (845) 433-7846         Fax (845) 433-8363
>
>
>
> From:   Joshua Hursey <jjhursey at open-mpi.org>
> To:     "MPI 3.0 Fault Tolerance and Dynamic Process Control working Group" <mpi3-ft at lists.mpi-forum.org>
> Date:   09/21/2010 12:46 PM
> Subject:        Re: [Mpi3-ft] Defining the state of MPI after an error
> Sent by:        mpi3-ft-bounces at lists.mpi-forum.org
>
> ________________________________
>
>
>
> The MPI_ERR_CANNOT_CONTINUE proposal in a small step in the direction to a more well defined set of expected/correct behavior after an error. Currently no standard MPI call can describe expected behavior after a failure since there is an overriding statement about the state being undefined. The CANNOT_CONTINUE error class defines a limit on this behavior, while still allowing the MPI implementation to decide what is correct behavior after the error for their implementation. This proposal seems small, almost inconsequential, but it opens the door a bit more for exploring well defined error semantics in future proposals.
>
> If an application wishes to continue using the MPI implementation after an error, it is still at their own risk. But now there is a well defined error class for the MPI implementation to hand back to the application when it does not know how to correctly proceed with this function call. The hope is that this proposal encourages implementations to start defining reasonable error semantics for specific error scenarios. These emerging error semantics are then able to be brought forward for eventual standardization.
>
> So for the Bcast example that you cited, I don't think I can say exactly what expected behavior should be. It is an interesting case, since even in the current standard it does not say anything about what the user can expect to happen if only one of the processes receive a local error. Does the collective fail? Does it hang? Most implementations probably just hang the other dependent processes in the collective, since doing more could hinder performance. So the user will have to have another mechanism to interrupt the collective operation (maybe a separate checking thread, or maybe relying on a tool to help detect such scenarios). This proposal just says that it is fine for the MPI library to block the erroneous process from making future calls into MPI. If the MPI implementation allows for something more reasonable to happen, it is allowed to do so. If an MPI implementation does so, and users like the semantics other implementations may be pushed to support the same semanti!
> cs, and now we are on the road to standardization.
>
> So when someone brings forward a new proposal for an new interface (like the Shared Memory allocation routines), and they have a few error class scenarios that are informative or warning in nature they can specify what expected behavior should be for continued operation from those specific error classes. Without this proposal, defining such expected behavior in the standard is ill advised since there is the blanket statement of undefined behavior. With the proposal, it then becomes appropriate to include these semantics in the standard since the undefined behavior is able to be bound by the MPI_ERR_CANNOT_CONTINUE error class.
>
> So a standard compliant basic MPI implementation will always return MPI_ERR_CANNOT_CONTINUE after an error on subsequent calls. If a new interface is included in a future standard that has well defined semantics on the behavior of MPI after, say, the MPI_ERR_RANK error class. Then this basic MPI implementation will return MPI_ERR_CANNOT_CONTINUE after an error on subsequent calls except for this case in which it must behave according to the standard.
>
> As we are seeing with attempting to define sound semantics for the new MPI_ERR_RANK_FAIL_STOP error class in the stabilization proposal, doing so is a lot of work. So there is a challenge in attempting to define the state of MPI (and further the distributed environment) after any error class. But if it is important to applications it may be worth it.
>
> It is my opinion that the current standard's blanket language is too restrictive. So I see the MPI_ERR_CANNOT_CONTINUE proposal as a small step towards better error semantics. Though, as with anything, I can be convinced otherwise if there is doubt about my reasoning or the utility of such an error class.
>
> Thanks for your patience in this thread.
>
> -- Josh
>
> On Sep 20, 2010, at 2:34 PM, Richard Treumann wrote:
>
>>
>> Josh
>>
>> Did you see this?
>>
>> "For example, if there were a loop of 100 MPI_Bcast calls and on iteration 5, rank 3 uses a bad communicator, what is the proper state?  Either a sequence number is mandated so the other ranks hang quickly or a sequence number is prohibited so everybody keeps going until the "end" when the missing MPI_Bcast becomes critical.  Of course, with no sequence number, some tasks are stupidly using the iteration n-1 data for their iteration n computation. "
>>
>> If my MPI implementation is going to tell you it "allows for correct operation after returning that error class", the standard needs to tell me which behavior is "correct operation" and what is not  "correct operation".
>>
>> As I mentioned to Bronis, I have no problem with an advise to implementors urging that they at least allow an option for continued use of libmpi, after an error returns, but  at the users own risk.  Offhand, I cannot see any harm in urging MPI implementors to promise that all locks will be released when a subroutine returns non-SUCCESS.
>>
>> Can you give me a use case for the added complexity of CAN_CONTINUE vs CANNOT_CONTINUE.?
>>
>> Consider that an error class of CAN_CONTINUE that is returned because the MPI implementor does not really know what "correct operation" means and decides to wing it is not very useful.  An MPI implementor that can get in real trouble for negligence would need to be very cautious about returning CAN_CONTINUE.
>>
>> Just asking the MPI implementor to refrain from flagging the error "MPI disabled after prior error" on otherwise correct future calls seems as good to me.
>>
>>
>> Dick Treumann  -  MPI Team
>>
>>
>> IBM Systems & Technology Group
>> Dept X2ZA / MS P963 -- 2455 South Road -- Poughkeepsie, NY 12601
>> Tele (845) 433-7846         Fax (845) 433-8363
>>
>>
>>
>> From:   Joshua Hursey <jjhursey at open-mpi.org>
>> To:     "MPI 3.0 Fault Tolerance and Dynamic Process Control working Group" <mpi3-ft at lists.mpi-forum.org>
>> Date:   09/20/2010 01:51 PM
>> Subject:        Re: [Mpi3-ft] Defining the state of MPI after an error
>> Sent by:        mpi3-ft-bounces at lists.mpi-forum.org
>>
>> ________________________________
>>
>>
>>
>> So the proposal makes no requirements about the state of the distributed environment after an error. All it defines is a error class to be returned by an MPI implementation once the MPI implementation can no longer function correctly. This provides a necessary feedback mechanism for the application to determine if and how the MPI implementation can be used after an error occurs. It is the responsibility of the application to avoid deadlocks and other such issues that can result from handling and recovering from errors. If an application is designed to recover from MPI_ERR_TAG that's great. If the MPI library allows for correct operation after returning that error class, then even better. If the MPI library cannot continue operation after that error then it can block subsequent operations by returning MPI_ERR_CANNOT_CONTINUE.
>>
>> I disagree with your assessment that this will be difficult to implement/test since a trivial implementation of this proposal is to set a global variable when an error occurs to always return MPI_ERR_CANNOT_CONTINUE when the application calls into the MPI library (it is a similar check as the 'is_mpi_initialized' check that has to be there anyway). If an implementation wants to do more (and it is definitely not required to do so) then it can define that in it's documentation.
>>
>> If an application wants to try to use MPI after an error it must understand that the error is local in nature (it cannot assume that every process received an error). If it can figure out how to recover from it, and the MPI implementation is able to function correctly afterward then we should let them figure it out. This allows us to define the boundaries of correct operation after an error. Before the application -could- keep using the MPI library after an error, but it was entirely undefined and not-portable what would happen. Now the application can portably attempt to use the MPI library after an error and know that it can expect either normal functionality (for those few implementations that do more than the minimum necessary) or MPI_ERR_CANNOT_CONTINUE in which the library locks them out and they then know to terminate normally.
>>
>> I hope this helps a bit, but maybe I am missing the core problem that you are trying to get at.
>>
>> -- Josh
>>
>> On Sep 20, 2010, at 1:09 PM, Bronis R. de Supinski wrote:
>>
>>>
>>> Dick:
>>>
>>> Re:
>>>> I did not intend to ignore your use case.
>>>
>>> No problem.
>>>
>>>> I did mention that I have no worries about asking MPI implementations
>>>> to refrain from blocking future MPI calls after an error is detected.
>>>> That was an implicit recognition of your use case.
>>>
>>> OK, that helps.
>>>
>>>> The MPI standard already forbids having an MPI call on one thread block
>>>> progress on other threads.  I would interpret that to include a case
>>>> where a thread is blocked in a collective communication or a MPI_Recv
>>>> that will never be satisfied. That is, the blocked MPI call cannot
>>>> prevent other threads from using libmpi.  Requiring libmpi to release
>>>> any lock it took even when doing an error return would be logical but
>>>> may not be implied by what is currently written.
>>>
>>> The current text provides no such guarantee. Once anerror is
>>> returned anywhere, all bets are off (at least that is how I
>>> have read it; I would need to go back through the text to
>>> find the exact words that cause my concern).
>>>
>>>> Communicators provide a sort of isolation that keeps stray crap from
>>>> failed operations from spilling over (such as eager sent message for
>>>> which the MPI_Recv failed).  If the tool uses its own threads and
>>>> private communicators, I agree it is reasonable to ask any libmpi to
>>>> avoid sabotaging that communication.
>>>
>>> That would be perfect from my perspective.
>>>
>>>> Where I get concerned is when we start talking about affirmative
>>>> requirements for distributed  MPI state after an error
>>>
>>> I don't think we can have those beyond "best effort".
>>> The errors may indicate problems that make further
>>> communication impossible -- perhaps because of the
>>> erroneous action or just due to the state of the
>>> network or other processes. I do think we can require
>>> accurate return values and have an advice to implementers
>>> that suggests best effort following errors. I believe
>>> that would satisfy my requirements.
>>>
>>> Bronis
>>>
>>>
>>>
>>>
>>>>
>>>>                 Dick
>>>>
>>>> Dick Treumann  -  MPI Team
>>>> IBM Systems & Technology Group
>>>> Dept X2ZA / MS P963 -- 2455 South Road -- Poughkeepsie, NY 12601
>>>> Tele (845) 433-7846         Fax (845) 433-8363
>>>>
>>>>
>>>>
>>>> From:   "Bronis R. de Supinski" <bronis at llnl.gov>
>>>> To:     "MPI 3.0 Fault Tolerance and Dynamic Process Control working Group" <mpi3-ft at lists.mpi-forum.org>
>>>> Date:   09/20/2010 12:46 PM
>>>> Subject:        Re: [Mpi3-ft] Defining the state of MPI after an error
>>>> Sent by:        mpi3-ft-bounces at lists.mpi-forum.org
>>>>
>>>> ________________________________
>>>>
>>>>
>>>>
>>>>
>>>> Dick:
>>>>
>>>> You seem to be ignoring my use case. Specifically, I
>>>> have tool threads that use MPI. Their use of MPI should
>>>> be unaffected by all of the scenarios that you are raising.
>>>> However, the standard provides no way for me to tell if
>>>> they work correctly in these situations. I just have to
>>>> cross my fingers and hope.
>>>>
>>>> FYI: Your implementation has long met this requirement
>>>> (my hopes are not dashed with it). Others have begun to
>>>> recently. In any event, I would like some way to tell...
>>>>
>>>> Further, it is useful in many other scenarios apply to know
>>>> that the implementation intends to remain usable. I am not
>>>> looking for a promise of correct execution; I am looking
>>>> for a promise of best effort and accurate return codes.
>>>>
>>>> Bronis
>>>>
>>>>
>>>>
>>>> On Mon, 20 Sep 2010, Richard Treumann wrote:
>>>>
>>>>>
>>>>> If there is any question about whether these calls are still valid after an error with an error handler that returns (MPI_ERRORS_RETURN or user handler)
>>>>>
>>>>> MPI_Abort,
>>>>> MPI_Error_string
>>>>> MPI_Error_class
>>>>>
>>>>> I assume it should be corrected as a trivial oversight in the original text.
>>>>>
>>>>> I would regard the real issue as being the difficulty with assuring the state of remote processes.
>>>>>
>>>>> There is huge difficulty in making any promise about how an interaction between a process that has not taken an error and one that has will behave.
>>>>>
>>>>> For example, if there were a loop of 100 MPI_Bcast calls and on iteration 5, rank 3 uses a bad communicator, what is the proper state?  Either a sequence number is mandated so the other ranks hang quickly or a sequence number is prohibited so everybody keeps going until the "end" when the missing MPI_Bcast becomes critical.  Of course, with no sequence number, some tasks are stupidly using the iteration n-1 data for their iteration n computation.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Dick Treumann  -  MPI Team
>>>>> IBM Systems & Technology Group
>>>>> Dept X2ZA / MS P963 -- 2455 South Road -- Poughkeepsie, NY 12601
>>>>> Tele (845) 433-7846         Fax (845) 433-8363
>>>>>
>>>> _______________________________________________
>>>> mpi3-ft mailing list
>>>> mpi3-ft at lists.mpi-forum.org
>>>> http://BLOCKEDBLOCKEDlists.mpi-forum.org/mailman/listinfo.cgi/mpi3-ft<http://BLOCKEDblockedlists.mpi-forum.org/mailman/listinfo.cgi/mpi3-ft><http://BLOCKEDblockedlists.mpi-forum.org/mailman/listinfo.cgi/mpi3-ft>
>>>>
>>>>
>>>>
>>> _______________________________________________
>>> mpi3-ft mailing list
>>> mpi3-ft at lists.mpi-forum.org
>>> http://BLOCKEDlists.mpi-forum.org/mailman/listinfo.cgi/mpi3-ft
>>>
>>
>> ------------------------------------
>> Joshua Hursey
>> Postdoctoral Research Associate
>> Oak Ridge National Laboratory
>> http://BLOCKEDwww.BLOCKEDcs.indiana.edu/~jjhursey
>>
>>
>> _______________________________________________
>> mpi3-ft mailing list
>> mpi3-ft at lists.mpi-forum.org
>> http://BLOCKEDlists.mpi-forum.org/mailman/listinfo.cgi/mpi3-ft
>>
>>
>> <ATT00001..txt>
>
> ------------------------------------
> Joshua Hursey
> Postdoctoral Research Associate
> Oak Ridge National Laboratory
> http://BLOCKEDwww.BLOCKEDcs.indiana.edu/~jjhursey
>
>
> _______________________________________________
> mpi3-ft mailing list
> mpi3-ft at lists.mpi-forum.org
> http://BLOCKEDlists.mpi-forum.org/mailman/listinfo.cgi/mpi3-ft
>
>
>



More information about the mpiwg-ft mailing list