Page 1 of 1

5 pts Suppose that MPI COMM_WORLD consists of the three processes 0. 1. and 2, and suppose the following code is execute

Posted: Sun May 15, 2022 1:12 pm
by answerhappygod
5 Pts Suppose That Mpi Comm World Consists Of The Three Processes 0 1 And 2 And Suppose The Following Code Is Execute 1
5 Pts Suppose That Mpi Comm World Consists Of The Three Processes 0 1 And 2 And Suppose The Following Code Is Execute 1 (65.49 KiB) Viewed 70 times
5 Pts Suppose That Mpi Comm World Consists Of The Three Processes 0 1 And 2 And Suppose The Following Code Is Execute 2
5 Pts Suppose That Mpi Comm World Consists Of The Three Processes 0 1 And 2 And Suppose The Following Code Is Execute 2 (34.48 KiB) Viewed 70 times
5 pts Suppose that MPI COMM_WORLD consists of the three processes 0. 1. and 2, and suppose the following code is executed: int x, y, z: switch (my_rank) case 0: X-0: y = 1:2 = 2: MPL_Bcast(&x, 1, MPI_INT, O, MPI_COMM_WORLD): MPI_Send(&y. 1. MPL_INT. 2, 43, MPI_COMM_WORLD); MPL_Bcast(&z 1. MPLINT, 1. MPL_COMM_WORLD): break; case 1: x = 3; y = 4: z = 5: MPI_Bcast(&x, 1. MPLLINT, O, MPI_COMM_WORLD): MPI_Bcast(&y. 1, MPL_INT 1.MPI_COMM WORLD): break; case 2: x = 6;y = 7:2-8; MPL_Bcast(&z. 1, MPI_INT, O, MPI_COMM_WORLD): MPI Recv(&x, 1. MPLINT, 0.43, MPILCOMM WORLD. &status); MPI_Bcast(&y, 1. MPI_INT, 1. MPI_COMM_WORLD): break; } What are the values of x, y, and 2 on each process after the code has been executed?

What are the values of x, y, and 2 on each process after the code has been executed? O Rank-zero process: x=0.y=1,2=4; Rank-one process: x= 0, y=4z=5; Rank-two process:x-1, y=4, z=0 O Rank-zero process: x=0,y=1,z=4; Rank-one process: x=0.y=4,2-5; Rank-two process: x-0. y 4. z-5 O Rank-zero process: x=0,7-1,2-2, Rank-one process: X-3, y-4,2-5; Rank-two process: x=0, y-4,2-5 Rank-zero process: x=0,y=1,2-2, Rank-one process: x= 3.-4,2-5; Rank-two process: X-1, y 4,2=0