0% found this document useful (0 votes)
19 views

Assignment 1

This document provides instructions for Assignment #1, which is due on July 15, 2023 at 6:00 PM. Students must submit a zip file via Google Classroom containing a C++ program that simulates a job scheduling system for a multi-node cluster using four different scheduling algorithms: Priority Scheduling, Round Robin with time quantums of 8 and 10, and First Come First Serve. The program should take job data as input and output the execution order, waiting time, and turnaround time for each job and the average times for each algorithm.

Uploaded by

Abdul Wahab
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Assignment 1

This document provides instructions for Assignment #1, which is due on July 15, 2023 at 6:00 PM. Students must submit a zip file via Google Classroom containing a C++ program that simulates a job scheduling system for a multi-node cluster using four different scheduling algorithms: Priority Scheduling, Round Robin with time quantums of 8 and 10, and First Come First Serve. The program should take job data as input and output the execution order, waiting time, and turnaround time for each job and the average times for each algorithm.

Uploaded by

Abdul Wahab
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Assignment # 1

Due Date: 15 July 2023 6:00 PM

______________________________________________________________________________

Important Instructions:

1. The students who are involved in plagiarism will get zero marks.
2. Start early so you can finish on time. No extra time will be given.
3. All the submissions must be on google classroom.
4. You have to submit zip file that will include .cpp file and screenshots of output.
5. You have to submit one zipped file containing the solution code files. (i20-
XXXX_Assignment1.zip)
6. Be prepared for demos after the submission of the assignment within two weeks.
______________________________________________________________________________

QUESTION
You are tasked with simulating a job scheduling system for a multi-node cluster. The cluster consists of
multiple compute nodes, and each node can execute one job at a time. The goal is to optimize the usage of
cluster resources and minimize job wait times.

Each job has the following attributes:

• Job ID (unique identifier for each job)


• Arrival Time (the time at which the job arrives in the system)
• Execution Time (the time required by the job to complete)
• Priority (the priority level of the job)

The scheduling system follows the following rules:

1. Priority Scheduling: Jobs with higher priority values have higher precedence. If multiple jobs
have the same priority, the job with the lower job ID gets executed first.
2. Preemption: If a job with higher priority arrives while a job with lower priority is executing, the
current job gets preempted and the higher-priority job gets executed. The preempted job will
resume execution when resources are available.
3. Round Robin: Each job gets a fixed time quantum to execute. If a job doesn't complete within the
time quantum, it gets preempted, and the next job in the queue gets executed.
4. Queue Swapping: Jobs can move between different queues based on their priority. A job can
move from a lower-priority queue to a higher-priority queue only when all higher-priority queues
are empty. Jobs can move from a higher-priority queue to a lower-priority queue at any time.

Your task is to design and implement a scheduling algorithm that meets the requirements mentioned
above. You have to implement following algorithms:
• Priority Scheduling
• Round Robin (Quantum=8)
• Round Robin (Quantum=10)
• First Come First Serve (FCFS)

Your program should take input from a file in the following format:

Each job entry is on a new line. For example:

Upon successful scheduling of jobs, your program should print the following for each scheduling
algorithm:

1. The order in which jobs are executed.


2. The waiting time and turnaround time for each job.
3. The average waiting time and average turnaround time for each scheduling algorithm.

NOTE:
You have to implement this using C++.

You might also like