[R] Is there plan to make R multithread?

ripley@stats.ox.ac.uk ripley at stats.ox.ac.uk
Tue Dec 3 10:08:39 CET 2002


Tony and Dirk have answered the question in the subject.  However, making
R multithreaded will not of itself make it run faster on a dual CPU
machine, the rather different question in the body of the message.
That would happen for most uses of R only if the inner computations were
able to make use of multiple threads and processors.  That means either
reprogramming them yourself (Tony's answer) or using different versions of
e.g. the linear algebra routines.   We do hope in due course to allow
multi-threaded BLAS routines, but there are problems at present (see the
R-admin.texi manual).

I use a dual-CPU machine all the time (I am writing this on one).  My
experience is that few programs run faster because of two CPUs (you need
many more to make multi-processing really worthwhile), but doing several
things at once is beneficial.  E.g,, there is a background R job running
now that has been running for a couple of days and unlike single-CPU
machines I notice no difference in response to the keyboard.

On Mon, 2 Dec 2002, Dirk Eddelbuettel wrote:

> On Mon, Dec 02, 2002 at 04:21:56PM -0800, A.J. Rossini wrote:
> > >>>>> "mingliz" == mingliz  <mingliz at surfbest.net> writes:
> >
> >     mingliz> Hello R Pioneers, I sometimes use R on a dual CPU PC
> >     mingliz> runing Linux and find that only 1 CPU is used even when
> >     mingliz> no other user/process competes for resources.  Can we
> >     mingliz> make R uses both CPUs to have the job done sooner?  I
> >     mingliz> know this is probably asking too much for something that
> >     mingliz> is free.  Has anyone else thought about it?  Thanks.
> >     mingliz> Ming Chow
> >
> > Search the mailing list for past discussions on this topic.  The short
> > answer is no you can't do it.  The long answer is yes, you can do it
> > with a bit of programming (using PVM/MPI and SNOW).
>
> Also see http://developer.r-project.org and e.g. the bullet point
>
> #  Luke's notes on threading, GUI, and asynchronous IO issues. Some of the
> reference links are messed up; the full references are in the BibTeX file.
> Duncan also has a set of notes on threading.
>
> with its links.

and that is aimed more at running several R tasks `at once' in a single
session.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list