Dear R people,

I’ve been doing some hpc using R and openmpi. Unfortunately I’ve encoutred a 
major problem and it’s nature is hard to pin down:

Essentially I call mpirun Rscipt … as soon as the script reaches a 
foreach()%dopar% it halts indefinitely. I’ve attached the qsub script:

#!/bin/bash
#$ -S /bin/bash
#$ -N test_14
#$ -cwd
    
#$ -V  
#$ -o "/fhgfs/g61570/Spectral Databases/log/test_14_"$JOB_ID             
#$ -j y
#$ -q regular
#$ -pe openmpi 8
#$ -l h_rt=00:15:00
#$ -l h_vmem=1.9G  
#$ -m eas          
#$ -M andre.ziervo...@psychol.uni-giessen.de

module add gcc     
module add openmpi/gcc/64/1.6.5
module add R/gcc/3.0.1

date                       #log start time

echo "Number of slots " . $NSLOTS

mpirun Rscript /fhgfs/g61570/Spectral\ Databases/test_10.r > 
/fhgfs/g61570/Spectral\ Databases/log/test_14.Rout

date

exit

and the R file:

suppressMessages(library('doMPI'))

skylla.cluster <- startMPIcluster()
registerDoMPI(skylla.cluster)

cat(paste("COMM SIZE: ", mpi.comm.size(0), " cluster size: ", 
clusterSize(skylla.cluster), "\n",sep = ""))

tmp.time <- proc.time()
sample <- foreach(i=seq(from=0, to=1000, by =1),.combine='c',.inorder=TRUE) %do%
{
        r <- sqrt(i^2 + i^2) + .Machine$double.eps  * factorial(i)
        sin(r) / r
}
cat(paste("Processing seriell time: ", "\n", sep = "  "))
print(proc.time() - tmp.time)
#print(sample)

tmp.time <- proc.time()
sample <- foreach(i=seq(from=0, to=1000, by =1),.combine='c',.inorder=TRUE) 
%dopar%
{
        r <- sqrt(i^2 + i^2) + .Machine$double.eps  * factorial(i)
        sin(r) / r
}
cat(paste("Processing parallel time: ", "\n", sep = "  "))
print(proc.time() - tmp.time)
#print(sample)

closeCluster(skylla.cluster)
# mpi.close.Rslaves()
# mpi.exit()
mpi.quit(save='no‘) 

Any suggestions would be highly appreciated! Thanks!

Best

André

------------------------------------------------------
Dipl. Psych André Ziervogel
andre.ziervo...@psychol.uni-giessen.de
------------------------------------------------------

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to