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
5 pts Suppose that MPI COMM_WORLD consists of the three processes 0. 1. and 2, and suppose the following code is execute
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
5 pts Suppose that MPI COMM_WORLD consists of the three processes 0. 1. and 2, and suppose the following code is execute
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!