This means that any function in MPI that needs to determine the size of the message data accepts zero, but this does not mean that it will lead to the correct application code.
For example, MPI_Send
takes 0 as a counter and always sends an empty message that does not contain data, but still has an envelope and can be received by any suitable MPI_Recv
. On the other hand, if you specify 0 as the counter in MPI_Recv
, you will receive an error truncation message for any suitable non-empty message that arrived. That is, 0 is almost never a valid (from the point of view of the application) count value for MPI_Recv
, although this is quite acceptable for MPI.
Zeroes are widespread in MPI, because it allows you to write more symmetric code (for example, code without a lot of if (count != 0) ...
source share