Top Banner
Concurrent Aggregates (CA) Andrew A. Chien and William J. Dally Presented by: John Lynn and Ryan Wu
23

Concurrent Aggregates (CA) Andrew A. Chien and William J. Dally Presented by: John Lynn and Ryan Wu.

Jan 03, 2016

Download

Documents

Jayson Hardy
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Concurrent Aggregates (CA) Andrew A. Chien and William J. Dally Presented by: John Lynn and Ryan Wu.

Concurrent Aggregates (CA)

Andrew A. Chien and William J. Dally

Presented by: John Lynn and Ryan Wu

Page 2: Concurrent Aggregates (CA) Andrew A. Chien and William J. Dally Presented by: John Lynn and Ryan Wu.

Outline Motivation Serializing abstraction and concurrent

aggregates Features Programming with CA Discussion

Page 3: Concurrent Aggregates (CA) Andrew A. Chien and William J. Dally Presented by: John Lynn and Ryan Wu.

Motivation Parallel programs to take advantage of the

massive hardware concurrency Two major concerns at that time:

Programming should be relatively easy (the complexity of writing object oriented languages)

Language must allow to express sufficient concurrency

Hierarchies of abstractions are used to manage complexity by serializing the abstractions, which may cause significant loss of concurrency

Page 4: Concurrent Aggregates (CA) Andrew A. Chien and William J. Dally Presented by: John Lynn and Ryan Wu.

Serializing Abstractions Each object accepts one msg a

time Hierarchical abstractions

(abstractions built from other abstractions) are built from single objects

Most concurrent object-oriented languages serialize hierarchical abstractions

This leaves programmers with the choice of reduced concurrency or working without useful levels of abstraction

Page 5: Concurrent Aggregates (CA) Andrew A. Chien and William J. Dally Presented by: John Lynn and Ryan Wu.

Concurrent Aggregates

Concurrent aggregates allow programmers to build hierarchical abstractions without serialization.

Each aggregate is multi-access to receive many messages simultaneously

Result: Increased message rate for lower levels

Page 6: Concurrent Aggregates (CA) Andrew A. Chien and William J. Dally Presented by: John Lynn and Ryan Wu.

Background J-machine: 105 nodes, 64K words local

memory, fast communication Fine grain computation: msg passing,

context switching and fast task creation and dispatch

No shared memory, and each of the nodes executes instructions from local mem.

Concurrency in CA is derived from asynchronous messages sends and synchronization through context futures

Similar settings in sensor networks?

Page 7: Concurrent Aggregates (CA) Andrew A. Chien and William J. Dally Presented by: John Lynn and Ryan Wu.

Four important features Intra-aggregate Addressing:

allows representatives of an aggregate to compute the names of other parts of the aggregate

Delegation: to piece together one aggregate’s

behavior from the behavior of others

First Class Messages: Allow programmers to write

message manipulation abstractions First Class Continuations:

enables programs to code synchronizing abstractions such as futures

Page 8: Concurrent Aggregates (CA) Andrew A. Chien and William J. Dally Presented by: John Lynn and Ryan Wu.

Combining Tree Message form:

Combine <combiningtree> <selector> <value> <index>

Page 9: Concurrent Aggregates (CA) Andrew A. Chien and William J. Dally Presented by: John Lynn and Ryan Wu.

Programming with Concurrent Aggregates: Syntax

Aggregate(aggregate <aggname> instance-variable* (parameters param-name+)(initial <aggsize> exp+))

Class (class <cname> instance-variable* (parameters

param-name+)(initial exp+))

(global <gname> initial-exp)

Page 10: Concurrent Aggregates (CA) Andrew A. Chien and William J. Dally Presented by: John Lynn and Ryan Wu.

Example of Aggregate

(aggregate counter count

(parameters number_reps icount)

(initial number_reps)(forall index from 1 below number_reps

(set_count (sibling group index) icount))

(set_count self icount)))

Page 11: Concurrent Aggregates (CA) Andrew A. Chien and William J. Dally Presented by: John Lynn and Ryan Wu.

Method and handler Handler

(handler <aggname> <messagename> (arg*) exp+)

Method (method <cname> <messagename> (arg*)

exp+) Delegate

(delegate <agg-or-cname> <messagename> instance-variable)

Page 12: Concurrent Aggregates (CA) Andrew A. Chien and William J. Dally Presented by: John Lynn and Ryan Wu.

Control constructs and message sends

Page 13: Concurrent Aggregates (CA) Andrew A. Chien and William J. Dally Presented by: John Lynn and Ryan Wu.

Aggregation and Naming Aggregate:

Homogeneous collection of objects (representatives) which are grouped together and may be referenced by a single aggregate name

Messages sent to the aggregate are directed to arbitrary representatives

(sibling group <index>)

Page 14: Concurrent Aggregates (CA) Andrew A. Chien and William J. Dally Presented by: John Lynn and Ryan Wu.

Example

Page 15: Concurrent Aggregates (CA) Andrew A. Chien and William J. Dally Presented by: John Lynn and Ryan Wu.

Delegation and Message Handling

Handlers are methods for aggregates

Delegates specify targets to handle messages

:rest delegate can handle messages with no specified handler

Page 16: Concurrent Aggregates (CA) Andrew A. Chien and William J. Dally Presented by: John Lynn and Ryan Wu.

Bank Example Bank aggregate composed of tellers

aggregate, loan officer, and manager Unusual manages delegated to manager

Page 17: Concurrent Aggregates (CA) Andrew A. Chien and William J. Dally Presented by: John Lynn and Ryan Wu.

Message Handling

Messages are first class objects in CA Can be created and modified programmatically Messages are passed by-value but copying is

only one level deep

Page 18: Concurrent Aggregates (CA) Andrew A. Chien and William J. Dally Presented by: John Lynn and Ryan Wu.

Continuations What is a continuation? Separates code from

synchronization Futures as continuations

Page 19: Concurrent Aggregates (CA) Andrew A. Chien and William J. Dally Presented by: John Lynn and Ryan Wu.

Futures Value method

returns value immediately if available, otherwise adds continuation to a list

Set_value method forwards value to all continuations on deferred list

Page 20: Concurrent Aggregates (CA) Andrew A. Chien and William J. Dally Presented by: John Lynn and Ryan Wu.

Objects as Continuations A continuation is just an object

that expects a reply Complex synchronization

structures can be implemented as continuations

Page 21: Concurrent Aggregates (CA) Andrew A. Chien and William J. Dally Presented by: John Lynn and Ryan Wu.

Barrier Barrier object

implements reply method

Once, maxcount is reached, all computations are resumed

Page 22: Concurrent Aggregates (CA) Andrew A. Chien and William J. Dally Presented by: John Lynn and Ryan Wu.

Conclusion CA provides a programming

abstraction for dealing with many processors

Abstraction takes much of the complexity out of parallelizing a computation

First class continuations allow for modular synchronization structures

Page 23: Concurrent Aggregates (CA) Andrew A. Chien and William J. Dally Presented by: John Lynn and Ryan Wu.

Discussion How might these concepts parallel

what we are trying to accomplish with sensor networks?

How do these concepts differ? Of what use could concurrent

aggregates be in programming a sensor network?