[Vegan-commits] r2048 - in pkg/vegan: R inst man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Jan 18 12:19:14 CET 2012
Author: jarioksa
Date: 2012-01-18 12:19:13 +0100 (Wed, 18 Jan 2012)
New Revision: 2048
Modified:
pkg/vegan/R/permutest.cca.R
pkg/vegan/inst/ChangeLog
pkg/vegan/man/anova.cca.Rd
Log:
parallel processing honours setDefatultCluster
Modified: pkg/vegan/R/permutest.cca.R
===================================================================
--- pkg/vegan/R/permutest.cca.R 2012-01-17 09:34:52 UTC (rev 2047)
+++ pkg/vegan/R/permutest.cca.R 2012-01-18 11:19:13 UTC (rev 2048)
@@ -7,7 +7,7 @@
`permutest.cca` <-
function (x, permutations = 99,
model = c("reduced", "direct", "full"), first = FALSE,
- strata = NULL, parallel = getOption("mc.cores", 1L) , ...)
+ strata = NULL, parallel = getOption("mc.cores") , ...)
{
model <- match.arg(model)
isCCA <- !inherits(x, "rda")
@@ -114,7 +114,11 @@
}
nperm <- nrow(permutations)
## Parallel processing (similar as in oecosimu)
- hasClus <- inherits(parallel, "cluster") || is.null(parallel)
+ if (is.null(parallel) && getRversion() >= "2.15.0")
+ parallel <- get("default", envir = parallel:::.reg)
+ if (is.null(parallel) || getRversion() < "2.14.0")
+ parallel <- 1
+ hasClus <- inherits(parallel, "cluster")
if ((hasClus || parallel > 1) && require(parallel)) {
if(.Platform$OS.type == "unix" && !hasClus) {
tmp <- do.call(rbind,
Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog 2012-01-17 09:34:52 UTC (rev 2047)
+++ pkg/vegan/inst/ChangeLog 2012-01-18 11:19:13 UTC (rev 2048)
@@ -13,13 +13,12 @@
_R_CHECK_FORCE_SUGGESTS_=FALSE (see, e.g., discussion
https://stat.ethz.ch/pipermail/r-devel/2011-December/062827.html).
- * oecosimu: new experimental parallel block which honours
+ * oecosimu, permutest.cca: new parallel block which honours
setDefaultCluster() in R-devel (becoming R 2.15.0) and
automatically uses parallel processing with socket clusters if
setDefaultCluster was defined. Tested in R (unstable) (2012-01-16
- r58122) with full features, and in R version 2.13.1 (2011-07-08)
- without parallel processing, but not yet in R 2.14.1 with parallel
- processing but without setDefaultCluster().
+ r58122) with full features, in R 2.14.1 without setDefaultCluster,
+ and in R 2.13.1 (2011-07-08) without parallel processing
* anova.ccabymargin failed if none of the terms was analysed (all
were aliased) and no permutations were performed. This would
Modified: pkg/vegan/man/anova.cca.Rd
===================================================================
--- pkg/vegan/man/anova.cca.Rd 2012-01-17 09:34:52 UTC (rev 2047)
+++ pkg/vegan/man/anova.cca.Rd 2012-01-18 11:19:13 UTC (rev 2048)
@@ -26,7 +26,7 @@
\method{permutest}{cca}(x, permutations = 99,
model = c("reduced", "direct", "full"),
first = FALSE, strata = NULL,
- parallel = getOption("mc.cores", 1L) , ...)
+ parallel = getOption("mc.cores") , ...)
}
\arguments{
More information about the Vegan-commits
mailing list