-
Notifications
You must be signed in to change notification settings - Fork 425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Patterns] Should distributed maps support parallel updates to values? #18962
Comments
Wouldn't the code in the OP have a race condition if adding to an integer, say? I suppose it comes down to the question of whether or not the parallel map should be helping to ensure atomicity. I think it should, mainly for efficiency reasons, but I could also argue the other viewpoint. |
I also think the parallel or distributed maps should help to ensure atomicity on a per-key basis. I do think that other iterations from the same forall shouldn't interfere with each other, though |
Do non-distributed maps support parallel updates to values? If they do, then it makes a lot of sense for distributed maps to support them, too.
Intuitively, a |
Part of the point of the overarching exercise is to consider how parallel maps would work as well. Maybe worth opening a similar issue? |
It makes sense to me to create an issue that says "parallel maps offer all features of serial maps plus X and Y and Z" and one with "distributed maps offer all features of parallel maps plus A B C". Have those issues discuss what those ABCs and XYZs are. |
My intuition is that there would need to be since, if there were a serial access point to a distributed map, it would prevent scalability, which would be one of the major motivators of using a distributed map. The bigger question is "what sorts of parallelism are supported?" I think Vass is right that the code in the OP doesn't have a race, and would guess that @mppf was thinking of a case more like: forall keys in someArrayOfKeys do
myMap(key) += 1; where multiple keys could be trying to update the same slot simulteously. Note that I don't think the |
Yes, that's right. Today we have some pretty worrying race conditions with that pattern even if the elements are atomic ints. |
This issue is part of a series of issues to design the interface for collections across serial, parallel, and distributed contexts. Our goal is to determine what we think is reasonable to support and what doesn't seem useful. Additional patterns welcome (but it would be best to put them in their own issue for discussion, likely)
The text was updated successfully, but these errors were encountered: