Dear R People: I'm having some trouble with mpiexec and Rmpi. I would like to be able to pass in the number of "children" via the mpiexec command (from the command line). this is in SUSE10.1, with R-2.7.1 Here are my files: cat eb.R library(Rmpi) mpi.remote.exec(paste("i am",mpi.comm.rank(),"of",mpi.comm.size())) mpi.quit() hodgesse at erinstoy:~/Desktop/R-2.7.1/bin> cat e.in source("eb.R") hodgesse at erinstoy:~/Desktop/R-2.7.1/bin> mpiexec -n 3 ./R --no-save -q -f e.in >e.out Error in mpi.remote.exec(paste("i am", mpi.comm.rank(), "of", mpi.comm.size())) : It seems no slaves running. Calls: source -> eval.with.vis -> eval.with.vis -> mpi.remote.exec Error in mpi.remote.exec(paste("i am", mpi.comm.rank(), "of", mpi.comm.size())) : It seems no slaves running. Calls: source -> eval.with.vis -> eval.with.vis -> mpi.remote.exec Error in mpi.remote.exec(paste("i am", mpi.comm.rank(), "of", mpi.comm.size())) : It seems no slaves running. Calls: source -> eval.with.vis -> eval.with.vis -> mpi.remote.exec hodgesse at erinstoy:~/Desktop/R-2.7.1/bin> Does anyone have any suggestions, please? The scary part: I can get this to work on Windows but not on SUSE10.1 thanks in advance, Sincerely, Erin Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown mailto: erinm.hodgess at gmail.com
Hi Erin -- "Erin Hodgess" <erinm.hodgess at gmail.com> writes:> Dear R People: > > I'm having some trouble with mpiexec and Rmpi. > > I would like to be able to pass in the number of "children" via the > mpiexec command (from the command line). > > this is in SUSE10.1, with R-2.7.1 > > Here are my files: > cat eb.R > library(Rmpi) > mpi.remote.exec(paste("i am",mpi.comm.rank(),"of",mpi.comm.size())) > mpi.quit() > hodgesse at erinstoy:~/Desktop/R-2.7.1/bin> cat e.in > source("eb.R") > > hodgesse at erinstoy:~/Desktop/R-2.7.1/bin> mpiexec -n 3 ./R --no-save -q > -f e.in >e.outWith a hostfile <<hostfile>> localhost slots=4 You can start 1 process and have access to a defined universe <<batch0.R>> library(Rmpi) mpi.universe.size() mpi.spawn.Rslaves() unlist(mpi.remote.exec(paste(mpi.comm.rank()))) mpi.quit() mtmorgan at lamprey:~/tmp> mpirun -np 1 --hostfile hostfile R --slave -f batch0.R [1] 4 4 slaves are spawned successfully. 0 failed. master (rank 0, comm 1) of size 5 is running on: lamprey slave1 (rank 1, comm 1) of size 5 is running on: lamprey slave2 (rank 2, comm 1) of size 5 is running on: lamprey slave3 (rank 3, comm 1) of size 5 is running on: lamprey slave4 (rank 4, comm 1) of size 5 is running on: lamprey slave1 slave2 slave3 slave4 "1" "2" "3" "4" A different style of programming (single program multiple data) is <<batch1.R>> ## everybody does this... library("Rmpi") id <- mpi.comm.rank(0) ## different data! allIds <- mpi.gather.Robj(id, 0, 0) ## rank 0 does this... if (mpi.comm.rank(0) == 0) print(allIds) ## everybody does this... mpi.quit() mtmorgan at lamprey:~/tmp> mpirun -np 10 R --slave -f batch1.R [1] 0 1 2 3 4 5 6 7 8 9 Note the '0' argument for comm, overriding 1 (the default; a more robust program would manage the communicators better). mtmorgan at lamprey:~/tmp> mpirun --version mpirun (Open MPI) 1.2 Martin> Error in mpi.remote.exec(paste("i am", mpi.comm.rank(), "of", > mpi.comm.size())) : > It seems no slaves running. > Calls: source -> eval.with.vis -> eval.with.vis -> mpi.remote.exec > Error in mpi.remote.exec(paste("i am", mpi.comm.rank(), "of", > mpi.comm.size())) : > It seems no slaves running. > Calls: source -> eval.with.vis -> eval.with.vis -> mpi.remote.exec > Error in mpi.remote.exec(paste("i am", mpi.comm.rank(), "of", > mpi.comm.size())) : > It seems no slaves running. > Calls: source -> eval.with.vis -> eval.with.vis -> mpi.remote.exec > hodgesse at erinstoy:~/Desktop/R-2.7.1/bin> > > Does anyone have any suggestions, please? The scary part: I can get > this to work on Windows but not on SUSE10.1 > > thanks in advance, > Sincerely, > Erin > > > Erin Hodgess > Associate Professor > Department of Computer and Mathematical Sciences > University of Houston - Downtown > mailto: erinm.hodgess at gmail.com > > ______________________________________________ > R-help at 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.-- Martin Morgan Computational Biology / Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109 Location: Arnold Building M2 B169 Phone: (206) 667-2793
On 1 July 2008 at 14:03, Erin Hodgess wrote: | I'm having some trouble with mpiexec and Rmpi. | | I would like to be able to pass in the number of "children" via the mpiexec | command (from the command line). | | this is in SUSE10.1, with R-2.7.1 | | Here are my files: cat eb.R library(Rmpi) mpi.remote.exec(paste("i | am",mpi.comm.rank(),"of",mpi.comm.size())) mpi.quit() | hodgesse at erinstoy:~/Desktop/R-2.7.1/bin> cat e.in source("eb.R") | | hodgesse at erinstoy:~/Desktop/R-2.7.1/bin> mpiexec -n 3 ./R --no-save -q -f | e.in >e.out Error in mpi.remote.exec(paste("i am", mpi.comm.rank(), "of", | mpi.comm.size())) : It seems no slaves running. Calls: source -> | eval.with.vis -> eval.with.vis -> mpi.remote.exec Error in | mpi.remote.exec(paste("i am", mpi.comm.rank(), "of", mpi.comm.size())) : It | seems no slaves running. Calls: source -> eval.with.vis -> eval.with.vis | -> mpi.remote.exec Error in mpi.remote.exec(paste("i am", mpi.comm.rank(), | "of", mpi.comm.size())) : It seems no slaves running. Calls: source -> | eval.with.vis -> eval.with.vis -> mpi.remote.exec | hodgesse at erinstoy:~/Desktop/R-2.7.1/bin> | | Does anyone have any suggestions, please? The scary part: I can get this | to work on Windows but not on SUSE10.1 Things do differ slightly between MPI imnplementations -- but I have no difficulties with Open MPI on Debian and Ubuntu. Open MPI is the successor to LAM, it also renamed mpirun etc to orterun [ where orte stands for Open Run Time Environment, as I recall ]. Anyway, using a one-line littler invocation works for me; edd at ron:~$ orterun -n 2 -H ron,joe r -lRmpi -e'cat("Hello", mpi.comm.rank(0), "of", mpi.comm.size(), "on", mpi.get.processor.name(), "\n")' Hello 0 of 0 on ron Hello 1 of 0 on joe edd at ron:~$ Here 'r' is littler; it uses the -l flag to load the specified library and the -e flag to pass the string for evaluation. 'ron' is a Debian testing box, 'joe' is an Ubuntu hardy box, and both are running the standard packages for Debian and Ubuntu: r-cran-rmpi for Rmpi libopenmpi1 for Open MPI littler for 'r' I happen to maintain all of those in Debian and noticed that Open MPI was broken in Ubuntu 'hardy' as they foobared the build; but that is now fixed. Ubuntu users should get an updated package via hardy-updates. As for your problem, you haven't told us which MPI toolkit you are running. It may be LAM in which case you probably want to read up on lamboot and the hosts file or argument -- but that is just a guess. Hope this helps, Dirk -- Three out of two people have difficulties with fractions.
Reasonably Related Threads
- cannot load pbdMPI package after compilation
- Running R embedded in an mpiexec spawned process - Fatal error: you must specify '--save', '--no-save' or '--vanilla'
- 001: RELIABILITY FIX: March 15, 2013
- Multicore computation in Windows network: How to set up Rmpi
- Libvirt mpiexec networking issue