Self-Adjusting Scheduling of Master

Self-Adjusting Scheduling
of Master-Worker
Applications on
Opportunistic Environments
Miquel Angel Senar
Unitat d’Arquitectura de Computadors i Sistemes Operatius
Universitat Autònoma de Barcelona
[email protected]
Problem Backgroung
›Parallel Application that follows the
master-worker model
›A master process is assigned several
batches of tasks
›The master process allocates worker
processes to solve each batch
›Batches are solved iteratively
Self-Adjusting Scheduling of Master-Worker Applications
A simple example:
an image thinning application
Original
10 It. Latter
36 It. Latter
Self-Adjusting Scheduling of Master-Worker Applications
Image Thinning as a
Master-Worker Application!
Master Process
Divides Image
Workers Compute
Concurrently
Master
Aggregates Image
Self-Adjusting Scheduling of Master-Worker Applications
Running the application with MW + Condor-PVM
tasks
worker
master
results
PVM
PVM
worker
worker
Self-Adjusting Scheduling of Master-Worker Applications
Challenges of master-worker
applications
›
›
›
›
Task scheduling
Number of workers
Dealing with heterogeneous processor
Impact of preemption
Self-Adjusting Scheduling of Master-Worker Applications
Our Self-Adjusting Strategy
› Dynamically measures application performance and task
›
›
›
›
execution times
Predicts the resource requirements from measured
history
Schedules tasks on the resources according to that
prediction in order to minimize the completion time of
the application
Voluntary relinquishes resources when they are not
plentifully utilized
Allocates more resources whenever a significant loss in
speedup is detected.
Self-Adjusting Scheduling of Master-Worker Applications
Influence of Task Scheduling
EFFICIENCY. 30% 1-0 Dev=10 Tasks=31 Loop=35
1
LPTF
Random
LPTF on Average
Random & Average
Efficiency
0.8
0.6
0.4
0.2
0
0
5
10
15
20
25
30
35
Machines
Self-Adjusting Scheduling of Master-Worker Applications
How does our strategy work (1)?
› Collects task execution times at each iteration
› Sorts tasks according to their average
execution time (Prediction)
› At each iteration, tasks are scheduled
according following the order of that list
Self-Adjusting Scheduling of Master-Worker Applications
Influence of the Number of Workers
EFFICIENCY. Tasks=30
1
LPTF
Efficiency
0.8
0.6
8
0.4
5 5 4
0.2
0
0
5
10
15
20
25
2 1
30
Machines
Self-Adjusting Scheduling of Master-Worker Applications
Influence of the Number of Workers
EFFICIENCY. Tasks=30
1
LPTF
Efficiency
0.8
0.6
4 1
2
0.4
8
5 5
0.2
0
0
5
10
15
20
25
30
Machines
Self-Adjusting Scheduling of Master-Worker Applications
How does our strategy work (2)?
 Initially, allocates 1 Worker per Task
Total Ex. Time
 Reduces the number of workers to w 
Largest Task
 Allocates 1 more Worker if (ExecutionTime > (Largest
Task + Threshold))
 Releases 1 Worker if (Efficiency < 0.8)
Self-Adjusting Scheduling of Master-Worker Applications
Num be r of Wor k e r s
Sample Result: No. of Workers
25
20
15
10
5
0
 Self-Adjusting
 Non Self-Adjusting
Self-Adjusting Scheduling of Master-Worker Applications
Sample Result: Efficiency
Efficie ncy
1
0,8
0,6
0,4
0,2
0
 Self-Adjusting
 Non Self-Adjusting
Self-Adjusting Scheduling of Master-Worker Applications
Exe c. Tim e (s e c.)
Sample Result: Execution Time
25
20
15
10
5
0
1 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90
Iteration Number
 Self-Adjusting
 Non Self-Adjusting
Self-Adjusting Scheduling of Master-Worker Applications
Dealing with heterogeneity
› Problem: wall clock time reflects application code and
resource performance
› Master and Worker machines have a performance
normalization factor (i). (Benchmarking)
› Task scheduling decisions are based on normalized task
execution times (user time multiplied by ’s)
› Worker allocation decisions are based on wall clock
time measured at the master process
Self-Adjusting Scheduling of Master-Worker Applications
Num be r of Wor k e r s
Dealing with heterogeneity
40
30
20
10
0
 Self-Adjusting
 Non Self-Adjusting
Self-Adjusting Scheduling of Master-Worker Applications
Dealing with Preemption
2
8
5
1
2
3
4
4
8
2
We expect this
2
8
5
4
This is what
happens
4
5
1
3
4
4
And this is what
we get
Self-Adjusting Scheduling of Master-Worker Applications
Dealing with Preemption
› SOLUTION (still working on it): Using extra machines
› Complete Replication (extra machines running a copy of
one of the largest tasks) usually performs better than
No Replication
› Every extra machines has a negative impact on overall
efficiency (between 3% and 8%)
› CR with 2 extra machines exhibits a good trade-off if
one machine is lost at every iteration.
Self-Adjusting Scheduling of Master-Worker Applications
And coming soon…
delays
Self-Adjusting Scheduling of Master-Worker Applications
Self-Adjusting Scheduling
of Master-Worker
Applications on
Opportunistic Environments
Miquel Angel Senar
Unitat d’Arquitectura de Computadors i Sistemes Operatius
Universitat Autònoma de Barcelona
[email protected]