[petsc-users] SPRNG package

Barry Smith bsmith at mcs.anl.gov
Fri Dec 11 13:32:15 CST 2015


  To answer your question

   If you look in config/BuildSystem/config/packages/sprng.py  you'll see

    cflags += ' ' + '-DSPRNG_MPI' # either using MPI or MPIUNI

so it looks like --download-sprng does install the MPI version of sprng that you should be able to use the parallel sprng functionality from your code.

   Barry



> On Dec 11, 2015, at 10:47 AM, Gideon Simpson <gideon.simpson at gmail.com> wrote:
> 
> Ok, but if I look at 
> 
> http://www.mcs.anl.gov/petsc/petsc-dev/src/sys/classes/random/impls/sprng/sprng.c
> 
> there is a comment:
> 
>    This is NOT currently using a parallel random number generator. Sprng does have
>    an MPI version we should investigate.
> 
> 
> 
> -gideon
> 
>> On Dec 11, 2015, at 11:30 AM, Hong <hzhang at mcs.anl.gov> wrote:
>> 
>> Gideon:
>> I was looking at the source files and noticed in the comments that when petsc is built with sprng, the petsc interface isn’t to the parallel sprng RNG.  But is the package built with MPI, so that I could manually use the parallel RNG?
>> Petsc- sprng-1.0 interface was written many years ago. 
>> It is for parallel computation. Students contributed an example at
>> petsc/src/sys/classes/random/examples/tutorials/ex2.c
>> 
>> Very few users have ever used this interface.
>> If you encounter any problem, please report to us.
>> 
>> Hong
>> 
> 



More information about the petsc-users mailing list