如何使用R未来计划“ batchtools_lsf”?

问题描述

我正在使用R包“ future”和“ future.batchtools”,并且我想在LSF计算集群上使用Future。我看到有人可以使用

plan("batchtools_lsf")

使用期货的功能(以及加载软件包future.batchtools之后)。

我正在努力确定文件lsf.tmpl所需的目录路径。我也在努力了解模板文件的作用及其所需的内容

现在,我的工作流程涉及输入

bsub < mysubmit.bsub 

在shell提示符下将作业提交到集群。

mysubmit.bsub中的文本为:

#BSUB -q short 
#BSUB -o %J.out 
#BSUB -e %J.err 
#BSUB -N
#BSUB -W 1:00
#BSUB -n 2
#BSUB -R rusage[mem=8000]
#BSUB -R span[hosts=1]

module load gcc/8.1.0
module load libpng/1.6.8
module load pandoc/2.7.2
module load R/4.0.0_gcc
module load cairo/1.12.16
Rscript -e 'rmarkdown::render("../Rmd/bivariate-mapping-greenyellow-magenta-Chr10.Rmd")'

我在../Rmd/bivariate-mapping-greenyellow-magenta-Chr10.Rmd文件中使用R期货。在使用Rmd的R代码中的期货之前,我还先打电话给plan("batchtools_lsf")

我收到一条R错误消息;这是.err文件中的完整输出

gcc 8.1.0 is located under /share/pkg/gcc/8.1.0
pandoc 2.7.2 is located under /share/pkg/pandoc/2.7.2
R 4.0.0_gcc is located under /share/pkg/R/4.0.0_gcc
When compiling modules for this,be sure to load gcc/8.1.0
cairo 1.12.16 is located under /share/pkg/cairo/1.12.16


processing file: bivariate-mapping-greenyellow-magenta-Chr10.Rmd
Quitting from lines 54-61 (bivariate-mapping-greenyellow-magenta-Chr10.Rmd)
Error in batchtools_by_template(expr,envir = envir,substitute = FALSE,:
  Failed to locate a batchtools template file: *lsf.tmpl
Calls: <Anonymous> ... future_map_template -> future -> makeFuture -> batchtools_by_template
In addition: Warning message:
In Grdevices::png(f) : unable to open connection to X11 display ''
Execution halted

显然,找不到lsf.tmpl文件

我目前在与mysubmit.bsub相同的目录中有一个文本文件lsf.tmpl,没有前面的句点。 lsf.tmpl包含以下文本:

## Default resources can be set in your .batchtools.conf.R by defining the variable
## 'default.resources' as a named list.

## https://raw.githubusercontent.com/mllg/batchtools/master/inst/templates/lsf-simple.tmpl

#BSUB -J <%= job.name %>                             # Name of the job
#BSUB -o <%= log.file %>                             # Output is sent to logfile,stdout + stderr by default
#BSUB -q <%= resources$queue %>                      # Job queue
#BSUB -W <%= round(resources$walltime / 60,1) %>    # Walltime (LSF requires minutes,batchtools uses seconds)
#BSUB -M <%= resources$memory %>                     # Memory requirements,e.g. "5000KB","500MB","5GB" etc. 

## Export value of DEBUGME environemnt var to slave
export DEBUGME=<%= Sys.getenv("DEBUGME") %>

<%= sprintf("export OMP_NUM_THREADS=%i",resources$omp.threads) -%>
<%= sprintf("export OPENBLAS_NUM_THREADS=%i",resources$blas.threads) -%>
<%= sprintf("export MKL_NUM_THREADS=%i",resources$blas.threads) -%>

Rscript -e 'batchtools::doJobCollection("<%= uri %>")'

我从https://github.com/mllg/batchtools/blob/master/inst/templates/lsf-simple.tmpl复制了lsf.tmpl逐字记录

我当前不使用配置文件

我的工作流程还是应该从我通过bsub提交mysubmit.bsub开始吗?还是在使用plan("batchtools_lsf")时需要更改工作流程?

使用lsf.tmpl的当前版本是否正确,是否正确?还是我需要以某种方式使其适合我的用途?我不确定模板文件到底扮演什么角色。

感谢您提供的任何建议。谢谢!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...