Write an efficient parallel program with dynamic task assignment that reads n integers from any input file and finds the 2nd largest (without sorting), using p processors (p << n). Assume m is the largest array size slave computers can handle due to memory limitation (m << n/p) and n is divisible by m. Note: Master has no memory limitation.
Write an efficient parallel
Assume m is the largest array size slave computers can handle due to memory limitation (m << n/p) and n is divisible by m.
Note: Master has no memory limitation.
Please do as follow:
Name your file xxxxxH2.c, where xxxxx is at most the first 5 characters of your last name and H2 is the program number.
Remember all I/O should be done ONLY by master.
Your program should be modular i.e. using subprograms.
Make sure to print input data.
Print your name at the end of OUTPUT.
To execute: mpiexec -n p a.out n m < inputfile
Example: mpiexec -n 3 a.out 120 15 < inputfile
Step by step
Solved in 3 steps