<div dir="ltr">why not use this interface for gsl to sprng?<div><br></div><div><font color="black" face="Arial"><span style="font-size:10pt" dir="ltr"><a href="http://darrenjw.wordpress.com/2010/12/14/getting-started-with-parallel-mcmc/">http://darrenjw.wordpress.com/2010/12/14/getting-started-with-parallel-mcmc/</a></span></font><br>
</div><div><font color="black" face="Arial"><span style="font-size:10pt" dir="ltr"><br></span></font></div><div><font face="Arial"><span dir="ltr"><font color="#000000">this will give you a </font><font color="#000000">proper</font><font color="#000000"> parallel random distribution</font></span></font></div>
<div><font face="Arial"><span dir="ltr"><font color="#000000">i used it in a parallel spde code to generate the random forcing term in parallel.</font></span></font></div><div><font face="Arial"><span dir="ltr"><font color="#000000"><br>
</font></span></font></div><div><font face="Arial"><span dir="ltr"><font color="#000000">cheers</font></span></font></div><div><font color="#000000" face="Arial">Thomas</font></div></div><div class="gmail_extra"><br><br>
<div class="gmail_quote">
On Wed, Oct 16, 2013 at 12:43 AM, Wolfgang Bangerth <span dir="ltr"><<a href="mailto:bangerth@math.tamu.edu" target="_blank">bangerth@math.tamu.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Good question. I did a few tests on Stampede and it looks like it will<br>
scale reasonably well. If we assume 1e9 particles with id+XYZ (4 doubles =<br>
32 bytes) per particle, we need to broadcast ~30 GB from the root process<br>
in many small packages.<br>
</blockquote>
<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
[...]<div class="im"><br>
<br>
Each of these is the average of 100 broadcasts. At the kind of transfer<br>
rates we see above, sending 30GB of particle data would take a minute or<br>
two, which would occur once during initialization. This can be improved<br>
further by intelligently sending particles only to processes that have a<br>
chance of containing them (track bounding boxes at the root process). And<br>
transmission likely won't be the slowest part, but rather determining if a<br>
particle is in a particular cell, which has to occur no matter what method<br>
we use.<br>
<br>
I'll look in the literature to see if there's a better way of doing this<br>
sort of thing but this seems reasonable from what I can tell.<br>
</div></blockquote>
<br>
How about this:<br>
<br>
Every processor has a fraction 0<=V_i<=1 of the total probability, so that<br>
sum_i V_i = 1<br>
and V_i is the integral over the local subdomain. Let's do an all-to-all on these. Then, each processor draws N numbers between zero and one from a random number generator that is initialized in exactly the same way (easy to do with the RNGs from BOOST). For one of these numbers x_k, if<br>
sum_{i=0}^{subdomain_id-1} V_i <= x_k <= sum_{i=0}^{subdomain} V_i<br>
then we need to generate a particle locally. Otherwise, we simply draw the next number x_k. This ensures an accurate total number of particles, and it randomly distributes where they are located across the subdomains. If we do need to create a particle on the current processor, then we do the same process on the current processor to find out which cell and where inside the cell to create the particle.<br>
<br>
I think this way you get around the communication and you get the same statistical properties.<br>
<br>
Best<div class="im HOEnZb"><br>
W.<br>
<br>
<br>
-- <br>
------------------------------<u></u>------------------------------<u></u>------------<br>
Wolfgang Bangerth email: <a href="mailto:bangerth@math.tamu.edu" target="_blank">bangerth@math.tamu.edu</a><br>
www: <a href="http://www.math.tamu.edu/~bangerth/" target="_blank">http://www.math.tamu.edu/~<u></u>bangerth/</a><br>
<br></div><div class="HOEnZb"><div class="h5">
______________________________<u></u>_________________<br>
Aspect-devel mailing list<br>
<a href="mailto:Aspect-devel@geodynamics.org" target="_blank">Aspect-devel@geodynamics.org</a><br>
<a href="http://geodynamics.org/cgi-bin/mailman/listinfo/aspect-devel" target="_blank">http://geodynamics.org/cgi-<u></u>bin/mailman/listinfo/aspect-<u></u>devel</a><br>
</div></div></blockquote></div><br></div>