diff --git a/man/localC.Rd b/man/localC.Rd index 66c084a5..df115891 100644 --- a/man/localC.Rd +++ b/man/localC.Rd @@ -195,7 +195,7 @@ if (run) { } if (run) { if (require(parallel, quietly=TRUE)) { - ncpus <- detectCores(logical=FALSE)-1L + ncpus <- max(2L, detectCores(logical=FALSE), na.rm = TRUE)-1L # test with single core if (ncpus > 1L) ncpus <- 1L cores <- get.coresOption() @@ -327,7 +327,7 @@ if (run) { } if (run) { if (require(parallel, quietly=TRUE)) { - ncpus <- detectCores(logical=FALSE)-1L + ncpus <- max(2L, detectCores(logical=FALSE), na.rm = TRUE)-1L # test with single core if (ncpus > 1L) ncpus <- 1L cores <- get.coresOption() diff --git a/man/set.mcOption.Rd b/man/set.mcOption.Rd index 3e0c96eb..3afe4071 100644 --- a/man/set.mcOption.Rd +++ b/man/set.mcOption.Rd @@ -37,7 +37,7 @@ get.ClusterOption() \examples{ ls(envir=spdep:::.spdepOptions) if (require(parallel, quietly=TRUE)) { - nc <- detectCores(logical=FALSE)-1L + nc <- max(2L, detectCores(logical=FALSE), na.rm = TRUE)-1L nc # set nc to 1L here if (nc > 1L) nc <- 1L diff --git a/man/skater.Rd b/man/skater.Rd index 64284b17..7dbd1237 100644 --- a/man/skater.Rd +++ b/man/skater.Rd @@ -172,7 +172,7 @@ mst.bh <- mstree(nb.w,5) ### three groups with no restriction system.time(res1 <- skater(mst.bh[,1:2], dpad, 2)) library(parallel) -nc <- detectCores(logical=FALSE)-1L +nc <- max(2L, detectCores(logical=FALSE), na.rm = TRUE)-1L # set nc to 1L here if (nc > 1L) nc <- 1L coresOpt <- get.coresOption()