如何解决slurmR 尝试运行示例作业“调用 `silent_system2` 时发生错误:”
我设置了一个 slurm 集群,我可以发出 srun -N4 主机名就好了。
我一直看到“silent_system2”错误。我已经使用 devtools::install_github("USCbiostats/slurmR") 安装了 slurmR
我正在关注第二个示例 3:https://github.com/USCbiostats/slurmR
这是我的文件
cat slurmR.R
library(doParallel)
library(slurmR)
cl <- makeSlurmCluster(4)
registerDoParallel(cl)
m <- matrix(rnorm(9),3,3)
foreach(i=1:nrow(m),.combine=rbind)
StopCluster(cl)
print(m)
cat rscript.slurm
#!/bin/bash
#SBATCH --output=slurmR.out
cd /mnt/nfsshare/tankpve0/
Rscript --vanilla slurmR.R
cat slurmR.out
Loading required package: foreach
Loading required package: iterators
Loading required package: parallel
slurmR default option for `tmp_path` (used to store auxiliar files) set to:
/mnt/nfsshare/tankpve0
You can change this and checkout other slurmR options using: ?opts_slurmR,or you could just type "opts_slurmR" on the terminal.
Submitting job... jobid:18.
Slurm accounting storage is disabled
Error: An error has occurred when calling `silent_system2`:
Warning: An error was detected before returning the cluster object. If submitted,we will try to cancel the job and stop the cluster object.
Execution halted
解决方法
不完全与 slurmR 相关,但如果目标是 slurm + 集群的...那么只需将 slurmR 用作批处理并修改 slurmR.R(不是相同的内部函数,但您会看到聚类是如何完成的)
>library(parallel)
primary <- 'slurmw01'
spec <- c(rep(primary,4),rep('slurmw02',rep('slurmw03',rep('slurmw04',4))
cl <- makeCluster(master=primary,spec=spec)
#load libraries,load files
simpi <- function(n) {
points <- matrix(runif(n*2),ncol=2)
mean(rowSums(points^2) <= 1)*4
}
clusterEvalQ(cl,{
## set up each worker. Could also use clusterExport()
library(parallel)
})
#copy vars,functions
clusterExport(cl,ls(all.names=TRUE),envir = .GlobalEnv)
rest <- clusterApplyLB(cl,rep(1e6,100),simpi)
print(mean(unlist(rest)))
stopCluster(cl)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。