# Random seed confusion

5 posts / 0 new
Random seed confusion
#1

I have seen several commands for Abinitio recently using the -constant_seed and -jran options.
Normally I dont use MPI for my jobs but instead submit, say, 100 jobs each producing 1000 decoys. Each job will run on a single processor.
Am I correct in thinking that it should not be necessary to specify these parameters?
cheers
D.

Post Situation:
Mon, 2012-11-12 09:45
pardave

"Normally I dont use MPI for my jobs but instead submit, say, 100 jobs each producing 1000 decoys. Each job will run on a single processor."

This is exactly the situation where -jran -constant_seed is most required. If you use MPI, the system automatically ensures all processors use different RNG seeds, so you get different trajectories on each processor. If you do NOT use MPI, then each processor independently queries the OS for something to use for an RNG seed, which (depending on your OS) may or may not be a different value for each processor that asks. Manual management of -jran -constant_seed lets you be positive, in an OS-independent fashion, that each trajectory does something different instead of repeating results.

Mon, 2012-11-12 09:48
smlewis

Note that in addition to/alternative to the -constant_seed and specifying a particular seed, you can also use the -run:seed_offset flag. This will make sure that different runs will have different seeds, but can allow you to easily set things up, if your clustering software has some auto-process-number-fill-in variable like CONDOR's \$(Process). Note that even if you're using time as a seed you're unlikely to experience conflicts, as the time value is multiplied by 1000 prior to adding the seed.

That said, if you're using Linux, MacOS X or other Unix-like operating system, you probably don't have to worry about manually setting the seed, as it pulls the seed value from /dev/urandom/ (actually the random character generating file-like object specified by -run:rng_seed_device, which defaults to /dev/urandom/), so there's a rather small chance you'll run into a collision. Though manually controlling the seed is easy enough to do if you want to.

Mon, 2012-11-12 11:21
rmoretti

I've definitely had problems on Linux supercomputer clusters with repeated results when I forgot to use -jran/-constant_seed. I guess it depends on the system...

Mon, 2012-11-12 14:53
smlewis

Thanks both for your reply. On our system (Linux cluster), I haven`t yet seen a problem with repeated results, so I will continue without constant seed/jran
D

Tue, 2012-11-13 03:26
pardave