Discussion:
C++ Random Shuffle Algorithm + MPI
(too old to reply)
Atul.
2009-02-11 00:06:03 UTC
Permalink
Hi All,

I am trying to use the random_shuffle algorithm from C++ STL to
shuffle the
contents of a vectors. Now I wish to use MPI to execute this
functionality in parallel on multiple processors. I believe that the
parallel execution of the random_shuffle will not be indentical on
all
the machinies. Is that correct?


If that is correct then I was wondering if there is any good way of
sending the shuffled vector around (without converting to an array.).
Has anyone in the past circulated the C++ STL vectors around using
MPI_BCAST? Any thoughts on how to do it?


Can I try the variant with RandomNumberGenerator class??


Regards,
Atul.
Michael Hofmann
2009-02-11 08:37:42 UTC
Permalink
Post by Atul.
Hi All,
I am trying to use the random_shuffle algorithm from C++ STL to
shuffle the
contents of a vectors. Now I wish to use MPI to execute this
functionality in parallel on multiple processors. I believe that the
parallel execution of the random_shuffle will not be indentical on
all
the machinies. Is that correct?
I don't understand. C++ random_shuffle is sequential. If you want to
create a (distributed memory) parallel random_shuffle, you need to know
how to parallelize it.
Post by Atul.
If that is correct then I was wondering if there is any good way of
sending the shuffled vector around (without converting to an array.).
Has anyone in the past circulated the C++ STL vectors around using
MPI_BCAST? Any thoughts on how to do it?
MPI with C++ STL datatypes requires serialization/deserialization
(converting to an array). But maybe you want to have a look at "STL-MPI"
[1] or "Boost.MPI" [2]. (I can say anything about their performance, but I
guess they are (at least) not faster than pure MPI libraries.)

[1] http://clustertech.com/index.php?Download:STL-MPI_Library
[2] http://www.boost.org/doc/libs/1_38_0/doc/html/mpi.html
Post by Atul.
Can I try the variant with RandomNumberGenerator class??
Microsoft?


Michael

Loading...