[R-SIG-Mac] Re : Snow package on bi-proc G5

Naji nassar at noos.fr
Thu Jun 16 12:56:14 CEST 2005


I launched my simulations and found the both processors occupied at 100%
System 80%
User 20%
R 97.9% of one processor
"kerneltask" 50% of 2nd processor
"Open" task 50% of 2nd processor
-> R is the only user active application
I don't think system application can occupy fully one processor (for more
than 5 hours)..

Is TIGER dispatching the calculus? If yes, is it still worse using the
cluster approach? 


Best regards
Naji

Le 15/06/05 20:36, « Simon Urbanek » <simon.urbanek at r-project.org> a écrit :

> Naji,
> 
> On Jun 15, 2005, at 12:36 PM, Naji wrote:
> 
>> I'm running complex simulations and I'd like to distribute half the
>> simulation on each processor (one G5 machine)
>> The R code looks like
>> 
>> For (rep in 1:replications) # 300 replications
>> {
>> # the simulations results are stored in an array
>> Is it possible to distribute the simulations on both proc..?
> 
> Yes.
> 
> I use pvm as back-end for snow, but I guess others should work, too.
> Example (very simple and stupid but should illustrate the idea):
> 
>> library(snow)
> Loading required package: rpvm
>> cl<-makeCluster(2)  # use 2 CPUs
>> clusterApplyLB(cl,1:6,function(x) mean(x+rnorm(10)))
> [[1]]
> [1] 0.836866
> 
> [[2]]
> [1] 1.755120
> 
> [[3]]
> [1] 3.385007
> 
> [[4]]
> [1] 3.751311
> 
> [[5]]
> [1] 4.805047
> 
> [[6]]
> [1] 5.89379
> 
> When running simulations you may want to set the seed differently for
> each process [something like clusterApply(cl, 1:2, set.seed)] or use
> one of the RNG libraries, otherwise both CPUs will give you the same
> results - probably not what you want ;).
> 
> Cheers,
> Simon
>



More information about the R-SIG-Mac mailing list