R/zzz.R

Defines functions .onUnload .onDetach .onLoad

# nocov start
.onLoad <- function(libname, pkgname) {
  # Get reasonable selction for "max" cpus
  options("DLPCPU" = as.integer( # nolint
    getOption("DLPCPU", default = parallel::detectCores())
  ))
}

.onDetach <- function(libpath) {
  # Restore reasonable option and remove holding variable
  setDelapThreads(getOption("DLPCPU"))
  options("DLPCPU" = NULL) # nolint
}

.onUnload <- function(libpath) {
  library.dynam.unload("Delaporte", libpath)
}
# nocov end

Try the Delaporte package in your browser

Any scripts or data that you put into this service are public.

Delaporte documentation built on June 22, 2024, 10:43 a.m.