[R-pkg-devel] Examples with CPU time is greater than elapsed time.

Henrik Bengtsson henr|k@bengt@@on @end|ng |rom gm@||@com
Sat Nov 5 19:22:52 CET 2022


I think it's because it suggests that the package uses more than 250%
of CPU load on average, which suggests it runs in parallel with more
than two parallel workers, which is the upper limit in the CRAN
Policies (https://cran.r-project.org/web/packages/policies.html);

"If running a package uses multiple threads/cores it must never use
more than two simultaneously: the check farm is a shared resource and
will typically be running many checks simultaneously. "

>From the R Internals
(https://cran.r-project.org/doc/manuals/r-release/R-ints.html):

"_R_CHECK_EXAMPLE_TIMING_CPU_TO_ELAPSED_THRESHOLD_: For checks with
timings enabled, report examples where the ratio of CPU time to
elapsed time exceeds this threshold (and the CPU time is at least one
second). This can help detect the simultaneous use of multiple CPU
cores. Default: NA."

It looks like CRAN incoming sets
_R_CHECK_EXAMPLE_TIMING_CPU_TO_ELAPSED_THRESHOLD_=2.5.

If multi-threading is involved, I guess you need to make sure to limit
it to ~2 parallel threads.

/Henrik

On Sat, Nov 5, 2022 at 11:10 AM Jiaming Yuan <jm.yuan using outlook.com> wrote:
>
> Hi all,
>
> I tried to submit an update to the xgboost package but didn't pass the
> pre-tests with the following note (solved the other one, but this one is
> a bit confusing):
>
> ```
> Flavor: r-devel-linux-x86_64-debian-gcc
> Check: examples, Result: NOTE
>    Examples with CPU time > 2.5 times elapsed time
>                         user system elapsed ratio
>    cb.gblinear.history 1.454  0.017    0.49 3.002
>
> ```
>
> I can't reproduce the note on win-builder:
> https://win-builder.r-project.org/ as it's running on Windows but the
> note appears on debian tests. I'm not able to reproduce it on my local
> machine either with Ubuntu 22.04. I'm wondering what the note is trying
> to tell me and how can I resolve it with confidence.
>
>
> The full log is here:
> https://win-builder.r-project.org/incoming_pretest/xgboost_1.7.1.1_20221104_194252/Debian/00check.log
> .
>
>
> Many thanks!
>
> Jiaming
>
> ______________________________________________
> R-package-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel



More information about the R-package-devel mailing list