Skip to content

Commit f43df75

Browse files
authored
Merge pull request #63 from r-devel/Cores
More than 2 Cores
2 parents 53765ca + abb9126 commit f43df75

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

code_issues.qmd

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,4 +383,44 @@ CRAN doesn't allow negative `warn` options. This setting will turn off all warni
383383
CRAN recommends using `suppressWarnings()`, which disables warnings only for the specific expression it's applied to, rather than globally.
384384

385385

386+
-----------------------------------------
387+
388+
# Using more than 2 Cores
389+
390+
## Problem
391+
392+
You are using more than 2 CPU cores in your examples, vignettes, tests or during installation.
393+
394+
## Solution
395+
396+
Make sure that you set the maximum number of cores used to 2 in examples, vignettes or tests.
397+
During installation, many modern build systems use the `-j` flag.
398+
<!-- This was recommended by 'aitap' in a discussion on GitHub -->
399+
400+
### Details
401+
402+
::: {.callout-note title="CRAN Review Communication" appearance="simple" icon=false collapse=true}
403+
404+
Please ensure that you do not use more than 2 cores in your examples, vignettes, etc.
405+
406+
:::
407+
408+
409+
CRAN checks run on big, multi-core computers, running many `R CMD check` processes in parallel. Every process is allowed to use a maximum of 2 CPU cores to exercise parallel code in examples and unit tests. When using more than 2 cores, your package will get a NOTE from CRAN checks, saying that it took more CPU time than elapsed time.
410+
411+
::: {.callout-note title="CRAN NOTE" icon=false}
412+
413+
Check: whether package can be installed, Result: NOTE\
414+
&emsp; Installation took CPU time 6.9 times elapsed time\
415+
\
416+
Check: examples, Result: NOTE\
417+
&emsp; Examples with CPU time > 2.5 times elapsed time
418+
419+
:::
420+
421+
Automatic tests will generate a NOTE if more than 2 cores are used in examples, vignettes, tests, or during installation. It’s best to provide an option for setting the number of cores in any function, with the default ideally set to fewer than 2 cores.
422+
423+
Something that ran as part of the installation process might have started more than two child processes (or threads) at the same time. The solution for this is specific to the build system your package is using. Many modern build systems however, can use the `-j` flag which originated from `GNU Make` (for more information, see their [manual](https://devdocs.io/gnu_make/options-summary#-j%20[jobs]){target="_blank"}).
424+
<!-- The target="_blank" opens the link in a new tab as this is a link to a non R related resource and thus might not interest the user too much-->
425+
386426

preface.qmd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ The CRAN Cookbook has been developed as part of a special project grant from the
3838

3939
_Thanks to all contributors!_
4040

41-
Lluís Revilla ([@llrs](https://github.com/llrs))
41+
Lluís Revilla ([@llrs](https://github.com/llrs))\
42+
Ivan Krylov ([@aitap](https://github.com/aitap))
4243

4344
# Colophon
4445

0 commit comments

Comments
 (0)