when I am going to run the code it is showing
1Fatal error in MPI_Send: Invalid rank, error stack:
MPI_Send(174): MPI_Send(buf=0x7ffff63272c0, count=12, MPI_CHAR, dest=1, tag=100, MPI_COMM_WORLD) failed
MPI_Send(99).: Invalid rank has value 1 but must be nonnegative and less than 1
what type of problem is it? How can I solve it. I am doing a project on it. i am egarly waiting for the reply.
My code is:
#include <stdio.h>
#include "mpi.h"
int main (int argc, char ** argv)
{
int my_PE_num, ntag= 100 ;
char message[12]= "Hello, world";
MPI_Status status;
MPI_Init (&argc, &argv);
MPI_Comm_rank (MPI_COMM_WORLD, &my_PE_num);
if (my_PE_num ==0)
MPI_Send (&message, 12, MPI_CHAR, 1, ntag, MPI_COMM_WORLD);
printf("\n my name************\n");
/*
else if (my_PE_num == 1)
MPI_Recv(&message, 12, MPI_CHAR, 0, ntag, MPI_COMM_WORLD, &status);
printf("\n that is*************\n");
*/
MPI_Finalize();
return 0;
}