MPI count frequency is zero

I came across this today ( http://www.mcs.anl.gov/research/projects/mpi/www/www3/MPI_Send.html )

MPI_ERR_COUNT Invalid count argument. Count arguments must be non-negative; a count of zero is often valid. 

What does this mean that a zero count is often equal? Does this mean that it is implementation dependent?

+6
source share
2 answers

I think you read too much. I think this simply means that depending on the user's implementation, from 0, a random positive integer is a real number. It is easy to imagine a message tag that does not require parameters.

If the message tag does not require any parameters, then it is valid for sending only a null value (and, in fact, possibly invalid for sending more than that). You should keep in mind that no parameters are the same as any data, since the message tag is a β€œparameter” inside and at its discretion.

+9
source

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) ...

+5
source

Source: https://habr.com/ru/post/914665/


All Articles