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
parallel merge is not stable #2964
Comments
@taeguk: any comments? |
@jefftrull Thanks for your bug report! I'll take a look in this weekend. |
@taeguk: I added the test on a branch here: https://github.com/STEllAR-GROUP/hpx/tree/fixing_2964 @jefftrull: the problem is not reproducible for me (at least not with the test case you provided). This might become interesting ... ;-) |
Hi @hkaiser ! Did you try that threshold hack... |
@jefftrull Ahh no. Will try, thanks. |
@taeguk: we need to find a way to modify this value without editing the code. Executor parameters for the win! Something like:
or
or somesuch... |
@jefftrull In PR #2967, I fixed the problem which you reported! Really thanks for your bug reporting! :) |
@hkaiser I agree that we need to find a way to modify the thredhold. The things you suggested seem good to me. |
Make parallel::merge is stable. (Fix #2964.)
Reopening as the tests fail. See for example here: |
@taeguk would you be able to look into this error, please? |
@hkaiser I will look that in this weekend. |
@hkaiser @sithhell I looked into this error. |
Ahh, thanks for investigating this more closely. Is it possible to disable the failing tests for the platforms we know are broken? |
@hkaiser For doing what you said, we may be able to use conditional build with checking |
You shouldn't check the clang version, but the stdlib version. This is a bug in libc++, you could also use libstdc++ with clang |
@sithhell Oops. Yes, you're right. I was strange... |
Thanks all! |
merge_testcase.zip
The documentation for the merge algorithm states For equivalent elements in the original two ranges, the elements from the first range precede the elements from the second range. I find that this is sometimes not the case when the parallel execution policy is chosen.
The attached testcase merges two ranges of <int, char> pairs, ordered by the first value. For my compiler (gcc 6.3.0) I find that the resulting merged sequence interleaves equivalent elements from the input ranges, instead of using all of the equivalent elements from the first range first. Specifically, when merging
(3,a), (3,b)
with(3,c)
the result is(3,a), (3,c), (3,b)
.Due to the high threshold (65536) for using the parallel version of the algorithm, reproducing this requires modifying this line so the threshold is something low (I used 10).
The text was updated successfully, but these errors were encountered: