Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello data structures and algorithms experts I am working on a final project for a data structures and algorithms course and need a hand to

Hello data structures and algorithms experts

I am working on a final project for a data structures and algorithms course and need a hand to get it done. I am simulating a cluster management system in C++. I am providing some pictures to the details of the project. I can write the data structures implementations.

I need help in choosing the appropriate data structures for this project (please provide a justification for your choice of data structures) and also need help with the program logic. No need to provide a written code, you can just guide me through the process verbally and I will get the code done. The reason why I dont need code is that I am late and need those answers ASAP. I have to finish it by tomorrow midnight but if you can provide some of the code quickly, it will be much of a help.

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

Introduction Continuous advancements in the scientific and technological fields have created the need for increasingly capable computational workstations. A computer cluster is a set of computers that work together as one system to achieve some goal(s). The cluster contains several computers (referred to as workers/machines), which can vary in capabilities and peripherals. There are different processes that need to be executed, which are assigned to suitable machines. In this project, we will assume our cluster follows a master/slave architecture, in which there is a master node that divides the workload among the different nodes (workers). The master node acts as the central point which assigns processes to machines and receives notifications from machines after process completion. If we suppose that new processes arrive regularly, we then need to assign the new processes to the different machines that we have available. Using your programming skills and your knowledge of the different data structures, you are going to develop a program that simulates process assignment and calculates some related statistics in order to help improve the overall process. Processes and Machines There is a number of available machines that can be assigned the different issued processes. Processes: The following pieces of information are available for each process: Arrival Time: the clock cycle when the process arrives and is ready to be assigned to a machine Process Type: There are three types of processes: system processes, interactive processes, and computationally intensive processes. System processes must be assigned first. Interactive processes are processes that require end user interaction. They must be executed by machines equipped with 10 peripherals. Computationally intensive processes are jobs that ran without end user interaction, and require a large amount of resources. They must be issued to machines equipped with the needed hardware. Dispatch latency: The number of clock cycles needed to dispatch the process to a machine. Execution time: The number of clock cycles needed to execute the process (assumed constant regardless of machine type). Priority: A mumber representing the importance of the process (the higher the number, the more important the process). Machines: At startup, the system loads (from a file) information about the available machines. For each machine, the system will load the following information: Machine Type: There are three types of machines: general-pupose machines, interactive machines, and GPU machines. General-purpose machines are machines with standard computing resources and I/O peripherals. Interactive machines are machines equipped with highly capable 10 devices. GPU machines are machines equipped with graphics processing units (GPU) that are specialized for intensive computations Reboot Duration: The duration (in clock cycles) of system reboot that a machine needs to perform after completing processes Response time. The duration of time (in clock cycles) between dispatching the process to the machine, and the time it starts executing the process. NOTE: Reboot duration and response time are the same for all machines of the same type. Process Dispatch Criteria To determine the next process to dispatch (if a machine is available), the following assigoment criteria should be applied for all the waiting, unassigned processes at each clock cycle: 1. First, assign system processes to ANY available machine of any type. However, there is a priority based on machine type: first, choose from general-purpose machines THEN interactive machines THEN GPU machines. This means that we do not use interactive machines unless all general- purpose machines are busy, and we do not use GPU machines unless machines of both the other types are busy 2. Secondassign computationally intensive processes using the available GPU machines ONLY. IF all GPU machines are busy, wait until one is available. 3. Third, assign interactive processes using any type of machines EXCEPT GPU machines. First, use the available interactive machines THEN general-purpose machines. 4. If a process cannot be assigned at the current clock cycle, it should wait for the next cycle. At the next cycle, it should be checked whether the process can be assigned now or not. If not, it should wait again, and so on. NOTES: If processes of a specific type cannot be assigned at the curent cycle, try to assign the other types (eg if system processes cannot be assigned at the current cycle, this does NOT mean not to assie the interactive processes) This is how we prioritize the assignment of processes of different types, but how will we prioritize the assignment of processes of the same type? For interactive and computationally intensive processes, assign them based on a first-come- first-served basis. For system processes, you should design a priority equation for deciding which of the available system processes should be assigned first System processes with a higher priority are the ones to be assigned first. - You should develop a reasonable weighted priority equation depending on at least the following factors: process arrival time, process dispatch latency process execution time, and process priority There are some additional services that the master pode has to accommodate: For interactive processes ONLY a request can be issued to promote the process type to become a system process. A request of process cancellation could also be issued. . For interactive processes ONLY if a process waits more than Autop cycles from its arrival time to be assigned to a machine, it should be automatically promoted to be a system process. (AutoP is read from the input file). . Simulation Approach & Assumptions You will use incremental clock cycle steps. Simulate the changes in the system every 1 processor cyde. Some Definitions Arrival Time (AT): The clock cycle at which the process arrives and is ready to be assigned Waiting Process: A process that has arrived (ie. process AT S3 interactive machine #5 assigned to system process #3 Total number of processes completed so far of each type 2. Step-by-Step Mode is identical to the interactive mode except that after each cycle, the program waits for one second (not for user input) then resumes automatically. 3. In Silent Mode, the program produces only an output file (See the "File Formats" section). It does not print anything on the console NOTE: No matter what mode of operation your program is running in the output file should be produced Appendix A-Guidelines on Project Framework The main classes of the project should be MasterNode. Process, Machine. Event, and UI (User Interface) Event Classes: There are three types of events: Arrival. Cancellation, and Promotion events. You should create a base class called "Event" that stores the event time and the related process D. This should be an abstract class with a pure virtual function "Execute". The logic of the Execute function should depend on the Event type. For each type of the three events, there should be a class derived from Event class. Each derived class should store data related to its operation. Also, each of them should ovemide the function Execute as follows: 1. ArrivalEvent:Execute should create a new process and add it to the appropriate list 2. CancelEvent:Execute should cancel the requested system process (if found and is waiting) 3. Prompte Event::Execute should move a system process to the computationally intensive list and update the process data (if found and is waiting) Class MasterNode should have an appropriate list of Event pointers to store all events loaded from the file at system startup. At each clock cycle, the code loops on the event list to execute all events that should take place at the current cycle UI Class This should be the class responsible for taking in any inputs from the user and printing any information on the console. It contains the input and output functions that you should use to show status of processes at each cycle. Main members of class UI: PROG_MODE getProgram Model): This function should be caled at the very beginning to get the program mode from the user PROG_MODE is an enum containing the different modes of the program. void printString(std::string text): Prints text on the console. void wait For User(): This function will wait for input from the user needed in the interactive mode) static void sleep(int milliseconds): Block the program for a certain time (needed in the step-by- step mode) You might want to add other functions like void addToWaitingString(std::string text) to add to the string of the waiting processes and similar ones for the rest of the lines that should be printed on the console) Introduction Continuous advancements in the scientific and technological fields have created the need for increasingly capable computational workstations. A computer cluster is a set of computers that work together as one system to achieve some goal(s). The cluster contains several computers (referred to as workers/machines), which can vary in capabilities and peripherals. There are different processes that need to be executed, which are assigned to suitable machines. In this project, we will assume our cluster follows a master/slave architecture, in which there is a master node that divides the workload among the different nodes (workers). The master node acts as the central point which assigns processes to machines and receives notifications from machines after process completion. If we suppose that new processes arrive regularly, we then need to assign the new processes to the different machines that we have available. Using your programming skills and your knowledge of the different data structures, you are going to develop a program that simulates process assignment and calculates some related statistics in order to help improve the overall process. Processes and Machines There is a number of available machines that can be assigned the different issued processes. Processes: The following pieces of information are available for each process: Arrival Time: the clock cycle when the process arrives and is ready to be assigned to a machine Process Type: There are three types of processes: system processes, interactive processes, and computationally intensive processes. System processes must be assigned first. Interactive processes are processes that require end user interaction. They must be executed by machines equipped with 10 peripherals. Computationally intensive processes are jobs that ran without end user interaction, and require a large amount of resources. They must be issued to machines equipped with the needed hardware. Dispatch latency: The number of clock cycles needed to dispatch the process to a machine. Execution time: The number of clock cycles needed to execute the process (assumed constant regardless of machine type). Priority: A mumber representing the importance of the process (the higher the number, the more important the process). Machines: At startup, the system loads (from a file) information about the available machines. For each machine, the system will load the following information: Machine Type: There are three types of machines: general-pupose machines, interactive machines, and GPU machines. General-purpose machines are machines with standard computing resources and I/O peripherals. Interactive machines are machines equipped with highly capable 10 devices. GPU machines are machines equipped with graphics processing units (GPU) that are specialized for intensive computations Reboot Duration: The duration (in clock cycles) of system reboot that a machine needs to perform after completing processes Response time. The duration of time (in clock cycles) between dispatching the process to the machine, and the time it starts executing the process. NOTE: Reboot duration and response time are the same for all machines of the same type. Process Dispatch Criteria To determine the next process to dispatch (if a machine is available), the following assigoment criteria should be applied for all the waiting, unassigned processes at each clock cycle: 1. First, assign system processes to ANY available machine of any type. However, there is a priority based on machine type: first, choose from general-purpose machines THEN interactive machines THEN GPU machines. This means that we do not use interactive machines unless all general- purpose machines are busy, and we do not use GPU machines unless machines of both the other types are busy 2. Secondassign computationally intensive processes using the available GPU machines ONLY. IF all GPU machines are busy, wait until one is available. 3. Third, assign interactive processes using any type of machines EXCEPT GPU machines. First, use the available interactive machines THEN general-purpose machines. 4. If a process cannot be assigned at the current clock cycle, it should wait for the next cycle. At the next cycle, it should be checked whether the process can be assigned now or not. If not, it should wait again, and so on. NOTES: If processes of a specific type cannot be assigned at the curent cycle, try to assign the other types (eg if system processes cannot be assigned at the current cycle, this does NOT mean not to assie the interactive processes) This is how we prioritize the assignment of processes of different types, but how will we prioritize the assignment of processes of the same type? For interactive and computationally intensive processes, assign them based on a first-come- first-served basis. For system processes, you should design a priority equation for deciding which of the available system processes should be assigned first System processes with a higher priority are the ones to be assigned first. - You should develop a reasonable weighted priority equation depending on at least the following factors: process arrival time, process dispatch latency process execution time, and process priority There are some additional services that the master pode has to accommodate: For interactive processes ONLY a request can be issued to promote the process type to become a system process. A request of process cancellation could also be issued. . For interactive processes ONLY if a process waits more than Autop cycles from its arrival time to be assigned to a machine, it should be automatically promoted to be a system process. (AutoP is read from the input file). . Simulation Approach & Assumptions You will use incremental clock cycle steps. Simulate the changes in the system every 1 processor cyde. Some Definitions Arrival Time (AT): The clock cycle at which the process arrives and is ready to be assigned Waiting Process: A process that has arrived (ie. process AT S3 interactive machine #5 assigned to system process #3 Total number of processes completed so far of each type 2. Step-by-Step Mode is identical to the interactive mode except that after each cycle, the program waits for one second (not for user input) then resumes automatically. 3. In Silent Mode, the program produces only an output file (See the "File Formats" section). It does not print anything on the console NOTE: No matter what mode of operation your program is running in the output file should be produced Appendix A-Guidelines on Project Framework The main classes of the project should be MasterNode. Process, Machine. Event, and UI (User Interface) Event Classes: There are three types of events: Arrival. Cancellation, and Promotion events. You should create a base class called "Event" that stores the event time and the related process D. This should be an abstract class with a pure virtual function "Execute". The logic of the Execute function should depend on the Event type. For each type of the three events, there should be a class derived from Event class. Each derived class should store data related to its operation. Also, each of them should ovemide the function Execute as follows: 1. ArrivalEvent:Execute should create a new process and add it to the appropriate list 2. CancelEvent:Execute should cancel the requested system process (if found and is waiting) 3. Prompte Event::Execute should move a system process to the computationally intensive list and update the process data (if found and is waiting) Class MasterNode should have an appropriate list of Event pointers to store all events loaded from the file at system startup. At each clock cycle, the code loops on the event list to execute all events that should take place at the current cycle UI Class This should be the class responsible for taking in any inputs from the user and printing any information on the console. It contains the input and output functions that you should use to show status of processes at each cycle. Main members of class UI: PROG_MODE getProgram Model): This function should be caled at the very beginning to get the program mode from the user PROG_MODE is an enum containing the different modes of the program. void printString(std::string text): Prints text on the console. void wait For User(): This function will wait for input from the user needed in the interactive mode) static void sleep(int milliseconds): Block the program for a certain time (needed in the step-by- step mode) You might want to add other functions like void addToWaitingString(std::string text) to add to the string of the waiting processes and similar ones for the rest of the lines that should be printed on the console)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Development Of Knowledge Framework For Affective Content Analysis

Authors: Swarnangini Sinha

1st Edition

B0CQJ13WZ1, 979-8223977490

More Books

Students also viewed these Databases questions