Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old August 16th, 2005, 11:35 AM
stringy
Guest
 
Posts: n/a
Default Copying gsl_rng_state across MPI

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=blue][color=green][color=darkred]
>>>>> void * gsl_rng_state (const gsl_rng * r)[/color][/color][/color]

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

  #2  
Old August 17th, 2005, 09:15 PM
Paul Schneider
Guest
 
Posts: n/a
Default 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
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles