Assignment 1
Assignment 1
______________________________________________________________________________
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.
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:
Upon successful scheduling of jobs, your program should print the following for each scheduling
algorithm:
NOTE:
You have to implement this using C++.