R/is_on_cluster.R

Defines functions is_on_cluster

Documented in is_on_cluster

#' Check if code is running on Hábrók HPCC
#'
#' @return Boolean. `TRUE` if called from Hábrók HPCC, FALSE if not.
#' @export
#'
#' @examples
#' on_cluster <- is_on_cluster()
#'
#' @author Pedro Santos Neves
is_on_cluster <- function() {
  if (identical(Sys.getenv("SLURM_CLUSTER_NAME"), "habrok")) {
    return(TRUE)
  } else {
    return(FALSE)
  }
}
tece-lab/DAISIEutils documentation built on Jan. 31, 2024, 12:09 p.m.