I want to send a MPI_Send message to a single but variable host. By this i mean that i dont know the rank of the host i want to send the message to, at compile time.
So naturally, what i wrote was the following:
MPI_Send(&myIntData, 1, MPI_INT, target_host, MY_MSGTAG, MPI_COMM_WORLD);
where target_host is an integer, containing the rank of the destination.
When i execute this, MPI ends with a timeout. If i put a printf before and after the send, only the printf that happens before is displayed, which means that my program is stuck in the MPI_Send statement.
If i change target_host for a 1, for example, then the second printf displays and everything works fine.
So.. doesnt mpi support a variable in the destintation rank identifier?
What is the problem here?