Skip to content

[R-pkg-devel] CRAN Detected Using More Than 2 Cores By Default

4 messages · Matt Dancho, Ivan Krylov

#
Hello,

First time caller. Long time listener. I have an issue identified in my
Modeltime R package version 1.2.8 CRAN submission.

*CRAN Issue*
Flavor: r-devel-linux-x86_64-debian-gcc
Check: tests, Result: NOTE
     Running 'testthat.R' [20s/7s]
   Running R code in 'testthat.R' had CPU time 2.7 times elapsed time

Flavor: r-devel-linux-x86_64-debian-gcc
Check: re-building of vignette outputs, Result: NOTE
   Re-building vignettes had CPU time 2.7 times elapsed time

both ratios indicate you are using more than 2 cores by default. Please
see the CRAN policies.


*Problem:*
When preparing relatively minor updates, I have submitted modeltime version
1.2.8 (
https://github.com/business-science/modeltime
) to CRAN but did not pass the incoming checks.

The error occurs on Debian indicating more than 2 cores are being used by
default.

I?m not sure how to detect where this is happening. Not how to fix it.

I do permit parallel processing in some modeltime functions but everything
is set to 1 core by default. The vignette and tests should be processed


Please let me know if you see something in my code that I could be missing
causing this issue.

Thanks, Matt
#
? Fri, 1 Sep 2023 08:26:32 -0400
Matt Dancho <mdancho at business-science.io> ?????:
Here's the conclusion of a recent R-pkg-devel thread:
https://stat.ethz.ch/pipermail/r-package-devel/2023q3/009513.html

It might help to set the environment variable OMP_THREAD_LIMIT to 2 in
your tests and vignettes, but with examples (and, generally, with
defaults in your functions) it will be harder to achieve compliance:
https://github.com/Rdatatable/data.table/issues/5658#issuecomment-1700972630

I don't see an immediate dependency of your package that could be doing
something in parallel, but maybe you'll be able to find it after
reading the R-package-devel thread.
#
Thank you very much. I?ll try this and let you know.
On Fri, Sep 1, 2023 at 10:04 AM Ivan Krylov <krylov.r00t at gmail.com> wrote:

            

  
  
#
I was able to get it to work with your solution. Thanks a lot.

Solution was to set Sys.setenv(?OMP_THREAD_LIMIT?, ?1?) on load. I may
adjust this down the road but modeltime 1.2.8 is now on CRAN.

Thanks, Matt

On Sat, Sep 2, 2023 at 7:29 AM Matt Dancho <mdancho at business-science.io>
wrote: