<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Aug 28, 2015 at 6:02 AM, Mark Adams <span dir="ltr"><<a href="mailto:mfadams@lbl.gov" target="_blank">mfadams@lbl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Is there a good way to get a deterministic rand wrt number of processors?  Seeding rand for each entry, with its global ID would work I assume.  <div><br></div><div>If drand48 is just one line then why not just copy it tweak it as desired?</div></div></blockquote><div><br></div><div>I did. Its in next.</div><div><br></div><div>  Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Cheby is otherwise deterministic, with a deterministic PC, and we have equation numbers to make this work. Eigen estimates are a real pain and the source of a lot of time consuming AMG errors.  It would be nice to have it not depend in any way on processor count.</div></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 27, 2015 at 10:12 PM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span><br>
> On Aug 27, 2015, at 5:35 PM, Jed Brown <<a href="mailto:jed@jedbrown.org" target="_blank">jed@jedbrown.org</a>> wrote:<br>
><br>
> Barry Smith <<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>> writes:<br>
>>   This is the default behavior if one just creates a PetscRandom and uses it, so don't be going and setting seeds inside GAMG or Chebyshev.<br>
><br>
<br>
</span>   Yikes, you are right all three of our current random number generators have global state! What a mess. We should remove all them completely and we can complement Matt's by adding in a more modern version of Sprng that does not use global state. (Stupid Sprng fucks changed to C++)<br>
<span><font color="#888888"><br>
   Barry<br>
</font></span><div><div><br>
> You're right (my mistake), but the consequences are dangerous if the<br>
> user is holding a PetscRandom across calls to GAMG (or anything that<br>
> creates new PetscRandom instances).  The reason is that merely creating<br>
> a PetscRandom reseeds the global PRNG.  (What moron thought a global<br>
> seed was a good idea?)  Seems to me we should avoid drand48 always so we<br>
> don't disrupt the user's source of randomness (leading to really<br>
> confusing incorrect results).  We could use the non-disastrous<br>
> drand48_r, but it's a GNU extension so we'd need an alternative anyway.<br>
><br>
> If Matt changes "rander48" to the rand48_r (or erand48_r) interface,<br>
> then we'd be okay.  This would also remove the internal variables that<br>
> Matt forget to make static.<br>
<br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div>
</div></div>