Do My Homework / Homework Help Answers / Computer Science Homework Help / MPI C Parallel Programming Assistance

MPI C Parallel Programming Assistance

Online tutoring services

Need help with this question or any other Computer Science assignment help task? Click on the button below to to hire an expert cheap.

Complete the program 'Bcast-Reduce-Assignment.c' (Refer to 'Bcast-Reduce-Example.c') to make the program have the output as follows if we run the program using 2 processes. The input sequence is: 0 1 2 3 The output sequence is: 0 2 6 12 #include #include #include int main(void) { int my_rank, comm_sz; int i; int Count = 4; int Number[4]; int Result[4]; MPI_Init(NULL, NULL); MPI_Comm_size(MPI_COMM_WORLD, &comm_sz); MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); if(my_rank == 0) { printf("The input sequence is: \n"); for (i = 0; i < Count; i++) { Number[i] = i; printf("%d ", Number[i]); } printf("\n"); } // Process 0 sends data to all of the processes MPI_Bcast(Number, Count, MPI_INT, 0, MPI_COMM_WORLD); for (i = 0; i < Count; i++) Number[i] += my_rank; PartialResult += Number[i]; MPI_Reduce(&PartialResult , &Result, 1 , MPI_INT, MPI_PROD, 0, MPI_COMM_WORLD); // Print out the result if (my_rank == 0) { printf("The output sequence is: \n"); printf("\n"); } MPI_Finalize(); return 0; }

Get Help With a similar task to - MPI C Parallel Programming Assistance

Login to view and/or buy answers.. or post an answer

Related Questions

Similar orders to MPI C Parallel Programming Assistance
7
Views
0
Answers
Completing data in python to answer homework.
I would like this assignment done accurately and professionally because I do not understand. I need it to be answered in python as listed in the assignment. Any additional documents needed I would be happy to send....
9
Views
0
Answers
For this task, you will be creating a little app that helps people convert 8-bit binary numbers to integers.
Binary Buttons - For this task, you will be creating a little app that helps people convert 8-bit binary numbers to integers. For more info on binary numbers check out this link: https://www.youtube.com/watch?v=ewokFOSxabs . Your program will let the user click bits “on” (white) or “off” (black) and then display the resulting integer to the screen:...
8
Views
0
Answers
C++ OOP inheritances assignment
A detailed step by step assignment for the student, which revolves around OOP, I need a one on one session for maybe around 45 mins to go over the assignment...
15
Views
0
Answers
I need a pass on a project for my studies - API
I need a pass on a project for my studies. Everything is in the API Project Brief. Data already created ready to implement. Javascript - MongoDB - Mongoose...