Hi,

> I wrote a litte MPI program to demonstrate the mpi_get() function
> (see attachment).
> 
> The idea behind the program is that a master process with rank 0
> fills an integer array with the size of MPI_Comm_size with values.
> The other processes should MPI_GET the value from this shared int
> array at the index of their rank.
> 
> We could compile the code, but execution will raise an error.

You use the following statements:

int rank, size, *a, *b, namelen, i, sizereal, flag;
...
MPI_Win_get_attr(win, MPI_WIN_SIZE, &sizereal, &flag);

The MPI 3.0 standard requires on page 416 that MPI_WIN_SIZE should
have type "MPI_Aint *".

tyr test_onesided 138 diff beispiel2_flo.c*
18c18
<       int rank, size, *a, *b, namelen, i,  flag;
---
>       int rank, size, *a, *b, namelen, i, sizereal, flag;
21d20
<       MPI_Aint *sizereal;
44c43
<       {
---
>       {+
54c53
<           printf("Real Size %d\n", *sizereal); 
---
>           printf("Real Size %d\n", sizereal); 
59c58
<         printf ("Process %d after MPI_Win_create()\n", rank);
---
>         printf ("Process %d after MPI_Win_create()\n");
77c76
<         printf("Prozess %d# hat Wert %d von Prozess 0 geholt\n", rank, *b);
---
>         printf("Prozess %d# hat Wert %d von Prozess 0 geholt\n", rank, b);
[2]  - Done                          xemacs beispiel2_flo.c
tyr test_onesided 139 


If you change the type of "sizereal" and fix some more bugs, you
get what you want.

tyr test_onesided 139 mpiexec -np 2 a.out
Guten Tag. Ich bin Prozess 1 von 2. Ich werde auf Host 
tyr.informatik.hs-fulda.de ausgefuehrt
Guten Tag. Ich bin Prozess 0 von 2. Ich werde auf Host 
tyr.informatik.hs-fulda.de ausgefuehrt
a[0]=0
a[1]=100
ok1
ok1
Process 1 after MPI_Win_create()
ok3
ok2
Real Size 8
ok3
Prozess 1# hat Wert 100 von Prozess 0 geholt
tyr test_onesided 140 


Kind regards

Siegmar

Reply via email to