-
Notifications
You must be signed in to change notification settings - Fork 1k
add floyd-rivest selection and parallelization to gmedian #7481
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
base: master
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7481 +/- ##
==========================================
- Coverage 99.00% 98.98% -0.02%
==========================================
Files 87 87
Lines 16893 16879 -14
==========================================
- Hits 16725 16708 -17
- Misses 168 171 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Generated via commit 19f0b8d Download link for the artifact containing the test results: ↓ atime-results.zip
|
Co-authored-by: Michael Chirico <chiricom@google.com>
| else subd[j-nacount] = xd[k]; | ||
| #pragma omp parallel num_threads(getDTthreads(ngrp, true)) | ||
| { | ||
| double *thread_subd = malloc(maxgrpn * sizeof(double)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to allocate outside of parallel and use R alloc, so the memory usage can be tracked by apps that track memory usage using R API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, will do.
| if (nacount && !narm) { | ||
| ansd[i] = NA_REAL; | ||
| } else { | ||
| // Use Floyd-Rivest for groups larger than 100, quickselect for smaller |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to put 100 as a parameter, so we can explore impact of this code path branches by options
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could do. Like all of these parameters, it should be tuned.

Not directly demanded but improving benchmarks
Details