Hello. Does anoby know if it's safe to run two instances of R (in R CMD BATCH mode) in the same directory ? If so, is it safe to run them on different computers (with access to the same filesystem via NFS) ? Thanks.
Albedo <albedo at pisem.net> writes:> Hello. > > Does anoby know if it's safe to run two instances of R > (in R CMD BATCH mode) in the same directory ? > > If so, is it safe to run them on different computers > (with access to the same filesystem via NFS) ?You have to worry about race conditions on file writes (e.g. running the *same* script twice could be asking for trouble if both processes want to write foo.Rout). Also watch out for seed issues when simulating, if both processes restore the same seed from a saved workspace, they'll be generating exactly the same sequence of random numbers, which may or may not be what you want. Apart from that you should be OK. -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
Albedo wrote:> Hello. > > Does anoby know if it's safe to run two instances of R > (in R CMD BATCH mode) in the same directory ? > > If so, is it safe to run them on different computers > (with access to the same filesystem via NFS) ?Yes, if you don't use the same files to write anything into ... Uwe Ligges
Albedo wrote:> Hello. > > Does anoby know if it's safe to run two instances of R > (in R CMD BATCH mode) in the same directory ? > > If so, is it safe to run them on different computers > (with access to the same filesystem via NFS) ? >"Is it safe?". Heh. Marathon Man was on TV last night... Depends on your definition of 'safe'. The processes will run quite happily, they will read whichever .RData they find by the usual search methods. However, if they come to _write_ a .RData, you should make sure they dont try to write to the same file, since if they do that at the same time bad things could happen, and if they do it sequentially then the first one will get overwritten by the last one. If you do "R CMD BATCH --no-save" then R won't try and save the .RData at the end, so if all your results are going to the output file then you dont need to save .RData and can use this option. Barry