WindowsMT.cpu_pin: Windows CPU Pinning

Description Usage Arguments Details Examples

Description

Pins CPU on Windows depending on the number of cores requested.

Usage

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)

Arguments

n_request

Type: integer. Number of logical cores to pin.

n_cores

Type: integer. Number of logical cores on your machine. Defaults to as.integer(Sys.getenv("NUMBER_OF_PROCESSORS")).

n_sockets

Type: integer. Number of sockets on your machine. Defaults to 1.

n_hyperthread

Type: logical. Whether hyperthreading is activated. Defaults to TRUE.

verbose

Type: logical. Whether to print debug information. Defaults to TRUE.

test

Type: logical. Whether to just print the pinning without performing the pinning (placebo if TRUE). Defaults to FALSE.

Details

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.

Examples

 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)

Laurae2/WindowsMT documentation built on May 20, 2019, 5:44 p.m.