Skip to content

Commit 6d26140

Browse files
committed
Add hook to set futures::plan in single-cell docker jobs
1 parent a698c55 commit 6d26140

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

singlecell/resources/chunks/Functions.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,9 @@ addIntermediateFile <- function(f) { intermediateFiles <<- c(intermediateFiles,
9191
print('Updating future.globals.maxSize')
9292
options(future.globals.maxSize = Inf)
9393

94-
options('Seurat.memsafe' = TRUE)
94+
options('Seurat.memsafe' = TRUE)
95+
96+
if (!is.null(Sys.getenv('SEURAT_MAX_THREADS'))) {
97+
print(paste0('Setting future::plan workers to: ', Sys.getenv('SEURAT_MAX_THREADS')))
98+
future::plan(strategy='multiprocess', workers=Sys.getenv('SEURAT_MAX_THREADS'))
99+
}

0 commit comments

Comments
 (0)