[Mpi3-rma] Dynamic windows example

James Dinan dinan at mcs.anl.gov
Fri Dec 3 15:44:26 CST 2010

Hi All,

In the process of trying to gain a deeper understanding of the dynamic 
windows proposal I wrote a small distributed linked list example.  I've 
attached the code in case this may be helpful for others.  Please feel 
free to dissect, modify, post questions, complaints, etc.

Here's what it does: Construct a distributed shared linked list using 
proposed MPI-3 dynamic windows.  Initially process 0 creates the head of 
the list, registers it with the window, and broadcasts the pointer to 
all processes.  All processes then concurrently create, register, and 
append N items to the list.  When a process attempts to attach its item 
to the tail of list it may discover that its tail pointer is stale and 
it must chase ahead to the new tail before the item can be attached.

What's new: This code uses dynamic windows and flush with exclusive 
locks do read-modify-write.

It might be a stretch, but you could imagine mapping this example to 
something like spatial decomposition.  For example, in something like 
Barnes-Hut you need to concurrently insert a pile bodies into a shared 
spatial decomposition octtree.  They need to be appended to leaf nodes 
in the tree which may themselves be getting subdivided as other bodies 
are inserted into the tree and spatial octants overflow.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mpi_rma_llist.c
URL: <http://lists.mpi-forum.org/pipermail/mpiwg-rma/attachments/20101203/dceaebff/attachment.c>

More information about the mpiwg-rma mailing list