diff -Nru r-cran-domc-1.2.1/debian/changelog r-cran-domc-1.2.2/debian/changelog --- r-cran-domc-1.2.1/debian/changelog 2011-05-21 09:24:20.000000000 +0000 +++ r-cran-domc-1.2.2/debian/changelog 2011-05-21 09:24:21.000000000 +0000 @@ -1,3 +1,12 @@ +r-cran-domc (1.2.2-1) unstable; urgency=low + + * New upstream release + + * debian/control: Set (Build-)Depends: to current R version + * debian/control: Set Standards-Version: to current version + + -- Dirk Eddelbuettel Fri, 20 May 2011 14:43:26 -0500 + r-cran-domc (1.2.1-1) unstable; urgency=low * New upstream release diff -Nru r-cran-domc-1.2.1/debian/control r-cran-domc-1.2.2/debian/control --- r-cran-domc-1.2.1/debian/control 2011-05-21 09:24:20.000000000 +0000 +++ r-cran-domc-1.2.2/debian/control 2011-05-21 09:24:21.000000000 +0000 @@ -2,13 +2,13 @@ Section: gnu-r Priority: optional Maintainer: Dirk Eddelbuettel -Build-Depends: debhelper (>= 7.0.0), r-base-dev (>= 2.11.1), cdbs, r-cran-multicore, r-cran-foreach, r-cran-iterators -Standards-Version: 3.8.4 +Build-Depends: debhelper (>= 7.0.0), r-base-dev (>= 2.13.0), cdbs, r-cran-multicore, r-cran-foreach, r-cran-iterators +Standards-Version: 3.9.1 Homepage: http://cran.r-project.org/web/packages/doMC/index.html Package: r-cran-domc Architecture: all -Depends: r-base-core (>= 2.11.1), r-cran-multicore, r-cran-foreach, r-cran-iterators +Depends: r-base-core (>= 2.13.0), r-cran-multicore, r-cran-foreach, r-cran-iterators Description: GNU R parallel excution backend for %dopar% using multicore This package provides a parallel backend for the %dopar% function using Simon Urbanek's multicore package. diff -Nru r-cran-domc-1.2.1/debian/r-cran-domc.lintian-overrides r-cran-domc-1.2.2/debian/r-cran-domc.lintian-overrides --- r-cran-domc-1.2.1/debian/r-cran-domc.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ r-cran-domc-1.2.2/debian/r-cran-domc.lintian-overrides 2011-05-21 09:24:21.000000000 +0000 @@ -0,0 +1 @@ +r-cran-domc: script-not-executable usr/lib/R/site-library/doMC/unitTests/runTestSuite.sh diff -Nru r-cran-domc-1.2.1/DESCRIPTION r-cran-domc-1.2.2/DESCRIPTION --- r-cran-domc-1.2.1/DESCRIPTION 2010-06-10 06:26:44.000000000 +0000 +++ r-cran-domc-1.2.2/DESCRIPTION 2011-05-20 12:05:16.000000000 +0000 @@ -1,15 +1,18 @@ Package: doMC Type: Package Title: Foreach parallel adaptor for the multicore package -Version: 1.2.1 +Version: 1.2.2 Author: Revolution Analytics Maintainer: Revolution Analytics Description: Provides a parallel backend for the %dopar% function using Simon Urbanek's multicore package. Depends: R (>= 2.5.0), foreach(>= 1.2.0), iterators(>= 1.0.0), multicore(>= 0.1-2), utils +Enhances: compiler, RUnit License: GPL-2 OS_type: unix -Packaged: 2010-06-09 23:05:37 UTC; richcalaway Repository: CRAN -Date/Publication: 2010-06-10 06:26:44 +Repository/R-Forge/Project: domc +Repository/R-Forge/Revision: 8 +Date/Publication: 2011-05-20 12:05:16 +Packaged: 2011-05-18 20:52:05 UTC; rforge Binary files /tmp/zhp1IhEqb6/r-cran-domc-1.2.1/inst/doc/gettingstartedMC.pdf and /tmp/ygoMvUEHMn/r-cran-domc-1.2.2/inst/doc/gettingstartedMC.pdf differ diff -Nru r-cran-domc-1.2.1/inst/unitTests/options.R r-cran-domc-1.2.2/inst/unitTests/options.R --- r-cran-domc-1.2.1/inst/unitTests/options.R 1970-01-01 00:00:00.000000000 +0000 +++ r-cran-domc-1.2.2/inst/unitTests/options.R 2011-05-18 20:49:21.000000000 +0000 @@ -0,0 +1,14 @@ +test01 <- function() { + x <- list(1:3, 1:9, 1:19) + cs <- 1:20 + + for (chunkSize in cs) { + mcopts <- list(preschedule=FALSE) + for (y in x) { + actual <- foreach(i=y, .options.multicore=mcopts) %dopar% i + checkEquals(actual, as.list(y)) + actual <- foreach(i=y, .combine='c', .options.multicore=mcopts) %do% i + checkEquals(actual, y) + } + } +} diff -Nru r-cran-domc-1.2.1/inst/unitTests/runTestSuite.sh r-cran-domc-1.2.2/inst/unitTests/runTestSuite.sh --- r-cran-domc-1.2.1/inst/unitTests/runTestSuite.sh 1970-01-01 00:00:00.000000000 +0000 +++ r-cran-domc-1.2.2/inst/unitTests/runTestSuite.sh 2011-05-18 20:49:21.000000000 +0000 @@ -0,0 +1,44 @@ +#!/bin/sh + +LOGFILE=test.log + +R --vanilla --slave > ${LOGFILE} 2>&1 <<'EOF' +library(doMC) +library(RUnit) + +verbose <- as.logical(Sys.getenv('FOREACH_VERBOSE', 'FALSE')) + +library(doMC) +registerDoMC() + +options(warn=1) +options(showWarnCalls=TRUE) + +cat('Starting test at', date(), '\n') +cat(sprintf('doMC version: %s\n', getDoParVersion())) +cat(sprintf('Running with %d worker(s)\n', getDoParWorkers())) + +tests <- c('options.R') + +errcase <- list() +for (f in tests) { + cat('\nRunning test file:', f, '\n') + t <- runTestFile(f) + e <- getErrors(t) + if (e$nErr + e$nFail > 0) { + errcase <- c(errcase, t) + print(t) + } +} + +if (length(errcase) == 0) { + cat('*** Ran all tests successfully ***\n') +} else { + cat('!!! Encountered', length(errcase), 'problems !!!\n') + for (t in errcase) { + print(t) + } +} + +cat('Finished test at', date(), '\n') +EOF diff -Nru r-cran-domc-1.2.1/NEWS r-cran-domc-1.2.2/NEWS --- r-cran-domc-1.2.1/NEWS 2010-06-09 23:01:27.000000000 +0000 +++ r-cran-domc-1.2.2/NEWS 2011-05-18 20:49:21.000000000 +0000 @@ -1,6 +1,19 @@ NEWS/ChangeLog for doMC ------------------------- +1.2.2 2011-05-16 + o Added support for the compiler package in R 2.13.0 + o Enhanced unit tests to enable running them under R CMD check. + + +1.2.1 2010-01-25 + o Changed license to GPL-2 + o Error handling for the doMC backend should now be correct. If + .errorhandling is set to anything other than 'stop', it should return + an array containing the results of all iterations which did not cause + errors. (From a bug report by Brian Peterson) + + 1.2.0 2009-10-05 o added support for all of the mclapply options via the foreach .options.multicore argument diff -Nru r-cran-domc-1.2.1/R/doMC.R r-cran-domc-1.2.2/R/doMC.R --- r-cran-domc-1.2.1/R/doMC.R 2010-06-09 23:01:26.000000000 +0000 +++ r-cran-domc-1.2.2/R/doMC.R 2011-05-18 20:49:21.000000000 +0000 @@ -44,6 +44,12 @@ NULL) } +comp <- if (getRversion() < "2.13.0") { + function(expr, ...) expr +} else { + compiler::compile +} + doMC <- function(obj, expr, envir, data) { # set the default mclapply options preschedule <- TRUE @@ -113,8 +119,12 @@ } } + # define the "worker" function, compiling expr if possible + c.expr <- comp(expr, env=envir, options=list(suppressUndefined=TRUE)) + FUN <- function(args) tryCatch(eval(c.expr, envir=args, enclos=envir), + error=function(e) e) + # execute the tasks - FUN <- function(args) tryCatch(eval(expr, envir=args, enclos=envir), error=function(e) e) results <- mclapply(argsList, FUN, mc.preschedule=preschedule, mc.set.seed=set.seed, mc.silent=silent, mc.cores=cores) diff -Nru r-cran-domc-1.2.1/test/options.R r-cran-domc-1.2.2/test/options.R --- r-cran-domc-1.2.1/test/options.R 2010-06-09 23:01:26.000000000 +0000 +++ r-cran-domc-1.2.2/test/options.R 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -test01 <- function() { - x <- list(1:3, 1:9, 1:19) - cs <- 1:20 - - for (chunkSize in cs) { - mcopts <- list(preschedule=FALSE) - for (y in x) { - actual <- foreach(i=y, .options.multicore=mcopts) %dopar% i - checkEquals(actual, as.list(y)) - actual <- foreach(i=y, .combine='c', .options.multicore=mcopts) %do% i - checkEquals(actual, y) - } - } -} diff -Nru r-cran-domc-1.2.1/test/runTestSuite.sh r-cran-domc-1.2.2/test/runTestSuite.sh --- r-cran-domc-1.2.1/test/runTestSuite.sh 2010-06-09 23:01:26.000000000 +0000 +++ r-cran-domc-1.2.2/test/runTestSuite.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ -#!/bin/sh - -LOGFILE=test.log - -R --vanilla --slave > ${LOGFILE} 2>&1 <<'EOF' -library(doMC) -library(RUnit) - -verbose <- as.logical(Sys.getenv('FOREACH_VERBOSE', 'FALSE')) - -library(doMC) -registerDoMC() - -options(warn=1) -options(showWarnCalls=TRUE) - -cat('Starting test at', date(), '\n') -cat(sprintf('doMC version: %s\n', getDoParVersion())) -cat(sprintf('Running with %d worker(s)\n', getDoParWorkers())) - -tests <- c('options.R') - -errcase <- list() -for (f in tests) { - cat('\nRunning test file:', f, '\n') - t <- runTestFile(f) - e <- getErrors(t) - if (e$nErr + e$nFail > 0) { - errcase <- c(errcase, t) - print(t) - } -} - -if (length(errcase) == 0) { - cat('*** Ran all tests successfully ***\n') -} else { - cat('!!! Encountered', length(errcase), 'problems !!!\n') - for (t in errcase) { - print(t) - } -} - -cat('Finished test at', date(), '\n') -EOF diff -Nru r-cran-domc-1.2.1/tests/doRUnit.R r-cran-domc-1.2.2/tests/doRUnit.R --- r-cran-domc-1.2.1/tests/doRUnit.R 1970-01-01 00:00:00.000000000 +0000 +++ r-cran-domc-1.2.2/tests/doRUnit.R 2011-05-18 20:49:21.000000000 +0000 @@ -0,0 +1,70 @@ +## unit tests will not be done if RUnit is not available +if(require("RUnit", quietly=TRUE)) { + + ## --- Setup --- + + pkg <- "doMC" # <-- Change to package name! + + if(Sys.getenv("RCMDCHECK") == "FALSE") { + ## Path to unit tests for standalone running under Makefile (not R CMD check) + ## PKG/tests/../inst/unitTests + path <- file.path(getwd(), "..", "inst", "unitTests") + } else { + ## Path to unit tests for R CMD check + ## PKG.Rcheck/tests/../PKG/unitTests + path <- system.file(package=pkg, "unitTests") + } + cat("\nRunning unit tests\n") + print(list(pkg=pkg, getwd=getwd(), pathToUnitTests=path)) + + library(package=pkg, character.only=TRUE) + ################################################################ + ## BEGIN PACKAGE SPECIFIC CONFIGURATION # + ################################################################ + registerDoMC() + ################################################################ + ## END PACKAGE SPECIFIC CONFIGURATION # + ################################################################ + + ## If desired, load the name space to allow testing of private functions + ## if (is.element(pkg, loadedNamespaces())) + ## attach(loadNamespace(pkg), name=paste("namespace", pkg, sep=":"), pos=3) + ## + ## or simply call PKG:::myPrivateFunction() in tests + + + + ## --- Testing --- + + ## Define tests + testSuite <- defineTestSuite(name=paste(pkg, "unit testing"), + dirs=path, testFileRegexp = "^options\\.R$") + ## Run + tests <- runTestSuite(testSuite) + + ## Default report name + pathReport <- file.path(path, "report") + + ## Report to stdout and text files + cat("------------------- UNIT TEST SUMMARY ---------------------\n\n") + printTextProtocol(tests, showDetails=FALSE) + printTextProtocol(tests, showDetails=FALSE, + fileName=paste(pathReport, "Summary.txt", sep="")) + printTextProtocol(tests, showDetails=TRUE, + fileName=paste(pathReport, ".txt", sep="")) + + ## Report to HTML file + printHTMLProtocol(tests, fileName=paste(pathReport, ".html", sep="")) +# printHTMLProtocol(tests, fileName=file.path(dirname(dirname(getwd())),pkg,"gsDesign-RUnit-Test-Summary.html")) #paste(pathReport, ".html", sep="")) + + ## Return stop() to cause R CMD check stop in case of + ## - failures i.e. FALSE to unit tests or + ## - errors i.e. R errors + tmp <- getErrors(tests) + if(tmp$nFail > 0 | tmp$nErr > 0) { + stop(paste("\n\nunit testing failed (#test failures: ", tmp$nFail, + ", #R errors: ", tmp$nErr, ")\n\n", sep="")) + } +} else { + warning("cannot run unit tests -- package RUnit is not available") +}