7 pp scheduling
TRANSCRIPT
-
8/10/2019 7 PP Scheduling
1/27
ThoaiNam
-
8/10/2019 7 PP Scheduling
2/27
Khoa Cong Nghe Thong Tin ai Hoc Bach Khoa Tp.HCM
Scheduling on UMA
Multiprocessors
Schedule:
allocation of tasks to processors Dynamic scheduling
A single queue of ready processes
A physical processor accesses the queue to run the nextprocess
The binding of processes to processors is not tight
Static scheduling Only one process per processor
Speedup can be predicted
-
8/10/2019 7 PP Scheduling
3/27
Khoa Cong Nghe Thong Tin ai Hoc Bach Khoa Tp.HCM
Static scheduling
An application is modeled as an directed acyclic graph (DAG) The system is modeled as a set of homogeneous processors
An optimal schedule: NP-complete
Scheduling in the runtime system
Multithreads: functions for thread creation, synchronization, and
termination
Parallelizing compilers: parallelism from the loops of the sequential
programs
Scheduling in the OS
Multiple programs must co-exist in the same system
Administrative scheduling
-
8/10/2019 7 PP Scheduling
4/27
Khoa Cong Nghe Thong Tin ai Hoc Bach Khoa Tp.HCM
A parallel program is acollection of tasks, someof which must becompleted before othersbegin
Deterministic model:The execution time needed
by each task and theprecedence relationsbetween tasks are fixedand known before run time
Task graph
T1--------
2
T2-------3
T3--------1
T4--------
2
T5--------
3
T6--------
3
T7--------
1
-
8/10/2019 7 PP Scheduling
5/27
Khoa Cong Nghe Thong Tin ai Hoc Bach Khoa Tp.HCM
Gantt chart indicates the time each task
spends in execution, as well as the
processor on which it executes
T7T5T2T1
T6T3
T4
1 2 3 4 5 6 7 8 9
T1--------
2
T2-------3
T3--------
1
T4--------
2
T5--------
3
T6--------
3
T7--------
1
Time
Processors
-
8/10/2019 7 PP Scheduling
6/27
Khoa Cong Nghe Thong Tin ai Hoc Bach Khoa Tp.HCM
If all of the tasks take unit time, and the task graph is a
forest (i.e., no task has more than one predecessor), then a
polynomial time algorithm exists to find an optimal schedule
If all of the tasks take unit time, and the number of
processors is two, then a polynomial time algorithm exists to
find an optimal schedule If the task lengths vary at all, or if there are more than two
processors, then the problem of finding an optimal schedule
is NP-hard.
-
8/10/2019 7 PP Scheduling
7/27
Khoa Cong Nghe Thong Tin ai Hoc Bach Khoa Tp.HCM
Grahams list scheduling algorithm
T = {T1, T2,, Tn}
a set of tasks : T (0,)
a function associates an execution time with each task
A partial order