R/register_cores.R

Defines functions register_cores

Documented in register_cores

#' Register cores
#' 
#' Register a multi-threaded instances using \pkg{BiocParallel}.
#' @inheritParams BiocParallel::SnowParam
#' @returns Null output.
register_cores <- function(workers=1,
                           progressbar=TRUE){
    requireNamespace("BiocParallel")
    BPPARAM <- if(.Platform$OS.type=="windows"){
        BiocParallel::SnowParam(workers = workers, 
                                progressbar = progressbar)
    } else {
        BiocParallel::MulticoreParam(workers = workers, 
                                     progressbar = progressbar)
    }
    BiocParallel::register(BPPARAM = BPPARAM)
}
neurogenomics/MungeSumstats documentation built on Aug. 10, 2024, 5:59 a.m.