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

Naji nassar at noos.fr
Mon Jun 20 03:41:48 CEST 2005


Hi all,

I finally succeeded installing PVM softwae, RPVM & Snow packages.
Simon example worked perfectly well

I'm encountering 2 problems
- a silly one (how to fix env. var on my machine OS Tiger)
    in order to run PVM (and snow) I need to declare the following
        export PVM_ARCH=darwin
        export PVM_ROOT=$HOME/pvm3
        export PVM_DPATH=$PVM_ROOT/lib/pvmd
        export PATH=$PATH:$PVM_ROOT/lib:$PVM_ROOT/lib/$PVM_ARCH
        export MANPATH=$PVM_ROOT/man
    In which file should I save these commands so the env. var are declared
automatically at login

- the second is adapting a loop for a Cluster (a replication eiher a loop or
a job for one proc)
    The loop code (working fine) & the cluster code giving the following
errors
> z # z is the results of the ClusterApply
[[1]]
[1] "Error in any(shape <= 0) : Object \"pdmabrd\" not found\n"
attr(,"class")
[1] "try-error"

The title array has been initialized


Thanks in advance for your help
Any comments regarding code optimization is highly welcome..

Best regards
Naji


Le 16/06/05 12:56, « Naji » <nassar at noos.fr> a écrit :

> 
> 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
>> 
> 
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: loop.pdf
Type: application/octet-stream
Size: 21621 bytes
Desc: not available
Url : https://stat.ethz.ch/pipermail/r-sig-mac/attachments/20050620/3c6ce0c2/loop-0001.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Clustercode.pdf
Type: application/octet-stream
Size: 23932 bytes
Desc: not available
Url : https://stat.ethz.ch/pipermail/r-sig-mac/attachments/20050620/3c6ce0c2/Clustercode-0001.obj


More information about the R-SIG-Mac mailing list