Answered step by step
Verified Expert Solution
Question
1 Approved Answer
code with MPI command (1) Write a program named partialSum.c such that each processor will compute and print out a partial sum of N numbers.
code with MPI command
(1) Write a program named partialSum.c such that each processor will compute and print out a partial sum of N numbers. Set N=1000 in your program and define 10 processors in job 100 script file, then processor O will print out the partial sum of 1+2+...+100 (that is, Zi), processor 1 will print out the partial sum of 101+102+...+200(that is, 200 i),... i-101 1000 processor 9 will print out the partial sum of 901+902+...+1000(that is, Zi).. 1-901 (Note: In this program, you can declare a constant N=1000 or use preprocessing statement #define N 1000.) (2) When you finish the program, check whether you have file named like slurm- Xxxxx.out in the current directory. Open the file slurm-xxxxx.out and check the content. You should have the following content: Please remove files that are not needed anymore. Partial sum from process of total 10 is : 5050. Partial sum from process 6 of total 10 is : 65050. Partial sum from process 3 of total 10 is : 35050. Partial sum from process 7 of total 10 is : 75050. Partial sum from process 2 of total 10 is : 25050. Partial sum from process 9 of total 10 is : 95050. Partial sum from process 5 of total 10 is : 55050. Partial sum from process 4 of total 10 is : 45050. Partial sum from process 8 of total 10 is : 85050. Partial sum from process 1 of total 10 is : 15050. (3) Revise your script file to apply for 16 nodes, and then run your program again. (1) Write a program named partialSum.c such that each processor will compute and print out a partial sum of N numbers. Set N=1000 in your program and define 10 processors in job 100 script file, then processor O will print out the partial sum of 1+2+...+100 (that is, Zi), processor 1 will print out the partial sum of 101+102+...+200(that is, 200 i),... i-101 1000 processor 9 will print out the partial sum of 901+902+...+1000(that is, Zi).. 1-901 (Note: In this program, you can declare a constant N=1000 or use preprocessing statement #define N 1000.) (2) When you finish the program, check whether you have file named like slurm- Xxxxx.out in the current directory. Open the file slurm-xxxxx.out and check the content. You should have the following content: Please remove files that are not needed anymore. Partial sum from process of total 10 is : 5050. Partial sum from process 6 of total 10 is : 65050. Partial sum from process 3 of total 10 is : 35050. Partial sum from process 7 of total 10 is : 75050. Partial sum from process 2 of total 10 is : 25050. Partial sum from process 9 of total 10 is : 95050. Partial sum from process 5 of total 10 is : 55050. Partial sum from process 4 of total 10 is : 45050. Partial sum from process 8 of total 10 is : 85050. Partial sum from process 1 of total 10 is : 15050. (3) Revise your script file to apply for 16 nodes, and then run your program againStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started