MPI_Recv: receiving a different size than one sent

I am writing a program to check the shortest path using a library MPI. There are two scenarios:
Either I found the best path, as the first slot in the buffer will be indicated resultBuff[0] = 1, and I will need to move the rest of the contents of the buffer to get the best path.
Another case resultBuff[0] = 0, and I will not call any values ​​in other buffer cells.

Is it possible to use separate calls MPI_Isend:

In case I found the best path and saved it in resultBuff[1]to resultBuff[10]:

MPI_Isend((void*)sendBuff, 11, MPI_INT, 0, 1, MPI_COMM_WORLD, &request);

In case the best path is not found:

MPI_Isend((void*)sendBuff, 1, MPI_INT, 0, 1, MPI_COMM_WORLD, &request);

And in both cases I will use

MPI_Recv( (void*)resultBuff, 11, MPI_INT, MPI_ANY_SOURCE, 1, MPI_COMM_WORLD, &status);

to get the result.

?
, , ?

: resultBuff 11.

+5
2

, . MPI man pages MPI_Recv " count , MPI_Get_count", status, MPI_Recv().

, , , - , .

+1

, " ": . MPI_Test , , .

0

All Articles