[R-pkg-devel] Too many cores used in examples (not caused by data.table)
Hi Dirk, Looking more closely earlier failures, vignettes have always worked fine but the note on tests said that the CPU time was only 2.7 times over elapsed time, so maybe I was just lucky this time and got under 2.5. ;) Or testthat does something special... Jouni
From: Dirk Eddelbuettel <edd at debian.org>
Sent: Friday, October 27, 2023 16:28
To: Helske, Jouni <jouni.helske at jyu.fi>
Cc: Dirk Eddelbuettel <edd at debian.org>; Ivan Krylov <krylov.r00t at gmail.com>; r-package-devel at r-project.org <r-package-devel at r-project.org>; Conrad Sanderson <conradsand at gmail.com>
Subject: Re: [R-pkg-devel] Too many cores used in examples (not caused by data.table)
Sent: Friday, October 27, 2023 16:28
To: Helske, Jouni <jouni.helske at jyu.fi>
Cc: Dirk Eddelbuettel <edd at debian.org>; Ivan Krylov <krylov.r00t at gmail.com>; r-package-devel at r-project.org <r-package-devel at r-project.org>; Conrad Sanderson <conradsand at gmail.com>
Subject: Re: [R-pkg-devel] Too many cores used in examples (not caused by data.table)
Hi Jouni, On 27 October 2023 at 13:02, Helske, Jouni wrote: | Actually, the OMP_NUM_THREADS worked for vignettes and testthat tests, but | didn't help with the examples. However, I just wrapped the problematic example Now I am confused. What is your understanding of why it helps in one place and not the other? | with \donttest as for some reason this issue only happened with a single | seemingly simple example (hence the "weird" in the earlier NEWS due to | frustration, I changed this to the CRAN version). | | Thanks for reminding me about the resetting the number of cores, will fix that | to the next version. I have an idea for a RcppArmadillo-based helper function. We can save the initial values of the environment variable in .onLoad and cache it. A simple helper function pair can then dial the environment variable down and reset it to the cached value. Dirk -- dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org