Skip to content

Problem forwarding batchtools resources to individual futures #75

Description

@wlandau

Summary

When I supply a resources list to a batchtools future, the resources seem to be ignored. I was alerted to this via targets, ropensci/targets#562 (comment) and ropensci/targets#632 (cc @wresch, @sdechaumet)

Reproducible example

Using an SGE cluster with this template:

#!/bin/bash
#$ -cwd
#$ -j y
#$ -o <%= log.file %>
#$ -V
#$ -N <%= job.name %>
#$ -pe smp <%= resources$slots %>
module load R/4.0.3
Rscript -e 'batchtools::doJobCollection("<%= uri %>")'
exit 0

R console:

library(future)
library(future.batchtools)
plan(batchtools_sge, template="sge_batchtools.tmpl")
f<- future(Sys.sleep(5), resources=list(slots=2))
# Error: Fatal error occurred: 101. Command 'qsub' produced exit code 2. Output: 'Unable to read script file because of error: ERROR! -pe option must have range as 2nd argument'

When I run debug(BatchtoolsFuture) on this example, I see that resources = list(slots = 2) is not actually passed to the BatchtoolsFuture() function. BatchtoolsFuture() appears to receive the default resources = list().

Expected behavior

An SGE job with 2 slots should be submitted.

Session information

I am using the following commits of future and future.batchtools:

> sessionInfo()
Rversion4.0.3 (2020-10-10)
Platform:x86_64-pc-linux-gnu (64-bit)
Runningunder:RedHatEnterpriseLinuxMatrixproducts:defaultBLAS/LAPACK:<CENSORED>locale:
[1] LC_CTYPE=en_US.UTF-8LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=en_US.UTF-8LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8LC_NAME=C [9] LC_ADDRESS=CLC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8LC_IDENTIFICATION=Cattachedbasepackages:
[1] statsgraphicsgrDevicesutilsdatasetsmethodsbaseotherattachedpackages:
[1] future.batchtools_0.10.0-9000future_1.22.1-9000loadedviaa namespace (andnotattached):
[1] parallelly_1.28.1magrittr_2.0.1hms_1.1.0progress_1.2.2 [5] rappdirs_0.3.3debugme_1.1.0R6_2.5.1brew_1.0-6 [9] rlang_0.4.11fansi_0.5.0globals_0.14.0tools_4.0.3 [13] parallel_4.0.3checkmate_2.0.0data.table_1.14.0utf8_1.2.2 [17] withr_2.4.2ellipsis_0.3.2base64url_1.4digest_0.6.27 [21] tibble_3.1.4lifecycle_1.0.0crayon_1.4.1fs_1.5.0 [25] vctrs_0.3.8batchtools_0.9.15codetools_0.2-18stringi_1.7.4 [29] pillar_1.6.2compiler_4.0.3backports_1.2.1prettyunits_1.1.1
[33] listenv_0.8.0pkgconfig_2.0.3

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions