CS 584 Lecture 16 n Assignment -- Due Friday n C* program n Paper reviews
Models of Parallelism n Message Passing (MPI, PVM) n Data parallelism (C*) n Global data-space (Linda)
Linda n Consists of several operations that work on a global data space (tuple space) n The operations have been added to several languages. n MIMD programming model n Interaction is through tuple space
Tuples n A tuple is an object consisting of: n a key n zero or more arguments n Example ("jim", 88, 1.5) n The key is used for matching
Tuple Space n Global data space n Collection of tuples n Tuples may be: n inserted (out) n read (rd and rdp) n deleted(in and inp) n evaluated(eval) n forks a new worker
Tuple Space
n Updating a tuple n delete - modify - insert n Duplicate key entries is allowed n Non-determinism n inp and rdp guarantee to locate a matching tuple iff a matching tuple must have been added and could not have been removed before the request
Example Programs n Database search n Master-Worker n Divide and Conquer
procedure manager count = 0 until EOF do read datum from file OUT("datum", datum) count++ enddo best = 0.0 for j = 1 to count IN("score", value) if (value > best) best = value endfor for j = 1 to numworkers OUT("datum", "stop") endfor end
procedure worker IN("datum", datum) until datum == "stop" value = compare(datum, target) OUT("score", value) IN("datum", datum) enddo end
Tuple Space n Perfect candidate for a database. n Simplifies parallel programming? n Performance? n Consider the implementation of the tuple space.
Tuple Space Implementation n Central n What advantages/disadvantages does this implementation present?
Tuple Space Implementation n Distributed n What advantages/disadvantages does this implementation present?