From: raja@rsn.hp.com (Raja Daoud)
Newsgroups: comp.parallel.mpi
Subject: Re: Shared Memory with MPI [Question from an uninitiated one]
Date: 24 Aug 1998 14:37:33 -0500
Organization: Hewlett-Packard Co.
Message-Id: <6rsfdt$snr@tbag.rsn.hp.com>
References: <35E1A319.9B5EB747@byophisycs.lanl.gov>


Omri Schwarz  <omri@byophisycs.lanl.gov> wrote:
> Hi, looking all around my MPI refs, ["Using MPI", the HP manual, URL's
> all around] I could find refs on how to simulate shared memory, but not
> on how to use it.  My code constantly refers to, but does not modify, a
> huge array, but the processors should be able to refer to the same
> memory block.

No perfect answer, some possibilities:

- Use MPI-2's one-sided functionality:
	+ portable on the long term
	+ expect it to be fast within a host or system
	- not yet available in all MPIs
	- does not provide remote load/store, it's put/get + synchronization

	[note: HP MPI 1.4 provides a subset of one-sided, 2-out-of-3
	synchronization methods: fence and lock/unlock, not post/wait]

- Use SysV shared-memory:
	+ portable within Unix
	+ limited to a single host/system
	+ can do load/store
	- SysV semaphores are slow, user-space locks are not portable
	- need to be careful about systems with weak memory order
	  or not cache-coherent if you don't use semaphores
	- not guaranteed to work in a mixture with MPI (see MPI-2 chap 2)
	  but will probably work for most/all implementations


If put/get is acceptable, I suggest going with one-sided and hope that
it becomes available in most MPIs soon.  This assumes that there isn't
an appropriate MPI-1 solution for your case.
Regards,

--Raja

-=-
Raja Daoud				Hewlett-Packard Co.
raja@rsn.hp.com				http://www.hp.com/go/mpi

