[R-pkg-devel] Too many cores used in examples (not caused by data.table)

Helske, Jouni joun|@he|@ke @end|ng |rom jyu@||
Mon Oct 30 09:18:55 CET 2023


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 using debian.org>
Sent: Friday, October 27, 2023 16:28
To: Helske, Jouni <jouni.helske using jyu.fi>
Cc: Dirk Eddelbuettel <edd using debian.org>; Ivan Krylov <krylov.r00t using gmail.com>; r-package-devel using r-project.org <r-package-devel using r-project.org>; Conrad Sanderson <conradsand using 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 using debian.org

	[[alternative HTML version deleted]]




More information about the R-package-devel mailing list