Description Usage Arguments Details Examples
Check that you are not trying to use too many cores.
1 | assert_cores(ncores)
|
ncores |
Number of cores to check. Make sure is not larger than
|
It also checks if two levels of parallelism are used, i.e. having ncores
larger than 1, and having a parallel BLAS enabled by default.
You could remove this check by setting
options(bigstatsr.check.parallel.blas = FALSE)
.
We instead recommend that you disable parallel BLAS by default by adding
try(bigparallelr::set_blas_ncores(1), silent = TRUE)
to your .Rprofile
(with an empty line at the end of this file) so that this is set whenever
you start a new R session. You can use usethis::edit_r_profile()
to open
your .Rprofile. For this to be effective, you should restart the R session or
run options(default.nproc.blas = NULL)
once in the current session.
Then, in a specific R session, you can set a different number of cores to use
for matrix computations using bigparallelr::set_blas_ncores()
, if you know
there is no other level of parallelism involved in your code.
1 2 3 4 5 | ## Not run:
assert_cores(2)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.