Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Select the correct output of the following MPI program, assuming that 3 processes were launched to run the program/ is that the correct one :data
Select the correct output of the following MPI program, assuming that 3 processes were launched to run the program/ is that the correct one :data on rank 0 is 1 1 is 4 2 is 9?
from mpi 4py import MPI comm = MPI.COMM WORLD size = comm. Get_size() rank = comm. Get_rank() if rank == 0: data = [(i+1) **2 for i in range (size)] else: data = None data = comm.scatter (data, root=0) assert data == (rank+1) **2 print ("data on rank %d is: %s" % (rank, data))
Step 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