Skip to content
Prev 244586 / 398502 Next

Could concurrent R sessions mix up variables?

On 10/12/2010 1:13 PM, Anthony Damico wrote:
If you are running something that takes 18 hours to complete, a common 
practice is to save intermediate results to disk occasionally.  Have you 
(or whoever wrote the simulation) done this and forgotten about it?  If 
all 4 processes are saving to the same place, then reading results back, 
you'd see something like you describe.

If all calculations are held in memory, you shouldn't.

A simple approach that might debug this is to create a new variables 
initX, set equal to X.  Then sprinkle statements

stopifnot(X == initX)

through your simulation code.  That should quit when the change happens, 
and you can try to figure out why it happened.

Duncan Murdoch