dot-getNrCores: Get the number of CPUs to use for CBE processing

.getNrCoresR Documentation

Get the number of CPUs to use for CBE processing

Description

This function checks for the presence of a global CBE.params list and, if found and contains a cpus entry, returns the number of CPUs specified by cpus minus one. Otherwise, it returns a default number of CPUs.

Usage

.getNrCores(n.cpus.def = 8)

Arguments

n.cpus.def

The default number of CPUs to return if CBE.params does not exist or does not contain a cpus entry. Defaults to 8.

Value

The number of CPUs to use for CBE processing. If CBE.params$cpus is set, returns CBE.params$cpus - 1, ensuring at least 1 CPU is returned. Otherwise, returns n.cpus.def.

Examples

# Assuming CBE.params does not exist or does not have a `cpus` entry
getCPUsCBE() # returns 8 by default

# Assuming CBE.params exists and has a `cpus` entry of 4
getCPUsCBE() # returns 3

vertesy/Seurat.utils documentation built on Dec. 4, 2024, 5:20 p.m.