You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ lscpu | grep -iF "core"
Thread(s) per core: 2
Core(s) per socket: 4
Model name: Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
we should get:
> detectThreadsPerCore()
[1] 2
Action
Figure out how to do this reliably on all operating systems and Unix distributions.
If it cannot be inferred, return default, which could default to either 1L ("always works") or NA_integer_ ("unknown"). Alternatively, there could be a mustWork argument or similar.
Background
This will be useful when limiting multi-threading in nested parallelization. For example, in future we try to force single-processing by setting various environment variables and R options in parallel workers, e.g. MC_CORES=1. Currently, we do not limit the number of parallel threads.
The simplest approach would be to force a single thread, but it would be more efficient on modern systems if we'd limit it to detectThreadsPerCore() threads, e.g.
Wish
For example, for a machine with:
we should get:
Action
default
, which could default to either1L
("always works") orNA_integer_
("unknown"). Alternatively, there could be amustWork
argument or similar.Background
This will be useful when limiting multi-threading in nested parallelization. For example, in future we try to force single-processing by setting various environment variables and R options in parallel workers, e.g.
MC_CORES=1
. Currently, we do not limit the number of parallel threads.The simplest approach would be to force a single thread, but it would be more efficient on modern systems if we'd limit it to
detectThreadsPerCore()
threads, e.g.The text was updated successfully, but these errors were encountered: