Conversation
|
Very nice! Will take a look at this ASAP and write back. |
…t, minor refactor
…ld be faster with more cores but diff is very small and not always
|
just pushed update
code for benchmarking landed in https://gist.github.com/jangorecki/96d4956dbf9cf0de118655ecbaca9b73 |
Codecov Report
@@ Coverage Diff @@
## master #2961 +/- ##
=========================================
Coverage ? 93.69%
=========================================
Files ? 65
Lines ? 11949
Branches ? 0
=========================================
Hits ? 11196
Misses ? 753
Partials ? 0
Continue to review full report at Codecov.
|
|
Starting to look through this. Just quick initial comments : |
|
@mattdowle Thanks for looking into this. NEWS entry added, also checks for As of now, it might happened that
I think the latter one is way to go, but it will be definitely more complex change comparing to just moving allocation. Looking forward for your feedback. Also, before merging we may want to move tests from own test file to tests.Rraw. |
|
Yes, the malloc itself is thread-safe (thread lock inside it). It's just the R API |
|
I went for the second option. First option would be easier but it would be polluting code as those two Added exception handling so fails of Also checked that wrapping double vector for answer into struct does not degrade performance. |
| typedef struct double_ans_t { | ||
| double *ans; | ||
| uint8_t status; // 0:ok, 1:message, 2:warning, 3:error; unix return signal: {0,1,2}=0, {3}=1 | ||
| char message[4][256]; // STDOUT: output, STDERR: message, warning, error |
There was a problem hiding this comment.
@mattdowle Currently this field is only used for storing errors and warnings, which won't exceed 255 chars. For storing console output for verbose=T (so verbose can work from parallel region) we will need to extend size of that char. Ideally we need to make it dynamic. For this PR this is enough as verbose=T uses Rprintf in real-time but disables topmost parallelism, and nested parallelism (where applicable) is not using verbose from parallel region. The cost of that change will be that verbose will not print in real-time, as opposed to fread which uses sophisticated method for printing safely and still do parallel processing. Here it is not necessary because it runs very fast.
mattdowle
left a comment
There was a problem hiding this comment.
Looks good.
Since there are so many new tests, makes sense to keep them in separate file like that, good.
I did ask for the manual page to state "experimental" at the top but I only see that stated in the news item. As long as that's added before release please. Also should they type ?froll or ?frollmean could be stated in the NEWS item so they know exactly what to type to find out about it and see the examples.
Address #2778
Proposed
frollmeanimplementation, all feature to be supported are implemented, also docs. When it will pass review I will re-use it for rest of rolling functions, and then prepare for 1.12.0.