我现在正在处理大型数据集,我想使用并行计算来加速该过程。 WestGird是一个加拿大计算系统,它具有互连的集群。WestGrid中基于MPI群集的并行计算(pbs文件)
我使用两个包doSNOW
和parallel
来做并行作业。我的问题是我应该如何编写pbs
文件。当我使用qsub
提交作业时,发生错误:mpirun noticed that the job aborted, but has no info as to the process that caused that situation
。
这里是R脚本代码:
install.packages("fume_1.0.tar.gz")
library(fume)
library(foreach)
library(doSNOW)
load("spei03_df.rdata",.GlobalEnv)
cl <- makeCluster(mpi.universe.size(), type='MPI')
registerDoSNOW(cl)
MK_grid <-
foreach(i=1:6000, .packages="fume",.combine='rbind') %dopar% {
abc <- mkTrend(as.matrix(spei03_data)[i,])
data.frame(P_value=abc$`Corrected p.value`, Slope=abc$`Sen's Slope`*10,Zc=abc$Zc)
}
stopCluster(cl)
save(MK_grid,file="MK_grid.rdata")
mpi.exit()
的 “烟” 包是从https://cran.r-project.org/src/contrib/Archive/fume/下载。
这里是PBS文件:
#!/bin/bash
#PBS -l nodes=2:ppn=12
#PBS -l walltime=2:00:00
module load application/R/3.3.1
cd $PBS_O_WORKDIR
export OMP_NUM_THREADS=1
mpirun -np 1 -hostfile $PBS_NODEFILE R CMD BATCH Trend.R
谁能帮助?非常感谢。