Segovia, Andrea
2016-Jan-18 18:51 UTC
[R] Installation of R Rmpi and snow on cluster running Platform MPI and PBS Pro
Hello,
I am new to R support. I am trying to install R on a compute cluster running
Platform MPI and PBS Pro.
I have installed R, Rmpi and snow - at first glance successfully.
When I try to run a simple Rmpi program, however, I get a Segmentation fault on
mpi send.?
The error messages reads as follows:
segoviaa at c01 Rmpi_examples]$ mpirun -e PATH=/export/opt/R-3.2.2/bin:$PATH
-hostfile myhostfile -np 8 R --no-save -q ?<
mpi_test2.r
*** caught segfault ***
ddress 0x78, cause 'memory not mapped'
raceback:
1: .Call("mpi_send", .force.type(x, type), as.integer(type),
as.integer(dest), ? ? as.integer(tag), as.integer(comm), P
CKAGE = "Rmpi")
2: mpi.send(x = scmd.arg, type = 4, dest = i, tag = 50000 + i, comm = comm)
3: mpi.bcast.cmd(.mpi.worker.exec, tag = tag, ret = ret, simplify = simplify, ?
? comm = comm)
4: mpi.remote.exec(mpi.get.processor.name(), comm = comm)
5: unlist(mpi.remote.exec(mpi.get.processor.name(), comm = comm))
6: slave.hostinfo(1)
borting ...
PI Application rank 0 killed before MPI_Finalize() with signal 11
The program I am running is:
[segoviaa at c01 Rmpi_examples]$ more Rmpi_test2.r
# The corresponding cluster of processes is already pre-constructed with mpirun.
# This where the main work happens
mpi.remote.exec(paste("Rank",mpi.comm.rank(),"on",Sys.info()[c("nodename")]))
# Shut down the cluster and clean up any remaining connections between machines.
mpi.close.Rslaves()
mpi.quit()
The Rprofile is located in the running directory, it is being run, and looks
like this:
# This R profile can be used when a cluster does not allow spawning or a job
# scheduler is required to launch any parallel jobs. Saving this file as
# .Rprofile in the working directory or root directory. For unix platform, run
# mpirun -n [cpu numbers] R --no-save -q
# Another way is to modify R_home_dir/bin/R by adding the following line after
# R_HOME_DIR
# R_PROFILE=${R_HOME_DIR}/library/Rmpi/Rprofile; export R_PROFILE
# For windows platform with mpich2, use mpiexec wrapper and specify a working
# directory where .Rprofile is inside.
# Cannot be used as Rprofile.site because it will not work
# If no CPU consumptions of slaves while waiting are desirable, change
# nonblocak=FALSE to nonblock=TRUE and change sleep time accordingly
# Following system libraries are not loaded automatically. So manual loads are
# needed.
#
library(utils)
library(stats)
library(datasets)
library(grDevices)
library(graphics)
library(methods)
#Change to TRUE if you don't want any slave host info
quiet=FALSE
if (!invisible(library(Rmpi,logical.return = TRUE))){
? ? warning("Rmpi cannot be loaded")
? ? q(save = "no")
}
options(error=quote(assign(".mpi.err", FALSE, envir = .GlobalEnv)))
if (mpi.comm.size(0) > 1)
? ? invisible(mpi.comm.dup(0,1))
if (mpi.comm.rank(0) >0){
? ? #sys.load.image(".RData",TRUE)
? ? options(echo=FALSE)
? ? .comm <- 1
? ? mpi.barrier(0)
? ? repeat
? ? ? ? ? ? ? ? try(eval(mpi.bcast.cmd(rank=0,comm=.comm, nonblock=FALSE,
sleep=0.1)),TRUE)
? ? ? ? if (is.loaded("mpi_comm_disconnect"))
? ? ? ? mpi.comm.disconnect(.comm)
? ? else mpi.comm.free(.comm)
? ? mpi.quit()
}
if (mpi.comm.rank(0)==0) {
? ? #options(echo=TRUE)
? ? mpi.barrier(0)
? ? if(mpi.comm.size(0) > 1 && !quiet)
? ? ? ? slave.hostinfo(1)
}
.Last <- function(){
? ? if (is.loaded("mpi_initialize")){
? ? ? ? if (mpi.comm.size(1) > 1){
? ? ? ? ? ? print("Please use mpi.close.Rslaves() to close slaves")
? ? ? ? ? ? mpi.close.Rslaves(comm=1)
? ? ? ? }
? ? }
? ? print("Please use mpi.quit() to quit R")
? ? mpi.quit()
}
I am not certain that the R installation was successful, either. I installed R
as follows:
./configure --prefix=/export/opt/R-3.2.2
make
make check
make install
make install-pdf
make install-tests
I installed Rmpi as follows:
[root at c01 R-3.2.2]# R CMD INSTALL Rmpi_0.6-5.tar.gz
"--configure-args=--with-Rmpi-include=/export/opt/platform_mpi/include/
--with-Rmpi-libpath=/export/opt/platform_mpi/lib/linux_amd64/
--with-Rmpi-type=OPENMPI"
I installed snow as follows:
[root at c01 R-3.2.2]# R CMD INSTALL snow -l /export/opt/R-3.2.2
* installing *source* package 'snow' ...
** package 'snow' successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (snow)
Any suggestions would be greatly appreciated.
Thank you,
Andrea
Andrea Segovia - Team Lead, HPC Services
Science Portfolio/Portfolio de la Science
Shared Services Canada/Services partag?s Canada