I want to send a message to one of the ranks receiving a message with a specific tag. If there is any rank, the received message and the message is consumed. In MPI_Recv (), we can receive a message using MPI_ANY_SOURCE / MPI_ANY_TAG, but MPI_Send () cannot do this. How to send a message with an unknown address? MPI_Bcast () cannot do this, because after receiving I have to respond to the original process. Thank.
What I would do is that the workflow signals the owner that he is ready to receive. The wizard will keep track of which ranks are ready, select one (first lowest rank, random, round robin, as you like), send it and clear its βreadyβ flag.
Do you want to just send a message to a random rank?
MPI_Comm_size(MPI_COMM_WORLD, &size); sendto = rand() % size; MPI_Send(buffer, count, MPI_CHAR, sendto, 0, MPI_COMM_WORLD);
: MPI.
: , , . , - . Suszterpatt, "" , , , - ( .. 1000 , , ).