subject

Write an mpi program named intro_mpi. c that performs the following tasks. assume that the mpi program is going to be run with 8 processes. have process 0 creates a 16-element array of integers named arrayzero and randomly initializes each element in this array. using mpi_send and mpi_recv, have process 0 sends the second element in this array to process 1. output the second element of arrayzero in process 0 and a variable contained the newly sent data in process 1 to verify the communication. using mpi_broadcast, broadcast the content of the variable of process 1 from task 1 to all other processes, to be saved in a new variable called fromone. output this variable from all eight processes to verify the communication. using mpi_reduce, calculate the sum of the fromone variables (task 2) of all the processes and store the final value in process 2. using mpi_scatter, scatter the 16-element array from process 0 into 2-element arrays named fromarray at all other processes. output the content of fromarray for each process for verification purposes. using mpi_gather, gather the fromarray arrays into a second array in process 0 named arrayone. for process 0 only, output arrayzero and arrayone for verification purposes

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 01:00
Ap practice - performance task response the ap create performance task asks you to write about an abstraction that you developed and wrote into your code. most of the time that means identifying a function or procedure you wrote to "manage complexity" in your program. here is the actual prompt from the create performance task: 2d. capture and paste a program code segment that contains an abstraction you developed individually on your own (marked with a rectangle). this abstraction must integrate mathematical and logical concepts. explain how your abstraction manage the complexity of your program. (must not exceed 200 words) below is a segment of code from an "under the sea" program with a rectangle drawn around a portion of the code identifying an abstraction. imagine that you wrote this and are composing an ap response about how this abstraction manages complexity. (note: ignore the requirement that the abstraction integrate "mathematical and logical concepts" for this practice response. just write about managing complexity). explain how the abstraction marked with the rectangle in the code above manage complexity of this program. write your response here submit
Answers: 2
question
Computers and Technology, 22.06.2019 11:00
What are two of the most common reasons that peolpe who need mental health care do not access it?
Answers: 1
question
Computers and Technology, 22.06.2019 16:00
Why should characters such as / \ " ' * ; - ? [ ] ( ) ~ ! $ { } < > # @ & | space, tab, and newline be avoided in file names?
Answers: 2
question
Computers and Technology, 22.06.2019 17:00
The two main ways in which marketers address the competition with their strategies are by satisfying a need better than a competition and by
Answers: 2
You know the right answer?
Write an mpi program named intro_mpi. c that performs the following tasks. assume that the mpi progr...
Questions
question
Arts, 17.08.2020 23:01
Questions on the website: 13722360