130 likes | 191 Views
CS 584 Lecture 16. Assignment -- Due Friday C* program Paper reviews. Models of Parallelism. Message Passing (MPI, PVM) Data parallelism (C*) Global data-space (Linda). Linda. Consists of several operations that work on a global data space (tuple space)
E N D
CS 584 Lecture 16 • Assignment -- Due Friday • C* program • Paper reviews
Models of Parallelism • Message Passing (MPI, PVM) • Data parallelism (C*) • Global data-space (Linda)
Linda • Consists of several operations that work on a global data space (tuple space) • The operations have been added to several languages. • MIMD programming model • Interaction is through tuple space
Tuples • A tuple is an object consisting of: • a key • zero or more arguments • Example ("jim", 88, 1.5) • The key is used for matching
Tuple Space • Global data space • Collection of tuples • Tuples may be: • inserted (out) • read (rd and rdp) • deleted (in and inp) • evaluated (eval) • forks a new worker
Tuple Space • Updating a tuple • delete - modify - insert • Duplicate key entries is allowed • Non-determinism • 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 • Database search • Master-Worker • 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 • Perfect candidate for a database. • Simplifies parallel programming? • Performance? • Consider the implementation of the tuple space.
Tuple Space Implementation • Central • What advantages/disadvantages does this implementation present?
Tuple Space Implementation • Distributed • What advantages/disadvantages does this implementation present?