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

2023-10-30 Thread Dirk Eddelbuettel
I have some better news. While we established that 'in theory' setting the environment variable OMP_NUM_THREADS would help (and I maintain that it is a great PITA that CRAN does not do so as a general fix for this issue) it does *not help* once R is started. OpenMP only considers the variable

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

2023-10-30 Thread Helske, Jouni
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

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

2023-10-27 Thread Dirk Eddelbuettel
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

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

2023-10-27 Thread Helske, Jouni
Hi Dirk, 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 with \donttest as for some reason this issue only happened with a single seemingly simple example (hence the "weird" in the earlier

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

2023-10-27 Thread Dirk Eddelbuettel
Jouni, My CRANberriesFeed reports a new bssm package at CRAN, congratulations for sorting this out. [1,2] The OMP_NUM_THREADS setting is indeed all it takes, and it _does_ seem to be read even from a running session: i.e. you can set this inside an R session and the OpenMP code considers it in

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

2023-10-25 Thread Helske, Jouni
Thanks, I tried with OMP_NUM_THREADS=2 but unfortunately got the same NOTE as before. Best, Jouni From: Dirk Eddelbuettel Sent: Wednesday, October 25, 2023 13:27 To: Dirk Eddelbuettel ; Helske, Jouni Cc: Ivan Krylov ; r-package-devel@r-project.org Subject:

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

2023-10-25 Thread Dirk Eddelbuettel
On 24 October 2023 at 08:15, Dirk Eddelbuettel wrote: | | On 24 October 2023 at 15:55, Ivan Krylov wrote: | | В Tue, 24 Oct 2023 10:37:48 + | | "Helske, Jouni" пишет: | | | | > Examples with CPU time > 2.5 times elapsed time | | > user system elapsed ratio | | > exchange 1.196

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

2023-10-24 Thread Jan van der Laan
You are not the only one; I did the same with some of my examples. Would it be an option to ask for a default R-option, 'max.ncores', that specifies the maximum number of cores a process is allowed to use? CRAN could then require that that examples, tests and vignettes respect this option.

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

2023-10-24 Thread Dirk Eddelbuettel
On 24 October 2023 at 15:55, Ivan Krylov wrote: | В Tue, 24 Oct 2023 10:37:48 + | "Helske, Jouni" пишет: | | > Examples with CPU time > 2.5 times elapsed time | > user system elapsed ratio | > exchange 1.196 0.04 0.159 7.774 | | I've downloaded the archived copy of the

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

2023-10-24 Thread Spencer Graves
Chapter 15 in Wickham and Bryan, R Packages, discuss "Advanced Testing Techniques". Their current section "15.4.1 Skip a test" includes the following: test_that("some long-running thing works", { skip_on_cran() # test code that can potentially take "a while" to run }) Have you

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

2023-10-24 Thread Ivan Krylov
В Tue, 24 Oct 2023 10:37:48 + "Helske, Jouni" пишет: > Examples with CPU time > 2.5 times elapsed time > user system elapsed ratio > exchange 1.196 0.04 0.159 7.774 I've downloaded the archived copy of the package from the CRAN FTP server, installed it and tried:

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

2023-10-24 Thread Greg Hunt
In my case recently, after an hour or so’s messing about I disabled some tests and example executions to get rid of the offending times. I doubt that i am the only one to do that. On Tue, 24 Oct 2023 at 9:38 pm, Helske, Jouni wrote: > Thanks for the help, I now tried resubmitting with >

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

2023-10-24 Thread Helske, Jouni
Thanks for the help, I now tried resubmitting with Sys.setenv("OMP_THREAD_LIMIT" = 2) at the top of the exchange example, but I still get the same note: Examples with CPU time > 2.5 times elapsed time user system elapsed ratio exchange 1.196 0.04 0.159 7.774 Not sure what to try

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

2023-10-20 Thread Ivan Krylov
В Thu, 19 Oct 2023 05:57:54 + "Helske, Jouni" пишет: > But I just realised that bssm uses Armadillo via RcppArmadillo, which > uses OpenMP by default for some elementwise operations. So, I wonder > if that could be the culprit? I wasn't able to reproduce the NOTE either, despite manually

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

2023-10-20 Thread Dirk Eddelbuettel
On 19 October 2023 at 05:57, Helske, Jouni wrote: | I am having difficulties in getting the latest version of the bssm (https://github.com/helske/bssm) package to CRAN, as the pretest issues a NOTE that the package uses too many cores in some of the examples ("Examples with CPU time > 2.5

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

2023-10-20 Thread Helske, Jouni
Hi, I am having difficulties in getting the latest version of the bssm (https://github.com/helske/bssm) package to CRAN, as the pretest issues a NOTE that the package uses too many cores in some of the examples ("Examples with CPU time > 2.5 times elapsed time"). I've seen plenty of discussion