Thanks, Dirk, for the message. I did wrap the instance of RInside within an MPI aware program to let MPI handle passing the copies to all the nodes. The error I have found so far is that I didn't pass the R reference correctly, and that causes the huge output of the warning messages. I have corrected it in the test code and the warning message has gone. now I am testing it in the MPI setting..
On Mon, Feb 13, 2012 at 2:13 PM, Dirk Eddelbuettel <[email protected]> wrote: > > On 13 February 2012 at 13:38, Haiying Pang wrote: > | Darren, > | > | I did create the R instance in main(), and pass the reference to another > | function. I do have 1000 CPUs calling that function, but as they don't > create > | new R reference, how come there are so many warning messages? > | > | After reading your message in another thread of yours, I realize that the > | troublesome part might be that the R reference is passed to a function > that > | many other CPUs call. what should I do to fix it? if I let each cpu > creates its > | own instance of R, will that end up with more warning messages? > > Now we're talking. Thanks for actually sharing your problem in proper > terms. > > In short, you can't do that. > > R is single threaded, and you have to make sure that only thread calls back > to R. If you have a suitable problem, you can do what is shown in the mpi/ > example directory: wrap RInside inside on an MPI aware program. That way > MPI > takes care of getting your program to the nodes, and each node gets its own > copy. Naturally, this means that you cannot just work on one large chunk > of > data. You need to think your problem through, and maybe RInside is simply > not part of the solution --- it does make any R restrictions (such as > single > threadedness) go away. > > Dirk > > > | On Sat, Feb 11, 2012 at 8:34 PM, Darren Cook <[email protected]> wrote: > | > | > I am calling a R function through Rcpp and RInside in my c++ > program > | > in Linux. There are a lot of warning messages saying "no graphics > | > system to unregister" ...Is there anyone who knows the reason and > how > | > to avoid the printing of such warning messages? > | > | Generally, once you track down the line causing the problem, > | suppressWarnings() (an R function) might help. Or > | suppressPackageStartupMessages() or suppressMessages() may help. > | > | For the cause, are you running on a machine with no GUI or X server? > | > | However, a google suggests this is a message related to shutting > down R, > | and implies your script has corrupted something. There appears to be > no > | fix as they, like Dirk, insisted on a reproducible example. > | > | I'm wondering why you would be starting up and shutting down R so > many > | times in your script. Do you create one RInside instance, either as a > | global, or in main() and then pass it around by reference? Or are you > | create RInside instances inside other functions, or inside loop > bodies? > | If the latter, can you refactor to do the former so you only have one > | instance? > | > | HTH, > | Darren > | > | > | -- > | Darren Cook, Software Researcher/Developer > | > | http://dcook.org/work/ (About me and my work) > | http://dcook.org/blogs.html (My blogs and articles) > | _______________________________________________ > | Rcpp-devel mailing list > | [email protected] > | > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel > | > | > | > | > | -- > | Haiying Pang > | > | ---------------------------------------------------------------------- > | _______________________________________________ > | Rcpp-devel mailing list > | [email protected] > | https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel > -- > "Outside of a dog, a book is a man's best friend. Inside of a dog, it is > too > dark to read." -- Groucho Marx > -- Haiying Pang
_______________________________________________ Rcpp-devel mailing list [email protected] https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
