If you have a job that takes relatively little ram and can benefit from faster hard drive IO, it may be helpful to create a ramdisk mount where temporary files can be stored. It has to be managed well as the temporary space will invariably not be super large, but it can be helpful in certain circumstances.
Using parallel-ssh as discussed in the previous post #3, we can very simply set this up
parallel-ssh -h hosts.txt -l root -i -A -t 120 mkdir /mnt/ramdisk
parallel-ssh -h hosts.txt -l root -i -A -t 120 mount -t tmpfs -o size=16g tmpfs /mnt/ramdisk
I have a bit of extra RAM, so I set them to be 16 gigs. This is a per-machine temp directory, so you need to make sure your different jobs won't trample each other.
Then in my R code, I do something like this to be robust to the existence of a ramdisk.
Then, somewhere towards the end of the sim (maybe in a try-catch finally area) I put an unlink(run_dir, recursive=TRUE) to get rid of temporary files before going to the next job.
If you have a job that takes relatively little ram and can benefit from faster hard drive IO, it may be helpful to create a ramdisk mount where temporary files can be stored. It has to be managed well as the temporary space will invariably not be super large, but it can be helpful in certain circumstances.
Using
parallel-ssh
as discussed in the previous post #3, we can very simply set this upI have a bit of extra RAM, so I set them to be 16 gigs. This is a per-machine temp directory, so you need to make sure your different jobs won't trample each other.
Then in my R code, I do something like this to be robust to the existence of a ramdisk.
Then, somewhere towards the end of the sim (maybe in a try-catch
finally
area) I put anunlink(run_dir, recursive=TRUE)
to get rid of temporary files before going to the next job.