[R] increase the usage of CPU and Memory

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Jun 26 09:25:07 CEST 2012


See the vignette for package 'parallel' to make use of your 4 cores.

On 26/06/2012 01:07, Xi wrote:
> Dear All,
>
> I have been searching online for help increasing my R code more efficiently
> for almost a whole day, however, there is no solution to my case. So if
> anyone could give any clue to solve my problem, I would be very appreciate
> for you help. Thanks in advance.
>
> Here is my issue:
>
> My desktop is with i7-950 Quad-core CPU with 24Gb memory, and a  NVIDIA GTX
> 480  graphic card, and I am using a 64-bit version of R under 64-bit Windows
> .
>
> I am running a "for" loop to generate a 461*5 matrix data, which is coming
> from the coefficients of 5 models. The loop would produce 5 values one
> time, and it will run 461 times in total. I have tried to run the code
> inside the loop just once, it will cost almost 10 seconds, so if
> we intuitively calculate the time of the whole loop will cost, it would be
> 4610 seconds, equal to almost one and a half hours, which is exactly the
> whole loop taking indeed. But I have to run this kinda loop for
> 30 data-sets!
>
> Although I thought I am using a not-bad at all desktop, I checked the usage
> of CPU and memory during my running R code, and found out the whole code
> just used 15% of CPU and 10% of memory. Does anyone have the same issue
> with me? or Does anyone know some methods to shorten the running time and
> increase the usage of CPU and memory?
>
> Many thanks,
> Xi
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> 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.
>


-- 
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 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list