Unlike MPI_Send/ MPI_Recv, there is no 'Tag' parameter to other functions involving collective communication (e.g. MPI_Bcast/MPI_Gather). What is the reason?
Documentation says that:
Unlike point-to-point operations, nonblocking collective operations do not match with blocking collective operations, and collective operations do not have a tag argument. All processes must call collective operations (blocking and nonblocking) in the same order per communicator. In particular, once a process calls a collective operation, all other processes in the communicator must eventually call the same collective operation, and no other collective operation with the same communicator in between.
Tags are useful when non-blocking communication is involved. You might wonder why do we have tag argument for blocking operations. In the case of p2p communication, this is because blocking operations can match non-blocking ones. While in the case of collective communication, as stated, blocking and non-blocking operations do not match so there is no need for tags.
Edit after Hristo Iliev's comment: I misinterpreted the statement by making false assumptions. I copied the comment to the answer:
Tags have nothing to do with matching blocking with non-blocking communication. Collectives have no tags since the standard imposes the restriction that all ranks in a given communicator invoke the same sequence of collective operations and in the same order, which makes tags useless. Besides, non-blocking collectives were introduced as late as in MPI-3.0.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With