Post

2 followers Follow
0
Avatar

load Rmpi library from GUI failed while it's fine from CLI

Hi team,

I have the basic rmpi test script like below.

    library(Rmpi)

    mpi.spawn.Rslaves(nslaves=2)
    mpi.remote.exec(paste("I am",mpi.comm.rank(),"of",mpi.comm.size()-1))

I can run it from CLI: $ R CMD BATCH myrmpi.R mpi.out. it works all right.

But when I run this in RStudio GUI, it tells that loading Rmpi failed. I do have the PATH and LD_LIBRARY_PATH set in Rstudio env. see below messages copied from console of Rstudio GUI:

library(Rmpi)
Error : .onLoad failed in loadNamespace() for 'Rmpi', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/usr/local/lib/R/site-library/Rmpi/libs/Rmpi.so':
libmpi.so.1: cannot open shared object file: No such file or directory
Error: package or namespace load failed for ‘Rmpi’

mpi.spawn.Rslaves(nslaves=2)
Error: could not find function "mpi.spawn.Rslaves"
mpi.remote.exec(paste("I am",mpi.comm.rank(),"of",mpi.comm.size()-1))
Error: could not find function "mpi.remote.exec"
Sys.getenv("PATH")
[1] "/usr/local/cuda-6.5/bin:/usr/local/openmpi/bin:/opt/openlava/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/openlava-2.2/bin"
Sys.getenv("LD_LIBRARY_PATH")
[1] "/usr/local/openmpi/lib:/usr/local/cuda-6.5/lib64"

any comments?

thanks,
Feng

Feng Li

4 comments

0
Avatar

Rstudio version and R version:

rstudio-server version

0.98.1103

~# R

R version 3.1.3 (2015-03-09) -- "Smooth Sidewalk"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

Feng Li 0 votes
0
Avatar

A few more details might help...

Is the working directory the same in both cases?

Does .libPaths() produce identical output?

Does the file /usr/local/lib/R/site-library/Rmpi/libs/Rmpi.so exist?

Jonathan.

Jonathan McPherson 0 votes
0
Avatar

Rmpi.so file is there.
$ ls -l /usr/local/lib/R/site-library/Rmpi/libs/Rmpi.so
-rwxrwxr-x 1 root staff 134456 Mar 13 20:57 /usr/local/lib/R/site-library/Rmpi/libs/Rmpi.so

on GUI:

.libPaths()
[1] "/home/clusteradmin/R/x86_64-pc-linux-gnu-library/3.1" "/usr/local/lib/R/site-library"

[3] "/usr/lib/R/site-library" "/usr/lib/R/library"

library(Rmpi)
Error : .onLoad failed in loadNamespace() for 'Rmpi', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/usr/local/lib/R/site-library/Rmpi/libs/Rmpi.so':
libmpi.so.1: cannot open shared object file: No such file or directory
Error: package or namespace load failed for ‘Rmpi’

From CLI:

.libPaths()
[1] "/home/clusteradmin/R/x86_64-pc-linux-gnu-library/3.1"
[2] "/usr/local/lib/R/site-library"
[3] "/usr/lib/R/site-library"
[4] "/usr/lib/R/library"
library(Rmpi)

$ env | grep LD_
LD_LIBRARY_PATH=/usr/local/openmpi/lib:/usr/local/cuda-6.5/lib64:

Seems from CLI, I have this openmpi lib path and it works so library Rmpi can be loaded. but from GUI, even it's in the ENV, the loading still has issue...

Feng Li 0 votes
0
Avatar

update: This issue is found in Rstudio Console window. if start a shell window from Tools->shell, library(Rmpi) can be loaded successfully.

Seems the problem is in Rstudio Console.

Feng Li 0 votes