Question: Write a program to approximate (using the Trapezoidal rule) the integral of rcos (2) dr by using N processes to sum up n trapezoids (n>N).

 Write a program to approximate (using the Trapezoidal rule) the integral

Write a program to approximate (using the Trapezoidal rule) the integral of rcos (2) dr by using N processes to sum up n trapezoids (n>N). N should vary in the range of 1 to 8, while n will be input by the user. The parent process should create N (c [1, 8]), child processes using fork0. There should be N pairs of pipes through which the parent process assigns jobs to associated child processes, and receives results back from them when the calculation is completed. More specifically, the parent process will initialy assign the first N pieces to the N child processes to do their respective calculation. Whenever a process has done its calculation of the area of another trapezoid, it will send it back to the parent process. Upon receiving such a piece, the parent process will update the sum accordingly, and, if there are still un-calculated pieces, the parent will also assign the next piece to the just returned child process. After the parent has received all the n results, it prints out the final

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!