[R-pkg-devel] Too many processes spawned on Windows and Debian, although only 2 cores should be used

Riko Kelter r|ko@ke|ter @end|ng |rom un|-@|egen@de
Wed Nov 16 07:29:25 CET 2022


Hello,

I have a short question on the number of processes which are spawned 
during parallelization. My package passes R CMD check –as-cran on MacOS 
and Linux, but the vignettes fail with the following error on Windows 
and Debian:

|--- re-building 'gettingstarted.Rmd' using rmarkdown Quitting from 
lines 121-122 (gettingstarted.Rmd) Error: processing vignette 
'gettingstarted.Rmd' failed with diagnostics: 55 simultaneous processes 
spawned --- failed re-building 'gettingstarted.Rmd'|

The same happens on Debian, where 31 processes are spawned. In all 
vignettes, I followed a stackoverflow thread and included the following 
check for the number of cores on CRAN:

|chk <- Sys.getenv("_R_CHECK_LIMIT_CORES_", "") if (nzchar(chk) && chk 
== "TRUE") { # use 2 cores in CRAN/Travis/AppVeyor num_workers <- 2L } 
else { # use all cores in devtools::test() num_workers <- 
parallel::detectCores() }|

see also 
https://stackoverflow.com/questions/50571325/r-cran-check-fail-when-using-parallel-functions

Link to the files and check results:

https://win-builder.r-project.org/incoming_pretest/brada_1.0_20221115_141147/

Question: Does anyone have a clue why so many processes are spawned on 
Windows / Debian? There should be only 2 processes spawned if I am correct.

PS: Maybe there is a Windows user who can reproduce the 
gettingstarted.Rmd vignette and tell me how many processes are spawned 
on his machine.

PPS: I saw someone recommending to put options(mc.cores=2) at the top of 
each vignette, but I think the above code snippet replaces this.

Thanks for any help, all the best,

Riko

​
	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list