Binary files /tmp/tmpfGhHyn/RRQev6BD0B/r-cran-future.batchtools-0.8.0/build/vignette.rds and /tmp/tmpfGhHyn/x1uYLfkOH8/r-cran-future.batchtools-0.8.1+dfsg/build/vignette.rds differ diff -Nru r-cran-future.batchtools-0.8.0/debian/changelog r-cran-future.batchtools-0.8.1+dfsg/debian/changelog --- r-cran-future.batchtools-0.8.0/debian/changelog 2019-08-13 14:55:13.000000000 +0000 +++ r-cran-future.batchtools-0.8.1+dfsg/debian/changelog 2019-10-07 08:49:51.000000000 +0000 @@ -1,3 +1,14 @@ +r-cran-future.batchtools (0.8.1+dfsg-1) unstable; urgency=medium + + * Team upload. + * New upstream version + * Standards-Version: 4.4.1 + * Trim trailing whitespace. + * Set upstream metadata fields: Archive, Bug-Database, Repository. + * Remove autogenerated HTML docs since it is including compressed JS + + -- Andreas Tille Mon, 07 Oct 2019 10:49:51 +0200 + r-cran-future.batchtools (0.8.0-1) unstable; urgency=medium * Initial release (closes: #934695) diff -Nru r-cran-future.batchtools-0.8.0/debian/control r-cran-future.batchtools-0.8.1+dfsg/debian/control --- r-cran-future.batchtools-0.8.0/debian/control 2019-08-13 14:55:13.000000000 +0000 +++ r-cran-future.batchtools-0.8.1+dfsg/debian/control 2019-10-07 08:49:51.000000000 +0000 @@ -7,9 +7,9 @@ Build-Depends: debhelper-compat (= 12), dh-r, r-base-dev, - r-cran-future (>= 1.12.0), + r-cran-future (>= 1.14.0), r-cran-batchtools -Standards-Version: 4.4.0 +Standards-Version: 4.4.1 Vcs-Browser: https://salsa.debian.org/r-pkg-team/r-cran-future.batchtools Vcs-Git: https://salsa.debian.org/r-pkg-team/r-cran-future.batchtools.git Homepage: https://cran.r-project.org/package=future.batchtools @@ -20,8 +20,8 @@ ${misc:Depends} Recommends: ${R:Recommends} Suggests: ${R:Suggests}, - gridengine-client, - slurm-client + gridengine-client, + slurm-client Description: Future API for Parallel and Distributed Processing Implementation of the Future API on top of the 'batchtools' package. This allows you to process futures, as defined by the 'future' package, diff -Nru r-cran-future.batchtools-0.8.0/debian/copyright r-cran-future.batchtools-0.8.1+dfsg/debian/copyright --- r-cran-future.batchtools-0.8.0/debian/copyright 2019-08-13 14:55:13.000000000 +0000 +++ r-cran-future.batchtools-0.8.1+dfsg/debian/copyright 2019-10-07 08:49:51.000000000 +0000 @@ -2,6 +2,7 @@ Upstream-Name: future.batchtools Upstream-Contact: Henrik Bengtsson Source: https://cran.r-project.org/package=future.batchtools +Files-Excluded: */inst/doc/*.html Files: * Copyright: 2019 Henrik Bengtsson diff -Nru r-cran-future.batchtools-0.8.0/debian/patches/noHightlightJS.patch r-cran-future.batchtools-0.8.1+dfsg/debian/patches/noHightlightJS.patch --- r-cran-future.batchtools-0.8.0/debian/patches/noHightlightJS.patch 2019-08-13 14:55:13.000000000 +0000 +++ r-cran-future.batchtools-0.8.1+dfsg/debian/patches/noHightlightJS.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -Index: r-cran-future.batchtools/inst/doc/future.batchtools.html -=================================================================== ---- r-cran-future.batchtools.orig/inst/doc/future.batchtools.html -+++ r-cran-future.batchtools/inst/doc/future.batchtools.html -@@ -52,8 +52,8 @@ window.onload = function() { - - - -+ - - diff -Nru r-cran-future.batchtools-0.8.0/debian/patches/series r-cran-future.batchtools-0.8.1+dfsg/debian/patches/series --- r-cran-future.batchtools-0.8.0/debian/patches/series 2019-08-13 14:55:13.000000000 +0000 +++ r-cran-future.batchtools-0.8.1+dfsg/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -noHightlightJS.patch diff -Nru r-cran-future.batchtools-0.8.0/debian/rules r-cran-future.batchtools-0.8.1+dfsg/debian/rules --- r-cran-future.batchtools-0.8.0/debian/rules 2019-08-13 14:55:13.000000000 +0000 +++ r-cran-future.batchtools-0.8.1+dfsg/debian/rules 2019-10-07 08:49:51.000000000 +0000 @@ -2,4 +2,3 @@ %: dh $@ --buildsystem R - diff -Nru r-cran-future.batchtools-0.8.0/debian/upstream/metadata r-cran-future.batchtools-0.8.1+dfsg/debian/upstream/metadata --- r-cran-future.batchtools-0.8.0/debian/upstream/metadata 1970-01-01 00:00:00.000000000 +0000 +++ r-cran-future.batchtools-0.8.1+dfsg/debian/upstream/metadata 2019-10-07 08:49:51.000000000 +0000 @@ -0,0 +1,4 @@ +Archive: CRAN +Bug-Database: https://github.com/HenrikBengtsson/future.batchtools/issues +Repository: https://github.com/HenrikBengtsson/future.batchtools +Repository-Browse: https://github.com/HenrikBengtsson/future.batchtools diff -Nru r-cran-future.batchtools-0.8.0/debian/watch r-cran-future.batchtools-0.8.1+dfsg/debian/watch --- r-cran-future.batchtools-0.8.0/debian/watch 2019-08-13 14:55:13.000000000 +0000 +++ r-cran-future.batchtools-0.8.1+dfsg/debian/watch 2019-10-07 08:49:51.000000000 +0000 @@ -1,2 +1,3 @@ version=4 +opts="repacksuffix=+dfsg,dversionmangle=s/\+dfsg[0-9]*//g,repack,compression=xz" \ https://cloud.r-project.org/src/contrib/future.batchtools_([-\d.]*)\.tar\.gz diff -Nru r-cran-future.batchtools-0.8.0/DESCRIPTION r-cran-future.batchtools-0.8.1+dfsg/DESCRIPTION --- r-cran-future.batchtools-0.8.0/DESCRIPTION 2019-05-05 06:10:02.000000000 +0000 +++ r-cran-future.batchtools-0.8.1+dfsg/DESCRIPTION 2019-10-01 05:10:05.000000000 +0000 @@ -1,6 +1,6 @@ Package: future.batchtools -Version: 0.8.0 -Depends: R (>= 3.2.0), future (>= 1.12.0) +Version: 0.8.1 +Depends: R (>= 3.2.0), future (>= 1.14.0) Imports: batchtools (>= 0.9.11) Suggests: future.apply, listenv, markdown, R.rsp VignetteBuilder: R.rsp @@ -20,8 +20,8 @@ BugReports: https://github.com/HenrikBengtsson/future.batchtools/issues RoxygenNote: 6.1.1 NeedsCompilation: no -Packaged: 2019-05-05 04:12:17 UTC; hb +Packaged: 2019-10-01 02:50:03 UTC; hb Author: Henrik Bengtsson [aut, cre, cph] Maintainer: Henrik Bengtsson Repository: CRAN -Date/Publication: 2019-05-05 06:10:02 UTC +Date/Publication: 2019-10-01 05:10:05 UTC diff -Nru r-cran-future.batchtools-0.8.0/inst/doc/future.batchtools.html r-cran-future.batchtools-0.8.1+dfsg/inst/doc/future.batchtools.html --- r-cran-future.batchtools-0.8.0/inst/doc/future.batchtools.html 2019-05-05 04:12:16.000000000 +0000 +++ r-cran-future.batchtools-0.8.1+dfsg/inst/doc/future.batchtools.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,435 +0,0 @@ - - - - - -A Future for batchtools - - - - - - - - - - - - - - - - - - - -

A Future for batchtools

- -

Introduction

- -

The future package provides a generic API for using futures in R. -A future is a simple yet powerful mechanism to evaluate an R expression -and retrieve its value at some point in time. Futures can be resolved -in many different ways depending on which strategy is used. -There are various types of synchronous and asynchronous futures to -choose from in the future package.

- -

This package, future.batchtools, provides a type of futures that -utilizes the batchtools package. This means that any type of -backend that the batchtools package supports can be used as a future. -More specifically, future.batchtools will allow you or users of your -package to leverage the compute power of high-performance computing -(HPC) clusters via a simple switch in settings - without having to -change any code at all.

- -

For instance, if batchtools is properly configures, the below two -expressions for futures x and y will be processed on two different -compute nodes:

- -
> library("future.batchtools")
-> plan(batchtools_torque)
->
-> x %<-% { Sys.sleep(5); 3.14 }
-> y %<-% { Sys.sleep(5); 2.71 }
-> x + y
-[1] 5.85
-
- -

This is obviously a toy example to illustrate what futures look like -and how to work with them.

- -

A more realistic example comes from the field of cancer research -where very large data FASTQ files, which hold a large number of short -DNA sequence reads, are produced. The first step toward a biological -interpretation of these data is to align the reads in each sample -(one FASTQ file) toward the human genome. In order to speed this up, -we can have each file be processed by a separate compute node and each -node we can use 24 parallel processes such that each process aligns a -separate chromosome. Here is an outline of how this nested parallelism -could be implemented using futures.

- -
library("future")
-library("listenv")
-## The first level of futures should be submitted to the
-## cluster using batchtools.  The second level of futures
-## should be using multiprocessing, where the number of
-## parallel processes is automatically decided based on
-## what the cluster grants to each compute node.
-plan(list(batchtools_torque, multiprocess))
-
-## Find all samples (one FASTQ file per sample)
-fqs <- dir(pattern = "[.]fastq$")
-
-## The aligned results are stored in BAM files
-bams <- listenv()
-
-## For all samples (FASTQ files) ...
-for (ss in seq_along(fqs)) {
-  fq <- fqs[ss]
-
-  ## ... use futures to align them ...
-  bams[[ss]] %<-% {
-    bams_ss <- listenv()
-    ## ... and for each FASTQ file use a second layer
-    ## of futures to align the individual chromosomes
-    for (cc in 1:24) {
-      bams_ss[[cc]] %<-% htseq::align(fq, chr = cc)
-    }
-    ## Resolve the "chromosome" futures and return as a list
-    as.list(bams_ss)
-  }
-}
-## Resolve the "sample" futures and return as a list
-bams <- as.list(bams)
-
- -

Note that a user who do not have access to a cluster could use the same script processing samples sequentially and chromosomes in parallel on a single machine using:

- -
plan(list(sequential, multiprocess))
-
- -

or samples in parallel and chromosomes sequentially using:

- -
plan(list(multiprocess, sequential))
-
- -

For an introduction as well as full details on how to use futures, -please consult the package vignettes of the future package.

- -

Choosing batchtools backend

- -

The future.batchtools package implements a generic future wrapper -for all batchtools backends. Below are the most common types of -batchtools backends.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
BackendDescriptionAlternative in future package
batchtools_torqueFutures are evaluated via a TORQUE / PBS job schedulerN/A
batchtools_slurmFutures are evaluated via a Slurm job schedulerN/A
batchtools_sgeFutures are evaluated via a Sun/Oracle Grid Engine (SGE) job schedulerN/A
batchtools_lsfFutures are evaluated via a Load Sharing Facility (LSF) job schedulerN/A
batchtools_openlavaFutures are evaluated via an OpenLava job schedulerN/A
batchtools_customFutures are evaluated via a custom set of cluster functionsN/A
batchtools_interactivesequential evaluation in the calling R environmentplan(transparent)
batchtools_multicoreparallel evaluation by forking the current R processplan(multicore)
batchtools_localsequential evaluation in a separate R process (on current machine)plan(cluster, workers = "localhost")
- -

Examples

- -

Below is an examples illustrating how to use batchtools_torque to configure the batchtools backend. For further details and examples on how to configure batchtools, see the batchtools configuration wiki page.

- -

To configure batchtools for job schedulers we need to setup a *.tmpl template -file that is used to generate the script used by the scheduler. -This is what a template file for TORQUE / PBS may look like:

- -
## Job name:
-#PBS -N <%= job.name %>
-
-## Merge standard error and output:
-#PBS -j oe
-
-## Resource parameters:
-<% for (name in names(resources)) { %>
-#PBS -l <%= name %>=<%= resources[[name]] %>
-<% } %>
-
-## Run R:
-R CMD BATCH --no-save --no-restore "<%= rscript %>" /dev/stdout
-
- -

If this template is saved to file batchtools.torque.tmpl (without period) -in the working directory or as .batchtools.torque.tmpl (with period) the -user's home directory, then it will be automatically located by the -batchtools framework and loaded when doing:

- -
> plan(batchtools_torque)
-
- -

Resource parameters can be specified via argument resources which should be a named list and is passed as is to the template file. For example, to request that each job would get alloted 12 cores (one a single machine) and up to 5 GiB of memory, use:

- -
> plan(batchtools_torque, resources = list(nodes = "1:ppn=12", vmem = "5gb"))
-
- -

To specify the resources argument at the same time as using nested future strategies, one can use tweak() to tweak the default arguments. For instance,

- -
plan(list(
-  tweak(batchtools_torque, resources = list(nodes = "1:ppn=12", vmem = "5gb")),
-  multiprocess
-))
-
- -

causes the first level of futures to be submitted via the TORQUE job scheduler requesting 12 cores and 5 GiB of memory per job. The second level of futures will be evaluated using multiprocessing using the 12 cores given to each job by the scheduler.

- -

A similar filename format is used for the other types of job schedulers supported. For instance, for Slurm the template file should be named ./batchtools.slurm.tmpl or ~/.batchtools.slurm.tmpl in order for

- -
> plan(batchtools_slurm)
-
- -

to locate the file automatically. To specify this template file explicitly, use argument template, e.g.

- -
> plan(batchtools_slurm, template = "/path/to/batchtools.slurm.tmpl")
-
- -

For further details and examples on how to configure batchtools per se, see the batchtools configuration wiki page.

- -

Demos

- -

The future package provides a demo using futures for calculating a -set of Mandelbrot planes. The demo does not assume anything about -what type of futures are used. -The user has full control of how futures are evaluated. -For instance, to use local batchtools futures, run the demo as:

- -
library("future.batchtools")
-plan(batchtools_local)
-demo("mandelbrot", package = "future", ask = FALSE)
-
- -
- -

Copyright Henrik Bengtsson, 2017

- - - - diff -Nru r-cran-future.batchtools-0.8.0/inst/doc/future.batchtools.md.rsp r-cran-future.batchtools-0.8.1+dfsg/inst/doc/future.batchtools.md.rsp --- r-cran-future.batchtools-0.8.0/inst/doc/future.batchtools.md.rsp 2018-07-14 17:20:15.000000000 +0000 +++ r-cran-future.batchtools-0.8.1+dfsg/inst/doc/future.batchtools.md.rsp 2019-06-05 02:21:15.000000000 +0000 @@ -136,19 +136,30 @@ file that is used to generate the script used by the scheduler. This is what a template file for TORQUE / PBS may look like: ```sh +#!/bin/bash + ## Job name: -#PBS -N <%%= job.name %%> +#PBS -N <%%= if (exists("job.name", mode = "character")) job.name else job.hash %%> + +## Direct streams to logfile: +#PBS -o <%%= log.file %%> ## Merge standard error and output: #PBS -j oe -## Resource parameters: -<%% for (name in names(resources)) { %%> -#PBS -l <%%= name %%>=<%%= resources[[name]] %%> +## Email on abort (a) and termination (e), but not when starting (b) +#PBS -m ae + +## Resources needed: +<%% if (length(resources) > 0) { + opts <- unlist(resources, use.names = TRUE) + opts <- sprintf("%s=%s", names(opts), opts) + opts <- paste(opts, collapse = ",") %%> +#PBS -l <%%= opts %%> <%% } %%> -## Run R: -R CMD BATCH --no-save --no-restore "<%%= rscript %%>" /dev/stdout +## Launch R and evaluated the batchtools R job +Rscript -e 'batchtools::doJobCollection("<%%= uri %%>")' ``` If this template is saved to file `batchtools.torque.tmpl` (without period) in the working directory or as `.batchtools.torque.tmpl` (with period) the diff -Nru r-cran-future.batchtools-0.8.0/MD5 r-cran-future.batchtools-0.8.1+dfsg/MD5 --- r-cran-future.batchtools-0.8.0/MD5 2019-05-05 06:10:03.000000000 +0000 +++ r-cran-future.batchtools-0.8.1+dfsg/MD5 2019-10-01 05:10:05.000000000 +0000 @@ -1,7 +1,7 @@ -e3fc1003d0b55d03ea3d23863b665b23 *DESCRIPTION +dad6a1069ffab40327e66cf43c4c5b44 *DESCRIPTION af5060939cdff24fd2cb8495ad7e17b8 *NAMESPACE -0da2845ded92b7cf733b780b488d3d30 *NEWS -401ae56ae769ccc45e3082399c26577b *R/BatchtoolsFuture-class.R +116472dbf8de9da035a383a377cb75c2 *NEWS +fd0854190f5315977ea1f224431b5b5a *R/BatchtoolsFuture-class.R 6412ad9204255fc0669e286f3d461234 *R/BatchtoolsFutureError.R 84b9575c37060e083bd28cac12236472 *R/batchtools_custom.R 905c0d8f75d880e7119db68f2f59ded8 *R/batchtools_interactive.R @@ -9,18 +9,18 @@ 185371ce46160bf4b2e82bdcee1756e2 *R/batchtools_multicore.R a0547593d3fa453068d5c397413fb5b7 *R/batchtools_template.R 268859a4ab4dfdd009555880dde20b31 *R/future.batchtools-package.R -39c386ee2d68f820581c81733a03f95f *R/future_cache_path.R +a2fba29ee821ce561fac43358d56ab23 *R/future_cache_path.R c1f8f8dd43040356f0994e2624dd15a3 *R/nbrOfWorkers.R -87e656748fea51860fbedbce8c12a4b3 *R/resources_OP.R +1e8d52dcf2b3c592ba2433dcf6525308 *R/resources_OP.R 037dc0f375fb21b47a39a5bf4fe233b0 *R/temp_registry.R 0d981e8642f21d33ca5efed12c20ffed *R/utils.R -ac273c01c7640ccc7276296054d3270f *R/zzz.R -763b8989c8a2b05e3cd3774ad47a1d50 *build/vignette.rds +dfc19fd3810e5195801e7bfda6a063f0 *R/zzz.R +8ca8baec4ab25f1d475e4b533d8ec679 *build/vignette.rds 4a6587cedeabe8323e86380e48355c45 *demo/00Index b4536ab1e6cdecc5902bc891cd22c721 *demo/mandelbrot.R b77d65b16eb206b9951c37d68be5a605 *inst/WORDLIST -a20513f88c214f16bda6ce5ac8aef0f6 *inst/doc/future.batchtools.html -ac8ea4ecdbcce5f2cfcd6e6933b24aac *inst/doc/future.batchtools.md.rsp +c7c461bad926fa55749e63430c79dbee *inst/doc/future.batchtools.html +0d8c0b979dfb3f375c02ec093f22af74 *inst/doc/future.batchtools.md.rsp 5a1ec0c2d289d6747bba56c054a4bbf5 *inst/templates/torque.tmpl a56c5354a30ddaa44fc1e523fe8fae33 *man/BatchtoolsFuture.Rd af04c92095a28a7770f51f0581116eec *man/BatchtoolsFutureError.Rd @@ -36,7 +36,7 @@ 1fd58ddfa26fa073d2b13ae066fd0185 *man/print.BatchtoolsFuture.Rd 7ce9bd191c4c7f979e676240e1c92700 *man/status.BatchtoolsFuture.Rd 105eb4a5d6ddda7f9cbe19dafdeda03c *tests/BatchtoolsFuture,gc.R -caa5a333cc7500fe4f30dc21a96293d3 *tests/BatchtoolsFuture.R +b93045845fa317dcddd52ee574210e40 *tests/BatchtoolsFuture.R 8e17675666fb162a2318b38faf48d5ea *tests/BatchtoolsFutureError.R 01e9efdaff85cd33114df81ecfc852c2 *tests/batchtools_custom.R 60d2457471e4ba8e466d133cc68d55da *tests/batchtools_hpc.R @@ -47,13 +47,13 @@ 9a152d28aa0889d49f2bb86e7dcf03e2 *tests/demo.R 406b1338a1c74203403626cbdbca2ab7 *tests/dotdotdot.R 0b3f5b41a367c88305c92d3ee1bbcf65 *tests/future,labels.R -8a881f320fa7645d91a8ac84ac36e068 *tests/future,lazy.R +03d2e9f9b7f366363605e9047431c814 *tests/future,lazy.R 36f04d5502f52d4e19b1b3ae453c6d17 *tests/globals,formulas.R e00f6eb5f9c66b7198e42b2223085225 *tests/globals,manual.R 993b087092b9976cc8a815c8b91fe34d *tests/globals,subassignment.R c627a028edfb2a98896c6858de8dcafe *tests/globals,tricky.R 96801dd0ae8b2de345271f7ed2dc7105 *tests/incl/end.R -b7bb71997484f25bb0a7cd7ecc20c50d *tests/incl/start,load-only.R +8e8c501d8b74d39cce395344ee527afa *tests/incl/start,load-only.R 7f88154e15b27406931ed8d62e9e1ce5 *tests/incl/start.R 3d78ef6ee739cead22bd669d458669bf *tests/nbrOfWorkers.R 18d068c579041acbdd11fb9ca20beb6d *tests/plan.R @@ -62,4 +62,4 @@ d92b43fa79f894ed34705c3bfd2d4124 *tests/utils.R e515f265c8f9feba66176b6f5ad116ff *tests/zzz,future_lapply.R 07b2a78a8a669e36396e8ec395b922df *tests/zzz.onUnload.R -ac8ea4ecdbcce5f2cfcd6e6933b24aac *vignettes/future.batchtools.md.rsp +0d8c0b979dfb3f375c02ec093f22af74 *vignettes/future.batchtools.md.rsp diff -Nru r-cran-future.batchtools-0.8.0/NEWS r-cran-future.batchtools-0.8.1+dfsg/NEWS --- r-cran-future.batchtools-0.8.0/NEWS 2019-05-05 04:07:12.000000000 +0000 +++ r-cran-future.batchtools-0.8.1+dfsg/NEWS 2019-10-01 02:48:57.000000000 +0000 @@ -1,6 +1,14 @@ Package: future.batchtools ========================== +Version: 0.8.1 [2019-09-30] + +BUG FIXES: + + * print() for BatchtoolsFuture would produce an error if the underlying + batchtools Registry was incomplete. + + Version: 0.8.0 [2019-05-04] NEW FEATURES: diff -Nru r-cran-future.batchtools-0.8.0/R/BatchtoolsFuture-class.R r-cran-future.batchtools-0.8.1+dfsg/R/BatchtoolsFuture-class.R --- r-cran-future.batchtools-0.8.0/R/BatchtoolsFuture-class.R 2019-05-02 21:58:00.000000000 +0000 +++ r-cran-future.batchtools-0.8.1+dfsg/R/BatchtoolsFuture-class.R 2019-06-22 19:01:15.000000000 +0000 @@ -133,9 +133,9 @@ class(reg)) } else { printf("batchtools Registry:\n ") - print(reg) printf(" File dir exists: %s\n", file_test("-d", reg$file.dir)) printf(" Work dir exists: %s\n", file_test("-d", reg$work.dir)) + try(print(reg)) } invisible(x) @@ -305,6 +305,7 @@ stop_if_not(inherits(result, "FutureResult")) future$result <- result future$state <- "finished" + if (cleanup) delete(future) NextMethod() diff -Nru r-cran-future.batchtools-0.8.0/R/future_cache_path.R r-cran-future.batchtools-0.8.1+dfsg/R/future_cache_path.R --- r-cran-future.batchtools-0.8.0/R/future_cache_path.R 2019-03-16 05:56:26.000000000 +0000 +++ r-cran-future.batchtools-0.8.1+dfsg/R/future_cache_path.R 2019-06-08 05:46:57.000000000 +0000 @@ -1,22 +1,23 @@ #' @importFrom utils file_test sessionInfo future_cache_path <- local({ - ## The path used for this session - path <- NULL + ## The subfolder used for this session + dir <- NULL function(root_path = Sys.getenv("R_FUTURE_CACHE_PATH", ".future"), absolute = TRUE, create = TRUE) { - if (is.null(path)) { + if (is.null(dir)) { id <- basename(tempdir()) id <- gsub("Rtmp", "", id, fixed = TRUE) timestamp <- format(Sys.time(), format = "%Y%m%d_%H%M%S") - dir <- sprintf("%s-%s", timestamp, id) - path_tmp <- file.path(root_path, dir) - if (create && !file_test("-d", path_tmp)) { - dir.create(path_tmp, recursive = TRUE) - pathname_tmp <- file.path(path_tmp, "sessioninfo.txt") - writeLines(capture_output(print(sessionInfo())), con = pathname_tmp) - } - path <<- path_tmp + dir <<- sprintf("%s-%s", timestamp, id) } + + path <- file.path(root_path, dir) + if (create && !file_test("-d", path)) { + dir.create(path, recursive = TRUE) + pathname <- file.path(path, "sessioninfo.txt") + writeLines(capture_output(print(sessionInfo())), con = pathname) + } + if (absolute) path <- normalizePath(path, mustWork = FALSE) path diff -Nru r-cran-future.batchtools-0.8.0/R/resources_OP.R r-cran-future.batchtools-0.8.1+dfsg/R/resources_OP.R --- r-cran-future.batchtools-0.8.0/R/resources_OP.R 2019-03-16 05:56:26.000000000 +0000 +++ r-cran-future.batchtools-0.8.1+dfsg/R/resources_OP.R 2019-06-26 19:46:25.000000000 +0000 @@ -24,7 +24,7 @@ on.exit(plan(oplan, substitute = FALSE, .call = NULL)) ## Tweak current strategy and apply - args <- list(plan(), resources = tweaks, penvir = envir) + args <- list(plan("next"), resources = tweaks, penvir = envir) strategy <- do.call(tweak, args = args) plan(strategy, substitute = FALSE, .call = NULL) diff -Nru r-cran-future.batchtools-0.8.0/R/zzz.R r-cran-future.batchtools-0.8.1+dfsg/R/zzz.R --- r-cran-future.batchtools-0.8.0/R/zzz.R 2019-03-16 05:56:26.000000000 +0000 +++ r-cran-future.batchtools-0.8.1+dfsg/R/zzz.R 2019-06-08 06:02:34.000000000 +0000 @@ -1,3 +1,10 @@ +.onLoad <- function(libname, pkgname) { + inRCmdCheck <- import_future("inRCmdCheck") + if (inRCmdCheck()) { + Sys.setenv("R_FUTURE_CACHE_PATH" = file.path(tempdir(), ".future")) + } +} + #' @importFrom utils file_test .onUnload <- function(libpath) { ## (a) Force finalizer of Future objects to run such diff -Nru r-cran-future.batchtools-0.8.0/tests/BatchtoolsFuture.R r-cran-future.batchtools-0.8.1+dfsg/tests/BatchtoolsFuture.R --- r-cran-future.batchtools-0.8.0/tests/BatchtoolsFuture.R 2019-01-23 02:05:21.000000000 +0000 +++ r-cran-future.batchtools-0.8.1+dfsg/tests/BatchtoolsFuture.R 2019-09-27 21:36:05.000000000 +0000 @@ -14,14 +14,6 @@ message("*** BatchtoolsFuture() - deleting exceptions ...") -## Deleting a non-resolved future -f <- BatchtoolsFuture({ x <- 1 }) -res <- tryCatch({ - delete(f) -}, warning = function(w) w) -print(res) -stopifnot(inherits(res, "warning")) - ## Printing a deleted future f <- batchtools_local(42L) print(f) diff -Nru r-cran-future.batchtools-0.8.0/tests/future,lazy.R r-cran-future.batchtools-0.8.1+dfsg/tests/future,lazy.R --- r-cran-future.batchtools-0.8.0/tests/future,lazy.R 2019-01-04 15:32:19.000000000 +0000 +++ r-cran-future.batchtools-0.8.1+dfsg/tests/future,lazy.R 2019-09-27 21:48:00.000000000 +0000 @@ -15,7 +15,12 @@ a <- 42 f <- future(2 * a, lazy = TRUE) a <- 21 - stopifnot(!resolved(f)) + ## In future (> 1.14.0), resolved() will launch lazy future, + ## which means for some backends (e.g. sequential) this means + ## that resolved() might end up returning TRUE. + if (packageVersion("future") <= "1.14.0") { + stopifnot(!resolved(f)) + } f <- resolve(f) stopifnot(resolved(f)) v <- value(f) @@ -25,7 +30,12 @@ v %<-% { 2 * a } %lazy% TRUE a <- 21 f <- futureOf(v) - stopifnot(!resolved(f)) + ## In future (> 1.14.0), resolved() will launch lazy future, + ## which means for some backends (e.g. sequential) this means + ## that resolved() might end up returning TRUE. + if (packageVersion("future") <= "1.14.0") { + stopifnot(!resolved(f)) + } f <- resolve(f) stopifnot(resolved(f)) stopifnot(v == 84) diff -Nru r-cran-future.batchtools-0.8.0/tests/incl/start,load-only.R r-cran-future.batchtools-0.8.1+dfsg/tests/incl/start,load-only.R --- r-cran-future.batchtools-0.8.0/tests/incl/start,load-only.R 2019-03-16 06:00:01.000000000 +0000 +++ r-cran-future.batchtools-0.8.1+dfsg/tests/incl/start,load-only.R 2019-06-08 06:10:33.000000000 +0000 @@ -12,6 +12,8 @@ ## Use local batchtools futures by default future::plan(future.batchtools::batchtools_local) +Sys.setenv("R_FUTURE_CACHE_PATH" = file.path(tempdir(), ".future")) + fullTest <- (Sys.getenv("_R_CHECK_FULL_") != "") isWin32 <- (.Platform$OS.type == "windows" && .Platform$r_arch == "i386") diff -Nru r-cran-future.batchtools-0.8.0/vignettes/future.batchtools.md.rsp r-cran-future.batchtools-0.8.1+dfsg/vignettes/future.batchtools.md.rsp --- r-cran-future.batchtools-0.8.0/vignettes/future.batchtools.md.rsp 2018-07-14 17:20:15.000000000 +0000 +++ r-cran-future.batchtools-0.8.1+dfsg/vignettes/future.batchtools.md.rsp 2019-06-05 02:21:15.000000000 +0000 @@ -136,19 +136,30 @@ file that is used to generate the script used by the scheduler. This is what a template file for TORQUE / PBS may look like: ```sh +#!/bin/bash + ## Job name: -#PBS -N <%%= job.name %%> +#PBS -N <%%= if (exists("job.name", mode = "character")) job.name else job.hash %%> + +## Direct streams to logfile: +#PBS -o <%%= log.file %%> ## Merge standard error and output: #PBS -j oe -## Resource parameters: -<%% for (name in names(resources)) { %%> -#PBS -l <%%= name %%>=<%%= resources[[name]] %%> +## Email on abort (a) and termination (e), but not when starting (b) +#PBS -m ae + +## Resources needed: +<%% if (length(resources) > 0) { + opts <- unlist(resources, use.names = TRUE) + opts <- sprintf("%s=%s", names(opts), opts) + opts <- paste(opts, collapse = ",") %%> +#PBS -l <%%= opts %%> <%% } %%> -## Run R: -R CMD BATCH --no-save --no-restore "<%%= rscript %%>" /dev/stdout +## Launch R and evaluated the batchtools R job +Rscript -e 'batchtools::doJobCollection("<%%= uri %%>")' ``` If this template is saved to file `batchtools.torque.tmpl` (without period) in the working directory or as `.batchtools.torque.tmpl` (with period) the