Description Usage Arguments Details Examples
Pins CPU on Windows depending on the number of cores requested.
1 2 3 | WindowsMT.cpu_pin(n_request,
n_cores = as.integer(Sys.getenv("NUMBER_OF_PROCESSORS")), n_sockets = 1,
n_hyperthread = TRUE, verbose = TRUE, test = FALSE)
|
n_request |
Type: integer. Number of logical cores to pin. |
n_cores |
Type: integer. Number of logical cores on your machine. Defaults to |
n_sockets |
Type: integer. Number of sockets on your machine. Defaults to |
n_hyperthread |
Type: logical. Whether hyperthreading is activated. Defaults to |
verbose |
Type: logical. Whether to print debug information. Defaults to |
test |
Type: logical. Whether to just print the pinning without performing the pinning (placebo if |
CPU pinning forces the first group of appropriate cores to be pinned. It handles hyperthreaded cores correctly by trying to avoid them. It has a parameter for the sockets, but it is currently unused.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ## Not run:
# Pin 1 core
WindowsMT.cpu_pin(1)
# Pin 2 core
WindowsMT.cpu_pin(2)
# Pin all cores (reset pinning)
WindowsMT.cpu_pin(as.integer(Sys.getenv("NUMBER_OF_PROCESSORS")))
# Crazy test, do not run
for (i in 1:4) {
for (j in c(FALSE, TRUE)) {
for (k in 1:10) {
for (l in 1:(i * k * (j + 1))) {
WindowsMT.cpu_pin(l, i * k * (j + 1), i, j, TRUE, FALSE)
}
}
}
}
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.