Question: Problem 2: Introduction to multi-process environments and IPC (18 points Given a list of integers find the Minimum, Maximum, and the Sum of the numbers.


Problem 2: Introduction to multi-process environments and IPC (18 points Given a list of integers find the Minimum, Maximum, and the Sum of the numbers. The list will be in a text file you generate. You may use any form of inter-process communication (IPC) to partition the file/array into chunks and distribute work to more than one processes (if there are multiple ones) (e.g., pipes, shared memory, or additional (perhaps more sophisticated) inherent process system calls) Remark: Record the time it takes for each of the programs to run and comment on your observations. Try it on lists of size 10,100, 1k, 10k, 100k. Hint: You should first load the file into an array then start working on the data Input Format Input will be in a text file. Each integer will be separated by a newline character (In) 100 20 35 Output Format: You should print out the results in a text file. Every process that is created should print out their own process id and their parent's process id. Then once you have computed the final max, min, and sum, you will print those out. Please follow this format: Hi I'm process 2 and my parent is 1 Hi I'm process 3 and my parent is 2. Hi I'm process 4 and my parent is 2. Max-50 Min-1 Sum-371 Part A (4 pts): Write a program to answer this problem using only one process Part B (6 pts) : Write a program to answer this problem using multiple processes where each process spawns at most one process. (Like DFS) Scheme 1: Random Tree of processes Part C (8 process spawns multiple processes and they (the children) spawn their own multiple processes, and so on and so forth. Your ultimate goal should be to produce such a hierarchy of processes (process tree) that produces the final result (compared to Parts A and B) faster. Can you create an arbitrary number of processes or are there any limitations? If you do find you have limitations in your version of Linux OS, please show (e.g. via a printscreen or a file) what are your exact limitations in increasing the number of processes you will be generating. Why is this so? pts): Write a program to answer this problem using multiple processes where the first Problem 2: Introduction to multi-process environments and IPC (18 points Given a list of integers find the Minimum, Maximum, and the Sum of the numbers. The list will be in a text file you generate. You may use any form of inter-process communication (IPC) to partition the file/array into chunks and distribute work to more than one processes (if there are multiple ones) (e.g., pipes, shared memory, or additional (perhaps more sophisticated) inherent process system calls) Remark: Record the time it takes for each of the programs to run and comment on your observations. Try it on lists of size 10,100, 1k, 10k, 100k. Hint: You should first load the file into an array then start working on the data Input Format Input will be in a text file. Each integer will be separated by a newline character (In) 100 20 35 Output Format: You should print out the results in a text file. Every process that is created should print out their own process id and their parent's process id. Then once you have computed the final max, min, and sum, you will print those out. Please follow this format: Hi I'm process 2 and my parent is 1 Hi I'm process 3 and my parent is 2. Hi I'm process 4 and my parent is 2. Max-50 Min-1 Sum-371 Part A (4 pts): Write a program to answer this problem using only one process Part B (6 pts) : Write a program to answer this problem using multiple processes where each process spawns at most one process. (Like DFS) Scheme 1: Random Tree of processes Part C (8 process spawns multiple processes and they (the children) spawn their own multiple processes, and so on and so forth. Your ultimate goal should be to produce such a hierarchy of processes (process tree) that produces the final result (compared to Parts A and B) faster. Can you create an arbitrary number of processes or are there any limitations? If you do find you have limitations in your version of Linux OS, please show (e.g. via a printscreen or a file) what are your exact limitations in increasing the number of processes you will be generating. Why is this so? pts): Write a program to answer this problem using multiple processes where the first
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
