[R-sig-hpc] r script using foreach hangs at loop

Ei-ji Nakama nakama at ki.rim.or.jp
Mon Apr 25 06:01:16 CEST 2016


check determine if Open MPI is configured for PBS environment?
i.e. https://www.open-mpi.org/faq/?category=tm#tm-configure-ompi

You must launch the process through the job scheduler.
#machine(or hostfile) is rsh(or ssh) will request

Please  to inquiry your system administrator.

2016-04-24 4:14 GMT+09:00 John Denton <jdenton at amnh.org>:
> Hi, all.
>
> I have am R script I'm trying to run on a cluster, using OpenMPI and mpirun, but after the non-mpi elements of the function are produced, the execution hangs at the foreach step:
>
> ##RUN MPI BOOTSTRAP (set MPI in script itself):
>
> iters <- list.files(pattern="\\.nex")
>
>         clust <- startMPIcluster(ncores)
>         registerDoMPI(clust)
>
>                         foreach(i=1:length(iters)) %dopar% {
>                                 system(paste("mb", iters[i], sep=" "))
>                         }
>
> closeCluster(clust)
>
> where ncores is set to be equal to the value nodes x ppn in the sh file:
>
> # qsub -V myjob-pbs.sh
> #PBS -V
> #PBS -N tully_bt.name
> #PBS -q batch
> #PBS -S /bin/bash
> #PBS -m abe
> #PBS -l nodes=13:ppn=4
> #PBS -l walltime=500:00:00
>
> cd $PBS_O_WORKDIR
> echo Working directory is $PBS_O_WORKDIR
>
> NPROCS=`wc -l < $PBS_NODEFILE`
>
> NNODES=`uniq $PBS_NODEFILE | wc -l`
>
> echo Running on host `hostname`
> echo Time is `date`
> echo Directory is `pwd`
> echo Using ${NPROCS} processors across ${NNODES} nodes
>
> module load openmpi-1.10.1
> MPIRUN=`which mpirun`
> ${MPIRUN} -machinefile $PBS_NODEFILE -np 1 R --slave -f test.r
>
> The function itself loads doMPI, which loads foreach and Rmpi as dependencies.
>
> The R script is test.r, which has only the lines source (the function), function (call function with options), mpi.quit. The function works without a submission script, and I suspect the problem might have something to do with the mpirun line, but I am not sure.
>
> Any help would be appreciated!
>
>
>
>
>
> John S. S. Denton, Ph.D.
> Department of Vertebrate Paleontology
> American Museum of Natural History
> www.johnssdenton.com
> _______________________________________________
> R-sig-hpc mailing list
> R-sig-hpc at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-hpc



-- 
Best Regards,
--
Eiji NAKAMA <nakama (a) ki.rim.or.jp>
"\u4e2d\u9593\u6804\u6cbb"  <nakama (a) ki.rim.or.jp>



More information about the R-sig-hpc mailing list