TASK ALLOCATION AND SCHEDULING IN A
          MULTI-PROCESSOR ENVIRONMENT




Guided by                          Submitted by

Ms.ANJU S PILLAI                MUTHU KUMAR .B
Assistant professor(SG)         CB.EN.P2EBS10012
Department of EEE                Department of EEE
ABSTRACT

       Uniprocessor scheduling is widely used for its simplicity, reliability and
ease for implementation. But it has got its limitations over less processor
utilization factor. For a better processor utilization and performance
multiprocessor scheduling is preferred.

      One of the major challenges is to find an optimal task-processor
assignment. The work aims at finding different task processor assignment
policies and finding a better Processor Utilization and schedule the tasks
dynamically using EDF algorithm.
METHODOLOGY


•   The main objective of the project is to perform scheduling in a multiprocessor
    system.
•   Generation of a set of synthetic tasks.
•   Fix the number of processors needed for the system.
•   Static Priority assignment to all the tasks using RM scheduler with
    dispatcher.
•   Dynamic Priority assignment to all the tasks using EDF scheduler with
    dispatcher.
•   The next step is to perform task-processor assignment.
•   Implementation of
     1. Next Fit Algorithm
     2. Bin Packing Algorithm
•   The final stage is the scheduling of all the tasks in the multiprocessor system.
DEVELOPING A MULTIPROCESSOR SCHEDULE


         Make an allocation


           Schedule each
         processor based on
           the allocation                  Change Allocation

            Are all these
         schedules feasible


Output schedule                           Continue
                        Check stopping
                           criterion
                                 Stop
                        Declare Failure
EARLIEST DEADLINR FIRST ALGORITHM

If D=T

•   Shortest of the deadline of given task is selected as higher priority to be executed.
•   The highest priority task is executed first.

If D!=T

    If D>T

          The task is not schedulable probably which means it misses the deadline.

    If D<T

          1.The task set is just checked for the feasible solution.
          2.Feasible solution is found by using the Processor Demand Analysis.
DEADLINE = TIME PERIOD

            TASK               COMPUTATION TIME    TIME PERIOD(D=T)
              A                           1               3
              B                           1               6
              C                           1               5
              D                           3              10




Priorities of tasks scheduled using EDF

 132144143213124144312134144231
EARLIEST DEADLINE FIRST ALGORITHM ( EDF )
EARLIEST DEADLINE FIRST TRACE
DEADLINE < TIME PERIOD




        TASK           COMPUTATION        DEADLINE   TIME PERIOD(D=T)
                          TIME
         A                    3              4              6
         B                    4              7              8


Priorities of tasks scheduled using EDF
            Deadline Miss !
     1 2 1 2 …..

       Hence not schedulable.
TASK ALLOCATION USING NEXT FIT ALGORITHM




PROCEDURE FOR NEXT FIT ALGORITHM

1.Tasks with utilization are divided into classes with uniform utilization range.
2.According to number of classes the number of processors are decided.
3.Each class is assigned to specific processors.
TASKS :         A      B      C      D      E     F      G    H    I     J
 COMPUTATION         5      7      3      1     10     16     1   13    9    17
    TIME
  TIME PERIOD        10    21     22     24     30     40    50   55    75   100

   Utilization       0.5   0.33   0.14   0.04   0.33   0.4   0.02 0.24 0.13 0.17

Processor or Class   4      3      1      1      3     3      1    2    1    1




  if(U(i)<0.19)       Task in processor P4
   if(U(i)<0.26)      Task in processor P3
   if(U(i)<0.41)      Task in processor P2
   if(U(i)<=1)        Task in processor P1
NEXT FIT ALGORITHM FOR TASK ALLOCATION
BIN PACKING ALGORITHM

BIN PACKING ALGORITHM

   1.First fit random algorithm
   2.First fit decreasing algorithm

PROCEDURE FOR FIRST FIT RANDOM

1.Random tasks with utilization are selected and packed in a bin.
2.If bin exceeds 100% on further addition of tasks bin2 is started to be packed.
3.Task Utilizations are always whether they can be packed fully on previous
    processors.
TASKS :         A      B      C      D      E     F      G    H    I     J
      COMPUTATION         5      7      3      1     10     16     1   13    9    17
         TIME
       TIME PERIOD        10    21     22     24     30     40    50   55    75   100

        Utilization       0.5   0.33   0.14   0.04   0.33   0.4   0.02 0.24 0.13 0.17

     Processor or Class   1      1      1      2      2     2      2    3    3    3




1.     After utilization exceeds 1 it changes to processor 2.
2.     After utilization exceeds 2 it changes to processor 3.
3.     So number of processors required is 3 to accommodate the given task set.
BIN PACKING ALGORITHM FOR TASK ALLOCATION
TIME FRAME


I.     Literature Review - Aug 2011
II.    Synthetic task generation and priority assignment – Sep 2011
III.   Implementation of Task-Processor allocation policies – Oct & Nov 2011
IV.    Scheduling of tasks - Dec 2011
V.     Analysis of the results – Jan 2011
VI.    Hardware implementation– Feb to May 2012
VII.   Documentation – Jun 2012
REFERENCES


1.   P. Ancilotti, G. Buttazzo, M. D. Natale, and M. Spuri. “Design and
     programming tools for time critical applications.” Real-Time Systems, 14:3,
     pp. 251–269, May 1998.
2.   R. Pellizzoni and G. Lipari Feasibility “Analysis of Real-Time Periodic Tasks
     with Offsets “Real-Time Systems Journal, 2005.
3.   Eric W.Parsons and Kenneth C.Sevcik“Implementing multiprocessor
     algorithms”.
4.   Haobo Yu, Andreas Gerstlauer and Daniel Gajski “RTOS Scheduling in
     transaction level models”
THANK YOU !

Task allocation and scheduling inmultiprocessors

  • 1.
    TASK ALLOCATION ANDSCHEDULING IN A MULTI-PROCESSOR ENVIRONMENT Guided by Submitted by Ms.ANJU S PILLAI MUTHU KUMAR .B Assistant professor(SG) CB.EN.P2EBS10012 Department of EEE Department of EEE
  • 2.
    ABSTRACT Uniprocessor scheduling is widely used for its simplicity, reliability and ease for implementation. But it has got its limitations over less processor utilization factor. For a better processor utilization and performance multiprocessor scheduling is preferred. One of the major challenges is to find an optimal task-processor assignment. The work aims at finding different task processor assignment policies and finding a better Processor Utilization and schedule the tasks dynamically using EDF algorithm.
  • 3.
    METHODOLOGY • The main objective of the project is to perform scheduling in a multiprocessor system. • Generation of a set of synthetic tasks. • Fix the number of processors needed for the system. • Static Priority assignment to all the tasks using RM scheduler with dispatcher. • Dynamic Priority assignment to all the tasks using EDF scheduler with dispatcher. • The next step is to perform task-processor assignment. • Implementation of 1. Next Fit Algorithm 2. Bin Packing Algorithm • The final stage is the scheduling of all the tasks in the multiprocessor system.
  • 4.
    DEVELOPING A MULTIPROCESSORSCHEDULE Make an allocation Schedule each processor based on the allocation Change Allocation Are all these schedules feasible Output schedule Continue Check stopping criterion Stop Declare Failure
  • 5.
    EARLIEST DEADLINR FIRSTALGORITHM If D=T • Shortest of the deadline of given task is selected as higher priority to be executed. • The highest priority task is executed first. If D!=T If D>T The task is not schedulable probably which means it misses the deadline. If D<T 1.The task set is just checked for the feasible solution. 2.Feasible solution is found by using the Processor Demand Analysis.
  • 6.
    DEADLINE = TIMEPERIOD TASK COMPUTATION TIME TIME PERIOD(D=T) A 1 3 B 1 6 C 1 5 D 3 10 Priorities of tasks scheduled using EDF 132144143213124144312134144231
  • 7.
    EARLIEST DEADLINE FIRSTALGORITHM ( EDF )
  • 9.
  • 10.
    DEADLINE < TIMEPERIOD TASK COMPUTATION DEADLINE TIME PERIOD(D=T) TIME A 3 4 6 B 4 7 8 Priorities of tasks scheduled using EDF Deadline Miss ! 1 2 1 2 ….. Hence not schedulable.
  • 12.
    TASK ALLOCATION USINGNEXT FIT ALGORITHM PROCEDURE FOR NEXT FIT ALGORITHM 1.Tasks with utilization are divided into classes with uniform utilization range. 2.According to number of classes the number of processors are decided. 3.Each class is assigned to specific processors.
  • 13.
    TASKS : A B C D E F G H I J COMPUTATION 5 7 3 1 10 16 1 13 9 17 TIME TIME PERIOD 10 21 22 24 30 40 50 55 75 100 Utilization 0.5 0.33 0.14 0.04 0.33 0.4 0.02 0.24 0.13 0.17 Processor or Class 4 3 1 1 3 3 1 2 1 1 if(U(i)<0.19) Task in processor P4 if(U(i)<0.26) Task in processor P3 if(U(i)<0.41) Task in processor P2 if(U(i)<=1) Task in processor P1
  • 14.
    NEXT FIT ALGORITHMFOR TASK ALLOCATION
  • 17.
    BIN PACKING ALGORITHM BINPACKING ALGORITHM 1.First fit random algorithm 2.First fit decreasing algorithm PROCEDURE FOR FIRST FIT RANDOM 1.Random tasks with utilization are selected and packed in a bin. 2.If bin exceeds 100% on further addition of tasks bin2 is started to be packed. 3.Task Utilizations are always whether they can be packed fully on previous processors.
  • 18.
    TASKS : A B C D E F G H I J COMPUTATION 5 7 3 1 10 16 1 13 9 17 TIME TIME PERIOD 10 21 22 24 30 40 50 55 75 100 Utilization 0.5 0.33 0.14 0.04 0.33 0.4 0.02 0.24 0.13 0.17 Processor or Class 1 1 1 2 2 2 2 3 3 3 1. After utilization exceeds 1 it changes to processor 2. 2. After utilization exceeds 2 it changes to processor 3. 3. So number of processors required is 3 to accommodate the given task set.
  • 19.
    BIN PACKING ALGORITHMFOR TASK ALLOCATION
  • 22.
    TIME FRAME I. Literature Review - Aug 2011 II. Synthetic task generation and priority assignment – Sep 2011 III. Implementation of Task-Processor allocation policies – Oct & Nov 2011 IV. Scheduling of tasks - Dec 2011 V. Analysis of the results – Jan 2011 VI. Hardware implementation– Feb to May 2012 VII. Documentation – Jun 2012
  • 23.
    REFERENCES 1. P. Ancilotti, G. Buttazzo, M. D. Natale, and M. Spuri. “Design and programming tools for time critical applications.” Real-Time Systems, 14:3, pp. 251–269, May 1998. 2. R. Pellizzoni and G. Lipari Feasibility “Analysis of Real-Time Periodic Tasks with Offsets “Real-Time Systems Journal, 2005. 3. Eric W.Parsons and Kenneth C.Sevcik“Implementing multiprocessor algorithms”. 4. Haobo Yu, Andreas Gerstlauer and Daniel Gajski “RTOS Scheduling in transaction level models”
  • 24.