Hi everyone!! This is my first message to the list, so I hope not to disturb anyone if the subject of my message has been already treated. The question is that I have a tool, a GUI made with Java, connected to R using Rserve, and I'd like to get R and Rserve in a multi-processor machine. Now, when I'm going to start the migration I wonder whether R is prepared, 'itself' to optimize the use of multiple processors or if I should change the code so that it could be a real multi-processor tool. In other words... Will the R code adapt itself to the new machine (Unix with al least 4 processors)? Or shall I change the code to have multiple real threads and transform the algorithms into parallel computing strategies? Thanks in advance, Aitor. --------------------------------- LLama Gratis a cualquier PC del Mundo. Llamadas a fijos y moviles desde 1 centimo por minuto. [[alternative HTML version deleted]]
On 10 Jan 2006, aitor_doctorado at yahoo.es wrote:> Hi everyone!! > > This is my first message to the list, so I hope not to disturb > anyone if the subject of my message has been already treated. > > The question is that I have a tool, a GUI made with Java, connected > to R using Rserve, and I'd like to get R and Rserve in a > multi-processor machine. Now, when I'm going to start the migration > I wonder whether R is prepared, 'itself' to optimize the use of > multiple processors or if I should change the code so that it could > be a real multi-processor tool. > > In other words... Will the R code adapt itself to the new machine > (Unix with al least 4 processors)? Or shall I change the code to > have multiple real threads and transform the algorithms into > parallel computing strategies?R is not multi-threaded and will not be able to automagically make use of a SMP machine. I'm pretty sure what you want to do is configure your app to launch 4 R instances and manage of queue of some sort. -- + seth
> Hi everyone!! > > This is my first message to the list, so I hope not to disturb > anyone if the subject of my message has been already treated. > > The question is that I have a tool, a GUI made with Java, connected > to R using Rserve, and I'd like to get R and Rserve in a > multi-processor machine. Now, when I'm going to start the migration > I wonder whether R is prepared, 'itself' to optimize the use of > multiple processors or if I should change the code so that it could > be a real multi-processor tool. > > In other words... Will the R code adapt itself to the new machine > (Unix with al least 4 processors)? Or shall I change the code to > have multiple real threads and transform the algorithms into > parallel computing strategies?R is not multi-threaded and will not be able to automagically make use of a SMP machine. I'm pretty sure what you want to do is configure your app to launch 4 R instances and manage of queue of some sort. ******* The problem is that I work with algorithms that use great amounts of data (files from 2 to 20 or 30 Mb) so, it will be great to divide the work of analyzing the data among all the processors.... Is that possible? Thanks again, Aitor. --------------------------------- LLama Gratis a cualquier PC del Mundo. Llamadas a fijos y moviles desde 1 centimo por minuto. [[alternative HTML version deleted]]
R is not thread safe, so you must not use it in a re-entrant way. If you want to exploit multiple processors, you can write code (e.g., in C) called from R (e.g., through .Call or .C) that performs parallel/threaded computations in a thread-safe way (e.g., without calling back into R). Another possibility is to replace the BLAS/LAPACK library with a thread-safe version. This provides a boost to those R algorithms exploiting these libraries. Haven't done this myself, but there is some info in this post https://stat.ethz.ch/pipermail/r-devel/2005-December/035695.html Hope that helps, Martin Aitor Mata Conde <aitor_doctorado at yahoo.es> writes:> Hi everyone!! > > This is my first message to the list, so I hope not to disturb anyone if the > subject of my message has been already treated. > > The question is that I have a tool, a GUI made with Java, connected to R > using Rserve, and I'd like to get R and Rserve in a multi-processor machine. > Now, when I'm going to start the migration I wonder whether R is prepared, > 'itself' to optimize the use of multiple processors or if I should change the > code so that it could be a real multi-processor tool. > > In other words... Will the R code adapt itself to the new machine (Unix with > al least 4 processors)? Or shall I change the code to have multiple real > threads and transform the algorithms into parallel computing strategies? > > Thanks in advance, > Aitor. > > > > --------------------------------- > > LLama Gratis a cualquier PC del Mundo. > Llamadas a fijos y moviles desde 1 centimo por minuto. > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html