I don't know the class MPI_Status, so I can't find the exact point of bug. But what I see: id_cons is always 3. Why? Because you do this in line 133 (in brackets). Now you should understand why estado.MPI_SOURCE is always 3.
— I want to learn programing language. Which language is base for start career in programing language