[Gate-users] problem with gjs random seeds

Jon Moody jbmoody at umich.edu
Thu Oct 28 15:39:53 CEST 2010


Dear Gate-users:

I've found a problem with the way the gjs jobsplitter generates random
seeds for the split macro files on my 32-bit hardware.  It generates
seeds as unsigned long integers before writing them to the split macro
files, but when executing the split macros the GateRandomEngine uses a
call to atoi() to convert the seeds from string to int.  If a generated
seed happens to be greater than INT_MAX then it is out of range and
atoi() returns INT_MAX.  For a cluster of 24 nodes, almost half the
seeds were equal to INT_MAX.

A small patch is attached that addresses this by generating seeds modulo
LONG_MAX (also ensuring that the seeds are all unique).  I also added a
missing call to IgnoreRandomEngineCommand() for processing sub-macros.
--
Jon


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: jobsplitter.patch
URL: <http://lists.opengatecollaboration.org/mailman/private/gate-users/attachments/20101028/b2eb260c/attachment.asc>


More information about the Gate-users mailing list