README.md 861 Bytes
Newer Older
Jussi Enkovaara's avatar
Jussi Enkovaara committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
## Collective operations

In this exercise we test different routines for collective
communication. Write a program for four MPI processes, such that each
process has a data vector with the following data:

![](img/sendbuffer.png)

In addition, each task has a receive buffer for eight elements and the
values in the buffer are initialized to -1.

Implement communication that sends and receives values from these data
vectors to the receive buffers using a single collective routine in
each case, so that the receive buffers will have the following values:

a) 

![](img/bcast.png)

b) 

![](img/scatter.png)

c) 

![](img/gatherv.png)

d) 

![](img/alltoall.png)


You can start from scratch or use the skeleton code found in
[c/collective.c](c/collective.c),
[fortran/collective.F90](fortran/collective.F90) or
[python/collective.py](python/collective.py)