[petsc-dev] use of random numbers in GAMG

Patrick Sanan patrick.sanan at gmail.com
Tue Aug 11 04:20:04 CDT 2015


On Sat, Aug 08, 2015 at 03:29:49PM -0500, Barry Smith wrote:
> 
>   Mark,
> 
>     So GAMG uses random numbers in the implementation, this means identical runs on machines with different random number generates can produce noticeable different convergence histories. This means that the "no change" tests in the nightly tests indicate change (i.e. a problem) when this perhaps not a problem. So it is impossible to trust the results of the tests.
> 
>    Is there anything we can do to alleviate this problem? Are the random number usage fundamental to the algorithm? Should we distribute with PETSc a "random number generator" that will generate the same results on all systems (if that is even possible?)?
I would add a +1 to adding a more-portable implementation of PetscRandom. I spent a day a couple of weeks ago tracking down a unit test failure which ultimately ended up being a similar situation - an algorithm which I didn't realize included a randomized component, which produced slightly different solver behavior because of a different implementation of rand() in the standard library on different machines. Such an implementation is of course wheel-reinvention in many ways, but then again the trend certainly seems to toward increased use of randomized algorithms, and it seems in line with PETSc's superlative portability to be able to run tests with confidence on arbitrary systems. 

What would this implementation look like? Presumably a well-known (and well-analyzed), simple to implement and verify, pseudo-random number generator with reasonable properties? Since PETSc can already interface to SPRNG, perhaps a practical approach here is to simple reimplement a simple method from that library, since this would allow for direct comparison.
> 
>   Thanks
> 
>   Barry
> 
> 
> Note that on the same machine if you run the same program twice with our default system provided "random number generator" you will get the same result, this is an issue with running on different kinds of machines and getting different results.
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20150811/9defb74a/attachment.sig>


More information about the petsc-dev mailing list