comp.lang.ada
 help / color / mirror / Atom feed
* OT: Amusing(!) bug
@ 2014-03-12 20:30 tmoran
  2014-03-12 20:55 ` Dmitry A. Kazakov
  0 siblings, 1 reply; 2+ messages in thread
From: tmoran @ 2014-03-12 20:30 UTC (permalink / raw)


Seen on a recent FAQ:

>Q: Why do all workers in my distributed MATLAB jobs (e.g.  Monte Carlo
>simulations) use the same sequence of random numbers?
>
>A: By default MATLAB initializes its random number generator at startup
>based on the system time.  Since all nodes in the cluster have
>synchronized clocks, if your job starts up simultaneously on multiple
>nodes those jobs will proceed through the same sequence of random numbers.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: OT: Amusing(!) bug
  2014-03-12 20:30 OT: Amusing(!) bug tmoran
@ 2014-03-12 20:55 ` Dmitry A. Kazakov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry A. Kazakov @ 2014-03-12 20:55 UTC (permalink / raw)


On Wed, 12 Mar 2014 20:30:30 +0000 (UTC), tmoran@acm.org wrote:

> Seen on a recent FAQ:
> 
>>Q: Why do all workers in my distributed MATLAB jobs (e.g.  Monte Carlo
>>simulations) use the same sequence of random numbers?
>>
>>A: By default MATLAB initializes its random number generator at startup
>>based on the system time.  Since all nodes in the cluster have
>>synchronized clocks, if your job starts up simultaneously on multiple
>>nodes those jobs will proceed through the same sequence of random numbers.

Hmm, the clocks must have extremely poor precision for this to happen.

Typically on an Intel board the clock resolution is around few nanoseconds.
Without special hardware one could synchronize clocks over the LAN, with
tight round trip times, down to microseconds. But clocks deviate at the
speed about 5 microseconds per second and must be resynchronized
periodically.

The explanation given, if true, means that they use the time services
brain-dead wrong.

However, I have a much simpler theory. The user probably runs his model in
the simulation time, which naturally starts at 0 in all nodes...

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-03-12 20:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-12 20:30 OT: Amusing(!) bug tmoran
2014-03-12 20:55 ` Dmitry A. Kazakov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox