Newsgroups: comp.parallel
From: Milind Bhandarkar <milind@cs.uiuc.edu>
Subject: Re: [Q] Mapping SMM to DMM and vice versa
Organization: University of Illinois at Urbana
Date: 10 Apr 1995 02:04:04 GMT
Message-ID: <3mje3b$ssc@usenet.srv.cis.pitt.edu>

T.S.How@bath.ac.uk wrote:
>
> Is there any technique of mapping programs written using shared-memory
> model to distributed-memory model and vice versa? I would like to have
> technical reports on such techniques, and if possible, its
> implementations as well. 
> 

Mapping from DMM to SMM is simpler of the two, in my opinion.
If the programming environment supports Thread-Private variables, it
becomes even simpler. Simply declare all the global variables in each
DMM task as Thread-Private. Rename "main()" to say, tempMain() and
fork N threads (N=num procs) in new main() which will each execute
tempMain(). However, message-passing functions such as send and receive
will have to be implemented as appending a message to the thread's
message queue and retrieving a message from thread's message queue
respectively.

Converting a shared memory program to a DMM program will be a bit
more complicated. One has to in general understand the program.
i.e. differentiate between shared and distinct accesses and replace them
by get() and put() respectively which will have to be implemented
by message passing. It would be (1) difficult in most non-trivial
programs and (2) inefficient if done in higher level languages.

-milind
(milind@cs.uiuc.edu)

