A Flexible Approach to Staged Events
6th International Workshop on Parallel Programming Models and Systems Software for High-End Computing (P2S2) October 1st 2013 – Lyon, France
Tiago Salmito
tsalmito@inf.puc-rio.br
Staged Events Tiago Salmito tsalmito@inf.puc-rio.br Ana Lcia de - - PowerPoint PPT Presentation
A Flexible Approach to Staged Events Tiago Salmito tsalmito@inf.puc-rio.br Ana Lcia de Moura Noemi Rodriguez 6th International Workshop on Parallel Programming Models and Systems Software for High-End Computing (P2S2) October 1 st 2013
6th International Workshop on Parallel Programming Models and Systems Software for High-End Computing (P2S2) October 1st 2013 – Lyon, France
tsalmito@inf.puc-rio.br
Stack management Task management Preemptive Cooperative Automatic Manual Event-driven Cooperative threads Multithread
* A. Adya, J. Howell, M. Theimer, W. J. Bolosky and J. R. Douceur. Cooperative Task Management Without Manual Stack Management. (2002)
2
3
4
5
6
Stage Event handler
Dispatch events Event queue Observe state Adjust parameters ... Thread pool
Scheduler
Controller
7
8
– Functional or domain decomposition
– Data exchange
– Processing and communication granularity
– Mapping tasks to processors
9
Problem Partitioning Communication Agglomeration Mapping
– Functional decomposition – State isolation
– Domain decomposition
– Atomic execution
– Connectors: Application graph – Output ports and event queues
– Clusters of stages – Scheduling domain
– Execution locality
10
Communication Programming Stage
Event handler
Stage
Event handler
Stage
Event handler ...
1 2 3 4 5
Connector
Agglomeration 3 5 Mapping Process 1 1 2 Controller Process 2 3 4 Controller Process 3 5 Controller
Cluster
1 2 4
11
12
require 'leda' local port=5000 local server=leda.stage{ handler=function() local server_sock=assert(socket.bind("*", port)) while true do local cli_sock=assert(server_sock:accept()) leda.send("client",cli_sock) end end, init=function() require'leda.utils.socket' end, }:push() local reader=leda.stage{ handler=function(sock) repeat local msg,err=sock:receive() leda.send("message",msg) until msg==nil end } local echo=leda.stage(function(msg) print(msg) end) local graph=leda.graph{ server"client"..reader, reader"message"..echo } graph:run()
13
Workgen Reducer Stage 1 Stage 2 Stage 3
14
15
6th International Workshop on Parallel Programming Models and Systems Software for High-End Computing (P2S2) October 1st 2013 – Lyon, France
tsalmito@inf.puc-rio.br
17
Process 1 S2 S3 S5 S4 S7 S1 S6 S8 Application Ready queue Thread Thread Thread Thread pool Controller To/from
processes Cluster Instances Scheduler To process 2 S1 S2 S3 S4 Idle instances Marshalling S1 S2 S3 S4 Event queues S2 S3 S4 S1 I/O interfaces Asynchronous events Waiting instances Thread Cluster 1 Cluster 2 Runtime Statistics