next up previous
Next: Mechanism: Up: Examples of Parallel Language Previous: Examples of Parallel Language

Object Replication

Object replication greatly improves performance of programs in a distributed memory environment. When a program frequently accesses a remote object, creating a replica of the object within the local processor will substantially reduces the number of remote messages. For concreteness, assume there are two vector objects v1 and v2 on different processors, and a function product (Figure 2) is called on the processor on which v1 is placed. Since v2 is a remote object, each invocation of nth-element on v2 sends and waits on a remote message; this results in (2 x |v2|) fine-grained remote messages, where |v2| is the length of vector v2.
  
Figure 2: A naively written dot-product function
(defun product (v1 v2)
  (let ((sum 0.0) (size (size-of v1))
    (dotimes (i size)
      (setf sum
        (+ sum (* (nth-element v1 i)
                  (nth-element v2 i)))))
   sum)))


If replication mechanism were available as a language feature, this program could be optimized by creating a replica of v2 at the local processor during the computation of product5. However, this is not a simple task: for effective execution, we must consider the following aspects: (1) how replicas are created and managed (mechanism), (2) how programmers specify creation of replicas (syntax), and (3) how to decide whether an object should be replicated (policy).

 
next up previous
Next: Mechanism: Up: Examples of Parallel Language Previous: Examples of Parallel Language
Matt Hurlbut
1998-07-14