[R] Snow Package and SPRNG: Will it solve my problem?

Luke Tierney luke at stat.uiowa.edu
Thu Mar 22 14:02:33 CET 2007


On Wed, 21 Mar 2007, robert.robinson at maine.edu wrote:

> Hello and thanks in advance for your time.  I currently have a
> simulation running on my cluster with the help of snow that relies on
> global variables being changes regularly  to random values.  It uses
> these values, lets call them x1 x2 and x3, in custom functions for
> logliklyhood and score that gets used in the standard optim function.
> To get set in the global table on the different nodes I'm generating
> the random value in a function on the node and then using the
> superassign operator ( <<- ) to set it to the global variable.
> (eg:
>    temp = rand(n1)
>    x1 <<- sort(temp)
> )
>
> ) I'm worried that this is creating a lot of avoidable message
> passing.  Here are my questions:
>
> Does the superassign operator set the global variable on the head
> node, like I believe it does, or rather does it only set it on the
> local global table?

There is not shared global environments eath node has its own separate
from the master's.

>
> Does the SPRNG package offer a viable replacement for useless message
> passing of random values like this?
>

rsprng and rlecuyer (the current default) address a different issue --
ensuring (reproducible if necessary) independent streams on the nodes.

Best,

luke

> Thanks again for your continued help with my problems.
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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.
>

-- 
Luke Tierney
Chair, Statistics and Actuarial Science
Ralph E. Wareham Professor of Mathematical Sciences
University of Iowa                  Phone:             319-335-3386
Department of Statistics and        Fax:               319-335-3017
    Actuarial Science
241 Schaeffer Hall                  email:      luke at stat.uiowa.edu
Iowa City, IA 52242                 WWW:  http://www.stat.uiowa.edu



More information about the R-help mailing list