the thing is that I’m writting a programm in C using MPI. I the objective is to have N processes in the programme and once initiated one process send a token to a random different process, repeating this for 10 times. The first time is the rank 0 process the one that have to do it. This is an exercise and after expending several hours searching and trying different ways I try asking this here. I’ve tested, non blocking and MPI_Probe … But the main thing is why if try this with more than one processor(part of code that I attach) the program freezes, with two it runs ok.
if (my_world_rank == 0)
{
MPI_Send(&token, 1, MPI_INT, 1, 0, MPI_COMM_WORLD);
printf("Proceso %d envía token %d n", my_world_rank, token);
}else{
MPI_Recv(&token, 1, MPI_INT, MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
printf("Proceso %d recibe token %d n", my_world_rank, token);
}
I tried to run the programme with more than 2 processors but it freezes and i expectec it to work.
Guille Luengo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.