File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
singlecell/resources/chunks Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -173,17 +173,21 @@ readSeuratRDS <- function(filePath) {
173173 return (seuratObj )
174174}
175175
176- print(' Updating future.globals.maxSize' )
177- options(future.globals.maxSize = Inf )
178-
179- options(' Seurat.memsafe' = TRUE , future.globals.onReference = " warning" )
176+ options(future.globals.maxSize = Inf , future.globals.onReference = " warning" )
177+ options(' Seurat.memsafe' = TRUE )
180178
181179if (Sys.getenv(' SEURAT_MAX_THREADS' ) != ' ' ) {
182- print (paste0(' Setting future::plan workers to: ' , Sys.getenv(' SEURAT_MAX_THREADS' )))
180+ logger :: log_info (paste0(' Setting future::plan workers to: ' , Sys.getenv(' SEURAT_MAX_THREADS' )))
183181 mt <- as.integer(Sys.getenv(' SEURAT_MAX_THREADS' ))
184182 if (is.na(mt )) {
185183 stop(paste0(' SEURAT_MAX_THREAD is not an integer: ' , mt <- Sys.getenv(' SEURAT_MAX_THREADS' )))
186184 }
187185
188- future :: plan(strategy = ' multisession' , workers = mt )
186+ fs <- ifelse(exists(' futureStrategy' ), yes = get(' futureStrategy' ), no = ' multicore' )
187+ if (mt == 1 ) {
188+ fs <- ' sequential'
189+ }
190+ logger :: log_info(paste0(' Setting future::strategy to: ' , fs ))
191+
192+ future :: plan(strategy = fs , workers = mt )
189193}
You can’t perform that action at this time.
0 commit comments