Re: Copying gsl_rng_state across MPI
stringy wrote:[color=blue]
> 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
>
>[color=green][color=darkred]
>>>>>>void * gsl_rng_state (const gsl_rng * r)[/color][/color]
>
>
> and I've implemented this like so:
>
>[color=green][color=darkred]
>>>>>>state = gsl_rng_state(rng);[/color][/color]
>
> where
>[color=green][color=darkred]
>>>>>>rng = gsl_rng_alloc (gsl_rng_taus); // this worked in a previous version[/color][/color]
>
> and I've declared
>[color=green][color=darkred]
>>>>>>void * state(const gsl_rng * r);
>>>>>>gsl_rng * rng;[/color][/color]
>
>
> 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.
>[/color]
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 |