Set error code on failure via implicit top-level task - #5
Set error code on failure via implicit top-level task#5elliottslaughter wants to merge 2 commits into
Conversation
|
I realized that this approach isn't going to work, because it introduces control divergence (potentially) into the top-level task. If the data goes bad, this lifts a data corruption issue into a control corruption issue. Ironically, the current abort either freezes or kills the process right away so we don't need to deal with the downstream consequences of a potential control divergence. For now it seems safer to comment out the abort on a case by case basis when we need clean exits; the alternative is to put validation inside of a task, but then that risks altering the data flow of the program. |
214aed2 to
0c9fcea
Compare
|
I thought about this some more and realized the control divergence can be avoided by carefully coding to avoid branches in the error path. Check everything, then set a return value at the end. Never skip a check. Assuming it passes, it would make it a lot easier to track down bad region output cases like StanfordLegion/legion#1946. |
0c9fcea to
d2374e0
Compare
|
There is still the issue of shards agreeing on a return value. I think this is what |
|
I added the consensus match algorithm, but now I see that we cannot run non-control-replicated top-level tasks with the new implicit task option. If you pass replicable, it will be replicated. Full stop. I need to figure out how to expose this to the mapper or else control it in our invocation to |
Just to be clear, you want to run a non-control-replicated implicit top-level task from one node? That should already be possible today: you just have to pick which node is going to do the |
|
That's one half, but then I need to broadcast the error code out of that one task so that all of the ranks can return it from their respective |
Yeah, we're in the area outside of Legion here. I'm not sure we want to be using Legion to help with stuff nominally outside of its programming model. It's up to the "user" to figure out how to decide which nodes do the launching of the top-level task and then how to broadcast any results that come out of it. Having a Realm collective library might be one option. |
|
I understand, but given how much work we're talking about and how half-baked the support is currently, I'd prefer to go back to |
I'm confused then. What is stopping you from doing that right now? |
|
Nothing is stopping me, and in fact I have a PR at #7 which does exactly that. The reason it took me so long to try this is because I was originally discouraged from using |
|
Catching up on this...
I was thinking about this some more. While I think it's ok to use |
|
Just to be clear (since I also had to re-read this issue to remind myself what's going on): The method used to set a return code is mostly a distraction, because you can use consensus match to coordinate the return code in the implicit top-level task case. However, the two key issues with implicit top-level tasks are:
It's a nice idea in theory to say that you can launch top-level tasks into Legion and they'll execute independently and then return, but the practical reality isn't really there unless the level of coordination that you require outside of Legion is essentially nil (i.e., you never actually need to read the result of the top-level task and you assume a fixed mapping strategy for the top-level task assigned up front). |
Right, when you're creating an implicit top-level task you're effectively making those decisions yourself ahead of time so you've got to coordinate it all yourself.
I wouldn't say it's completely incoherent. Nominally you're likely in a bulk-synchronous execution mode so you can use GASNet or MPI to do pretty standard coordination if you want. |
Rolled this back temporarily because it causes multiple top-level tasks to be launched in the multi-node case.