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

robert.robinson at maine.edu robert.robinson at maine.edu
Wed Mar 21 21:55:20 CET 2007


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?

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

Thanks again for your continued help with my problems.



More information about the R-help mailing list