-
Notifications
You must be signed in to change notification settings - Fork 44
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
Missing synchronization primitive dart_sync #323
Comments
You are right with the above mentioned problem, however, it is actually not an issue in DASH. Just to confirm that I got it: In the unified memory model it is not guaranteed that local updates "happen-before" subsequently issued MPI barriers. And this makes sense as barriers deal only with process synchronization, not memory synchronization. Suggestion 1 (fence) is not an option as already dicussed in #313. The only alternative is Now in DASH, given the following algorithm: dash::array<int, 1000> arr{};
auto const val = ...;
//initializes local range on each unit
dash::fill(array, val);
//Synchronize all units
array.barrier();
//continue processing.... After the barrier has returned the memory semantics are well defined since we execute a dart_flush in the array barrier. And a flush guarantees consistent synchronized public and private of the MPI window. It corresponds to option 2 as described above. Now suppose we replace So finally, I think the DART interface is well defined. Implicitly apply memory synchronization in a dart barrier is not really required and even a bad solution if we care about separation of concerns. Moreover it can degrade performance as memory synchronization is expensive. |
Dang, I actually meant to call
I wasn't aware of the flush in the array barrier. However, the flush is missing in Also, the standard does not mention anything about sync'ing private and public copies (or memory barriers) in the description of And yes I agree, a memory barrier in |
Thanks.
No broken use cases at the moment but a cautious warning that this may eventually fire back at us. Afaics, we do not adhere to the MPI standard here but there seems to be a discrepancy in the understanding it between @rkowalewski and myself, which I would like to discuss in Garching before closing this issue. |
Closing this after discussions in Garching and realizing that |
While going through the MPI standard I found the following notable example: http://mpi-forum.org/docs/mpi-3.1/mpi31-report.pdf#section.11.7 (MPI standard 3.1, Example 11.6)
The accompanying text states:
I think this is a common use-case for us:
Thus, we may run into synchronization issues at some point (although I haven't seen them so far). Two options I see:
dart_sync
, which callsMPI_Win_fence
MPI_Win_sync
as suggested on page 456 of the MPI standard (Advice to users under point U5) to make store updates visible to all other threads and processes.The text was updated successfully, but these errors were encountered: