0% found this document useful (0 votes)
52 views37 pages

Real Time System - : BITS Pilani

1) The document discusses various algorithms for real-time task scheduling on multiprocessor and distributed systems including static algorithms like utilization balancing, next-fit, and bin packing and dynamic algorithms like focused addressing and bidding and buddy algorithms. 2) The focused addressing and bidding algorithm divides time into windows and processors broadcast their load and bid for tasks from overloaded processors while the buddy algorithm limits broadcasts to just a processor's buddy set to reduce communication overhead. 3) Both algorithms use threshold-based definitions of underloaded and overloaded processors and select among buddies for task transfers, with the buddy algorithm avoiding periodic broadcasts.

Uploaded by

vithya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views37 pages

Real Time System - : BITS Pilani

1) The document discusses various algorithms for real-time task scheduling on multiprocessor and distributed systems including static algorithms like utilization balancing, next-fit, and bin packing and dynamic algorithms like focused addressing and bidding and buddy algorithms. 2) The focused addressing and bidding algorithm divides time into windows and processors broadcast their load and bid for tasks from overloaded processors while the buddy algorithm limits broadcasts to just a processor's buddy set to reduce communication overhead. 3) Both algorithms use threshold-based definitions of underloaded and overloaded processors and select among buddies for task transfers, with the buddy algorithm avoiding periodic broadcasts.

Uploaded by

vithya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 37

Real Time System –

Lecture 14
BITS Pilani Rekha. A
Pilani Campus
Real time task scheduling
on multiprocessor and
distributed system
BITS Pilani
Pilani Campus
Task Assignment Algorithm

 Static:
• Utilization Balancing Algorithm
• Next – Fit Algorithm
• Bin packing algorithm

 Dynamic:
• Focused addressing and bidding algorithm
• Buddy algorithm

BITS Pilani, Pilani Campus


Utilization Balancing
Algorithm

• Maintain tasks in a queue

• In increasing order of their utilization

• Remove tasks one by one from queue

• Allocates to the lowest utilized process

BITS Pilani, Pilani Campus


Next – Fit algorithm

• Tasks with utilization are divided into classes with


uniform/similar utilization range.
• According to number of classes the number of processors
are decided.
• Each class is assigned to specific processors.

For n Processor:
n classes of tasks is constructed.
A task belongs to class j, iff
(21/(j+1) -1) < ei/pi <= (21/j -1)

BITS Pilani, Pilani Campus


Next Fit Algorithm

Consider 4 processors
Class 4 (0.41,1)
Class 3(0.26,0.41)
Class 2(0.19, 0.26)
Class 1 (0, 0.19)

BITS Pilani, Pilani Campus


Next Fit algorithm

Class4 (0.41,1)
Class 3(0.26,0.41)
Class 2(0.19, 0.26)
Class 1(0, 0.19)

BITS Pilani, Pilani Campus


Bin packing algorithm

Allocate tasks to processors:


Individual processors are scheduled using EDF

Bin packing algorithm


• First fit algorithm
• Best fit algoritm
• Worst fit algorithm
• First fit decreasing algorithms

BITS Pilani, Pilani Campus


First Fit algorithm

• Tasks with utilization are selected and packed in a bin.


• If bin exceeds 100% on further addition of tasks bin2 is
started to be packed.
• Task Utilizations are always whether they can be packed
fully on previous processors.

BITS Pilani, Pilani Campus


First Fit algorithm

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

BITS Pilani, Pilani Campus


Bin packing algorithm

Best Fit Algorithm:


• It takes the processors and finds out that processor
among the set of all processors which has the least
capacity and can hold the next task.
Example:
P1 utilization: 0.5
P2 utilization: 0.6
P3 utilization: 0.4
P4 utilization: 0.8
Let a task with e/p = 0.24 arrives . To which processor the
task will be assigned?

BITS Pilani, Pilani Campus


Bin packing algorithm

Worst Fit Algorithm:


• Places the next task onto the processor which has the
highest remaining capacity
Example:
P1 utilization: 0.5
P2 utilization: 0.6
P3 utilization: 0.4
P4 utilization: 0.8
Let a task with e/p = 0.32 arrives . To which processor the
task will be assigned?

BITS Pilani, Pilani Campus


First fit decreasing algorithm

Tasks are sorted in the decreasing order of their utilization.

Tasks are selected one by one:


• Assigned to the bin( Processor) to which it can fit in
( utilization does not exceed 1)
• Assigned to the processor to which it first fits.

BITS Pilani, Pilani Campus


First fit decreasing algorithm

Let us assume that we have a set of these 9 tasks with


their utilization given below . Consider 6 processors.

BITS Pilani, Pilani Campus


First fit decreasing algorithm

1 0.83 0.66 0.5 0.5 0.5 0.33 0.33 0.1666


BITS Pilani, Pilani Campus
Dynamic allocation of Tasks

Required when tasks arrive asynchronously at different


nodes:
• Tasks are assigned to the processors as and when they
arise.

Incur high run time overhead:


• The allocator at every node needs to keep track of the
load position at every other node.

BITS Pilani, Pilani Campus


Focussed Addressing and
Bidding
Every processor maintains two tables:

• Status table

• System load table

BITS Pilani, Pilani Campus


Focussed Addressing and
Bidding
Every processor maintains two tables:

• Status table: Contains information about the tasks which


it has committed to run, including information about the
execution time and periods of the tasks.

• System load table: Latest load information of all other


processors of the system.

BITS Pilani, Pilani Campus


Focussed Addressing and
Bidding
The time Axis is divided into windows:
• An window is an interval of fixed duration.

At the end of each window:


• Examine their status table
• Each processor broadcast the fraction of its computing
power in the next window.

Every Processor on receiving a broadcast:


• Updates the system load table

BITS Pilani, Pilani Campus


Focused addressing and
Bidding
When a task arise at a processor, it checks whether the
task can be processed locally itself.

If it can be processed, it updates its status table

If not, then:
• Examines system load table to look for a processor to
offload the task.

BITS Pilani, Pilani Campus


Request for Bid (RFB)

An overloaded node sends out RFBs:

• To the identified lightly loaded processors(The focussed


processors)

By the time the processor gets RFB:


• The focussed processor might have become overloaded.

BITS Pilani, Pilani Campus


Focused addressing and
Bidding
Specifically two time tbid and toffload are calculated. If
tbid<=toffload, then RFB is sent out.

tbid = (estimated time taken by RFB to reach its destination)


+ (the estimated time taken by the destination to respond
with a bid) + (the estimated time taken to transmit the bid
to the processor);

toffload = (task deadline) ‐ [(current time) + (time to move the


task) + (task execution time)];

○ If tbid ≤ toffload; then RFB is sent out


BITS Pilani, Pilani Campus
Focused addressing and
Bidding

The processor that had sent RFB, waits for bids to arrive or
until a specified time has expired since receiving the
task.

Among the bids received, the processor selects one


processor and transfers the task.

BITS Pilani, Pilani Campus


Focused addressing and
Bidding
 The algorithm incurs high communication overhead:
• Periodic transmission of status messages
• Focussed addressing and Bidding

 Communication overhead largely depends on the


window size selected.

 If the window size is large, communication overhead is


reduced.

 However the information at various processors would be


obsolete.
BITS Pilani, Pilani Campus
Buddy Set Algorithm

• Tries to overcome the high communication overhead of


focused addressing and bidding algorithm.

• Very similar to focussed addressing and bidding


algorithm

• Differs in the manner in which the target processor are


found.

BITS Pilani, Pilani Campus


Buddy Set Algorithm

A processor can be in any of the following two states:


• Under loaded
• Overloaded

No periodic broadcast required:


• Broadcast made only when the status of a processor
changes
• Either from overloaded to under loaded or vice versa.

BITS Pilani, Pilani Campus


Buddy Set Algorithm

• Whenever the status of a processor change, it does not


broadcast this information to all processor

• Limits broadcasts only to a subset of processors called


its Buddy set.

BITS Pilani, Pilani Campus


Design of Buddy Set

Design of the buddy set is an important parameter:


• It should not be too large not too small

In multi-hop networks:
• The buddy set of a processor is typically the processors
that are its immediate neighbours.

BITS Pilani, Pilani Campus


Buddy Set Algorithm

Node state: Threshold- based:


• Underloaded
• Overloaded

Selection policy:
• The tasks that fail admission test at the local node are
considered for transfer.

BITS Pilani, Pilani Campus


Buddy Set algorithm

Information policy:
• Based on buddy set
• When a node makes transition into or out of a state, it
informs its buddies

Transfer policy:
• One of the buddies is chosen as the receiver, based on
the load information available.

BITS Pilani, Pilani Campus


Buddy Set Algorithm

6 7

4
5

2
3

0
1

BITS Pilani, Pilani Campus


Buddy Set Algorithm

6 7

4
5

2
3

0
1

BITS Pilani, Pilani Campus


Buddy Set Algorithm P 1 2 3 4 5 6 7
0 1 2 4
1 3 5 0
2 6 0 3
3 2 1 7
6 7 4 0 6 5
5 7 4 1
6 4 2 5
4 7 5 3 6
5

2
3

0
1

BITS Pilani, Pilani Campus


Buddy Set Algorithm P 1 2 3 4 5 6 7
0 1 2 4 3 5 6
1 3 5 0 2 7 4
2 6 0 3 4 7 1
3 2 1 7 6 0 5
6 7 4 0 6 5 1 2 7
5 7 4 1 3 6 0
6 4 2 5
7 0 5 3
4 7 5 3 6 4 1 2
5

2
3

0
1

BITS Pilani, Pilani Campus


Buddy Set Algorithm P 1 2 3 4 5 6 7
0 1 2 4 3 5 6 7
1 3 5 0 2 7
4 4
7 6
2 6 0 3 4
1 7 1
4 5
3 2 1 7 6
0 0
6 5 4
6 7 4 0 6 5 1
7 2
1 7
2 3
5 7 4 1 3
6 6
0 0
3 2
6 4 2 7
5 0
5 5
3 3
0 1
4 7 5 3 6 4 1
2 2
1 0
5

2
3

0
1

BITS Pilani, Pilani Campus


Buddy Set Algorithm - Issues

 Choosing buddy set


• Too large set: High Communication over head
• Too small set: May not be able to find a suitable receiver
with in a buddy set.
• Topology needs to be taken into account while choosing
the buddy nodes.

 Choice of thresholds:
• Large upper threshold: Lower the rate at which tasks will
be migrated.
• The choice of thresholds depend on size of buddy set,
topology.
BITS Pilani, Pilani Campus
Buddy Set Algorithm - Issues

 Thrashing
• A node X, could be a buddy for several nodes. When
many of these several nodes become overloaded, they
migrate their tasks to the node X and making it
overloaded. This results in further migration of task.

• Therefore, the buddy set should be carefully constructed.

BITS Pilani, Pilani Campus

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy