9

I am building a vignette for R package mistral (see github.com/clemlaflemme/mistral) and the devtools::check(cleanup = FALSE) returns a Warning

Error: processing vignette 'mistral-vignette.Rmd' failed with diagnostics:
4 simultaneous processes spawned
Execution halted

I could not find any help on Google. Actually I do use parallel computing in the vignette, is it not allowed ?

ClementWalter
  • 4,814
  • 1
  • 32
  • 54

2 Answers2

10

I experienced a similar issue. I got the check to pass if I changed the number of cores from 4 to 2, i.e. in the vignette I set options(mc.cores=2). I couldn't find any clear documentation but I suspect R CMD check only allows a maximum of two cores based on an obscure comment in Hadley Wickham's R Packages Book:

NB: you can’t use unexported functions and you shouldn’t open new graphics devices or use more than two cores. Individual examples shouldn’t take more than 5s.

miguelmorin
  • 5,025
  • 4
  • 29
  • 64
Will Townes
  • 1,787
  • 1
  • 17
  • 21
  • 1
    It's not well motivated indeed. Just quoting directly your link : "NB: you can’t use unexported functions and you shouldn’t open new graphics devices or use more than two cores. Individual examples shouldn’t take more than 5s." – ClementWalter Jul 25 '17 at 08:41
0

Checkout this answer to see how you can do this more efficiently:

R CRAN Check fail when using parallel functions

Nikhil Gupta
  • 1,436
  • 12
  • 15