我現在正在處理大型數據集,我想使用並行計算來加速該過程。 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
誰能幫助?非常感謝。