[Halld-offline] genr8 software request

David Lawrence davidl at jlab.org
Fri Dec 3 08:55:54 EST 2010


Hi Kei,

     I have just committed the change to genr8. It now has a command 
line option to explicitly set the random seed using -s<seed>. See the 
usage statement.

     If one does not explicitly set the seed, the current time is still 
used, but the current process ID is added to it. This should avoid the 
problem you noted of using the same seed when starting the program 
during the same second on the same machine.

     The change is in svn revision 7094. Please let me know if you have 
any problems with it.

Regards,
-David

On 12/2/10 4:45 PM, Kei Moriya wrote:
> Dear Offliners,
>
> I have been working on the Hall D simulation packages,
> and have encountered an issue with genr8, and was wondering
> if anybody could help me.
>
> The issue I encountered is that the seed used for the
> random generator in genr8 is the current time,
> so if the program is run consecutively within the same
> second, the generated result is exactly the same, and I end
> up with several copies of the same files.
>
> I think that the use of the current time should be avoided,
> not just because of the behavior above, but also because
> it becomes impossible to reproduce the same file at a later
> time if necessary.
>
> I think passing the seed in as another runtime parameter
> to genr8 would require only a few lines of extra code.
> Could somebody do this for me, or point me to how to update
> the program myself?
>
> Thanks in advance.
>
> 	Kei Moriya
> _______________________________________________
> Halld-offline mailing list
> Halld-offline at jlab.org
> https://mailman.jlab.org/mailman/listinfo/halld-offline


More information about the Halld-offline mailing list