I am trying to send a string from one processor to another using MPI.
In one file, I have the send function specified by:
where my_rank is 0.Code:MPI_Send(str, 128, MPI_CHAR, 1, my_rank, MPI_COMM_WORLD);
And in another file, I have the receive function:
where my_rank is 1.Code:MPI_Recv(str, 128, MPI_CHAR, 0, my_rank, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
The files compile. But when I try to run the program I get the following error:
From the MPI documentation:Code:An error occurred in MPI_Send on communicator MPI_COMM_WORLD MPI_ERR_TAG: invalid tag MPI_ERRORS_ARE_FATAL (goodbye)
I've also tried using MPI_ANY_TAG and I've received the same error.MPI_ERR_TAG
Invalid tag argument. Tags must be non-negative; tags in a receive (MPI_Recv, MPI_Irecv, MPI_Sendrecv, etc.) may also be MPI_ANY_TAG. The largest tag value is available through the the attribute MPI_TAG_UB.
I should also mention that the way I run the program is by using:
Does anyone have any ideas?Code:mpirun -np 1 send : -np 1 receive