[R] batch jobs question

Rolf Turner rolf at math.unb.ca
Tue Feb 8 23:03:44 CET 2005


> I'm doing some R batch jobs in Unix. 
> Something like
> R <prog1> output1 --save &
> R <prog2> output2 --save &
> 
> prog1 and prog2 are running at the same time and they are essentially
> same except it contains different parameter values.  I was wondering
> if two processes will affect each other? Hopefully they are two
> independent jobs.

If you are running these jobs in the same directory, then whichever
one finishes ***last*** will overwrite the workspace saved by the one
that finished first.  E.g. if there was nothing in .RData to start
with and prog1 creates an object `X'' and prog2 creates an object
``Y'', and prog2 finishes last, then .RData will have Y in it when
all is done, and will NOT have X in it.

You could either run the jobs in separate directories, or use save()
explicitly --- with separate filenames --- in the code in prog1 and
prog2 (rather than using the --save flag).

				cheers,

					Rolf Turner
					rolf at math.unb.ca




More information about the R-help mailing list