[R] Powerful PC to run R

Henrik Bengtsson hb at biostat.ucsf.edu
Sun May 15 21:20:43 CEST 2011


On Sun, May 15, 2011 at 9:31 AM, Spencer Graves
<spencer.graves at structuremonitoring.com> wrote:
> Also:  A previous post in this tread suggested "Rprof" [sec. 3.2 in "Writing
> R Extensions", available via help.start()]. This should identify the
> functions that consume the most time.  The standard procedure to improve
> speed is as follows:
>
>
>      1.  Experiment with different ways of computing the same thing in R.
>  In many cases, this can help you reduce the compute time by a factor of 10
> or even 1,000 or more.  Try this, perhaps using proc.time and system.time
> with portions of your code, the rerun Rprof.

I second this one; if you have things running for weeks, and you
haven't done any serious optimization already, you most likely can
bring that down to days or hours by investigating where the
bottlenecks are.  Here is a good illustration how a simple piece of R
code is made 12,000 times faster:

  http://rwiki.sciviews.org/doku.php?id=tips:programming:code_optim2

>
>
>      2.  After you feel you have done the best you can with R, you might try
> coding the most compute intensive portion of the algorithm in a compiled
> language like C, C++ or Fortran.  Then rerun Rprof, etc.
>
>
>      3.  After trying (or not) compiled code, it may be appropriate to
> consider "CRAN Task View: High-Performance and Parallel Computing with R".
>  (From a CRAN mirror, select "Task Views" -> "HighPerformanceComputing:
>  High-Performance and Parallel Computing with R".)  You may also want to try
> the "foreach" package from Revolution Computing (revolutionanalytics.com).
>  These capabilities can help you get the most out of a multi-core computer.
>  NOTE:  While your code is running, you can check the "Performance" tab in
> Windows Task Manager to see what percent of your CPUs and physical memory
> you are using.  I mention this, because without "foreach" you might get at
> most 1 of your 4 CPUs running R.  With "foreach", you might be able to get
> all of them working for you.  Then after you have done this and satisfied
> yourself that you've done the best you can with all of this, I suggest you
> try the Amazon Cloud.
>
>
>      If you have not already solved your problem with this and have not yet
> tried these three steps, I suggest you try this.  It may take more of your
> time, but you will likely learn much that will help you in the future as
> well as help you make a better choice of a new computer if you ultimately
> decide to do that.
>
>
>      Hope this helps.
>      Spencer
>
>
> On 5/15/2011 8:28 AM, Gabor Grothendieck wrote:
>>
>> On Fri, May 13, 2011 at 6:38 AM, Michael Haenlein
>> <haenlein at escpeurope.eu>  wrote:
>>>
>>> I'm currently running R on my laptop -- a Lenovo Thinkpad X201 (Intel
>>> Core
>>> i7 CPU, M620, 2.67 Ghz, 8 GB RAM). The problem is that some of my
>>> calculations run for several days sometimes even weeks (mainly
>>> simulations
>>> over a large parameter space). Depending on the external conditions, my
>>> laptop sometimes shuts down due to overheating.
>>
>> If you are on Windows press the Windows key and type in Power Options.
>>  When the associated dialog pops up choose Power Saver.  Now your PC
>> will use less power so it won't heat up so much although your
>> performance could suffer a bit.
>>
>> Also ensure that there is sufficient air circulation around the machine.

To move this hardware-specific discussion off the R-help list, I
strongly recommend the 'Thinkpad.com Support Community' (open
community/non-Lenovo) with lots of experts and users:

  http://forum.thinkpads.com/

I've seen discussions on overheating/emergency shutdowns there.

/Henrik

>
>
> --
> Spencer Graves, PE, PhD
> President and Chief Operating Officer
> Structure Inspection and Monitoring, Inc.
> 751 Emerson Ct.
> San José, CA 95126
> ph:  408-655-4567
>
> ______________________________________________
> 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.
>



More information about the R-help mailing list