Copying gsl_rng_state across MPI

S

stringy

Bonjour,
I have a program which has 'Objects' that move around in a 3d space,
partly according to the gsl random number generator. The 3d space is
split into two nodes which control the objects in it, with each space
being split into voxels. In the 'border' voxels, each node follows the
objects in them, and as such I need them to be generating the same
random number for the object in both nodes. As far as I am aware this
can be achieved by starting with the same gsl_rng state, and I'm trying
to send this across with MPI when one node becomes aware of an object
from the other node moving into the border voxels.

At present I belive this is achieved using

and I've implemented this like so:

Now I understand that this probably miles wrong, but C++ isn't my
mainstay, and as such I need any help I can get! If I sound very wide
of the mark with the above, a pointer in the right direction would be
appreciated.

Thanks.
 
P

Paul Schneider

stringy said:
Bonjour,
I have a program which has 'Objects' that move around in a 3d space,
partly according to the gsl random number generator. The 3d space is
split into two nodes which control the objects in it, with each space
being split into voxels. In the 'border' voxels, each node follows the
objects in them, and as such I need them to be generating the same
random number for the object in both nodes. As far as I am aware this
can be achieved by starting with the same gsl_rng state, and I'm trying
to send this across with MPI when one node becomes aware of an object
from the other node moving into the border voxels.

At present I belive this is achieved using




and I've implemented this like so:



and I've declared



Now I understand that this probably miles wrong, but C++ isn't my
mainstay, and as such I need any help I can get! If I sound very wide
of the mark with the above, a pointer in the right direction would be
appreciated.

Thanks.
The GSL is written in C and the MPI is implemented in C (and Fortran)
with C++ wrappers. I don't understand what question you are asking in
your posting and what it has to do with C++. If you are looking for
advice on numerical mathematics and how to work with clusters I suspect
you probably would get more help in sci.math.num-analysis. GSL also has
a mailing list of its own.

Best,

p
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,128
Latest member
ElwoodPhil
Top