Skip to content

Instantly share code, notes, and snippets.

@klainfo
Created July 25, 2015 18:51
Show Gist options
  • Save klainfo/c7604f059f45af494298 to your computer and use it in GitHub Desktop.
Save klainfo/c7604f059f45af494298 to your computer and use it in GitHub Desktop.
How many cpus are available for parallel jobs?
library(parallel)
cores <- detectCores()
load <- read.table("/proc/loadavg",sep=" ")$V1
cores*.8 - load
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment