Introduction to Programming with MPI ------------------------------------ Practical Exercise 15 (One-Sided Communication) ----------------------------------------------- For general instructions, see the introduction to the collective practicals. Question 1 ---------- 1.1 Write a program that creates an integer array of length 3 in each process with the following data: Process 0: 11, 12, 13 Process 1: 21, 22, 23 Process 2: 31, 32, 33 Process 3: 41, 42, 43 Use one-sided communication (MPI_Put) with collective synchronisation (i.e. MPI_Fence) to copy the first element of the array to the current process, rotate the second element of the array to the next process (with the last going to the first) and the third element to the previous process (with the first process going to the last). I.e. the result should be: Process 0: 11, 42, 23 Process 1: 21, 12, 33 Process 2: 31, 22, 43 Process 3: 41, 32, 13 1.2 Change the program to use MPI_Get. 1.3 Change the program to do a transposing reduction, with the first process receiving the product of the first elements of the array on each process, and so on. I.e. the result should be: Process 0: 293601 [ = 11*21*31*41 ] Process 1: 354816 [ = 12*22*32*42 ] Process 2: 424281 [ = 13*23*33*43 ] Process 3: 1 Question 2 ---------- 2.1 Take a copy of the program you wrote in question 3.1 in practical exercise 4, that was called 'Daggoo', and change it to use one-sided communication. This is simply repeating 1.1 in practical exercise 7, in a one-sided communication variant. The result should be functionally equivalent. There are no specimen answers to this question. 2.2 Take a copy of the program you wrote in question 5.1 in practical exercise 3, that was called 'Stubb', and write a replacement for MPI_Alltoall, using one-sided communication. This is simply repeating exercise 5.1 in practical exercise 4 and exercise 2.1 in practical exercise 7, in a one-sided communication variant. The result should be functionally equivalent. There are no specimen answers to this question.