
130 Designing Scientific Applications on GPUs
// Waiting fo r an incoming messag e
10 MPI Probe (MPI ANY SOURCE, MPI ANY TAG, MPI COMM WORLD, &s t a t u s ) ;
i f ( ! F i n i s h e d ) {
switch ( s t a t u s . MPI TAG) { // Actions re lat ed to messag e type
case tagCom : // Management o f data messages
. . .
15 break ;
case tagEnd : // Management o f termination mes sages
. . .
break ;
case t a g S t a t e : // Management o f lo c a l st at e messages
20 // Actual reception o f the message
MPI Recv(& r e c v d S t a t e , 1 , MPI CHAR, s t a t u s . MPI SOURCE, t a gS t a t e ,
MPI COMM WORLD, &s t a t u s ) ;
// Updates of numbers of s t a b i l i z e d