<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Aug 27, 2015 at 5:35 PM, Jed Brown <span dir="ltr"><<a href="mailto:jed@jedbrown.org" target="_blank">jed@jedbrown.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Barry Smith <<a href="mailto:bsmith@mcs.anl.gov">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>
</span>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>
</blockquote></div><br>I will make them local to the object, and we will all be fine then.</div><div class="gmail_extra"><br></div><div class="gmail_extra">   Matt<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>