Amazon EC2

From Biowiki
Jump to: navigation, search

Amazon Elastic Compute Cloud (EC2)


Holmes lab AMIs:

The following construct can be used to seed the random number generator with a hostname-specific value (useful e.g. for running several parallel MCMC jobs):

handalign -rndseed `hostname | md5sum | perl -ne 's/ .*\n//;printf"ibase=16;%s%1000000\n",uc' | bc` ...

To add current-time-in-seconds to this random seed, use the following:

handalign -rndseed `hostname | md5sum | perl -ne 's/ .*\n//;printf"ibase=16;(%X+%s)%1000000\n",time,uc' | bc` ...

Finally, to add the process ID as well:

handalign -rndseed `hostname | md5sum | perl -ne 's/ .*\n//;printf"ibase=16;(%X+%X+%s)%1000000\n",time,$$,uc' | bc` ...

Note that the last one includes $ symbols, which must be escaped in a Makefile (i.e. $$$$ instead of $$).

(If on a Mac, use md5 instead of md5sum...)

-- Lars Barquist - 11 Mar 2009