MPI is more about message passing than explicitly sharing data (in a
shared memory or DSM sense). Keep in mind that MPI may *use* shared
memory to send and receive messages, but that underlying protocol
transport is not exposed to the user.
As someone else replied in this thread, one way to handle linked lists
is to send them to the process that you're working with. However, it
really depends on what you're trying to do. If you really need to
concurrently *share* the data between two threads or processes, MPI is
probably not the right tool. Be aware of all kinds of locking and bus
contention issues if you decide to use a pure shared memory approach
(and this list is probably not the right place for help for that), and
that you'd have to effect your own off-node communication in this
approach.
Another approach is to use threads on a single machine (your question
implies that you have a cluster of SMPs) and MPI for off-machine
communication. There's limitations on this, however, mainly because
LAM is a single-threaded implementation of MPI and can't handle
multiple threads in its library simultaneously. Search the list
archives for some information on this.
A more MPI-like approach would be to split up the data and have one
process handle its portion of the data, and synchronize "border values"
with peer processes. How you split up this data and synchronize the
border values is totally problem-dependent, of course. But since your
goal is to run across a cluster, you might want to look at the problem
you're trying to solve and see if it's easily parallelizable first
(e.g., how would you split up the data across multiple nodes, work on
them more-or-less independently, etc.).
Hope this helps.
On Apr 10, 2005, at 11:05 PM, Kaveh Moallemi wrote:
> Hello,
>
> I've been assigned to take an existing C program and to modify it with
> MPI so that it could run in parallel on our cluster.
>
> The program consists of a graph and a few other linked lists. Since
> MPI doesn't provide explicit shared memory, I was wondering how I
> would handle the linked lists. Any suggestions?
>
> I'm a novice programmer ... so apologies in advance if this is a dumb
> question :)
>
> Thank you.
> _______________________________________________
> This list is archived at http://www.lam-mpi.org/MailArchives/lam/
>
--
{+} Jeff Squyres
{+} jsquyres_at_[hidden]
{+} http://www.lam-mpi.org/
|