1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/freeCores.R
\name{freeCores}
\alias{freeCores}
\title{Get the Average Number of Free CPU Cores}
\usage{
freeCores(
memory = c("5min", "15min", "1min"),
fraction = 0.9,
logical = getOption2("parallelly.availableCores.logical", TRUE),
default = parallelly::availableCores()
)
}
\arguments{
\item{memory}{(character) The time period used to infer the system load,
with alternatives being 5 minutes (default), 15 minutes, or 1 minute.}
\item{fraction}{(non-negative numeric) A scale factor.}
\item{logical}{Passed as-is to \code{\link[=availableCores]{availableCores()}}.}
\item{default}{(integer) The value to be returned if the system load is
unknown, i.e. \code{\link[=cpuLoad]{cpuLoad()}} return missing values.}
}
\value{
An positive integer with attributes \code{loadavg} (named numeric),
\code{maxCores} (named integer), argument \code{memory} (character), and
argument \code{fraction} (numeric).
}
\description{
Get the Average Number of Free CPU Cores
}
\examples{
free <- freeCores()
print(free)
\dontrun{
## Make availableCores() agile to the system load
options(parallelly.availableCores.custom = function() freeCores())
}
}
\keyword{internal}
|