MPI_Comm_rank

int MPI_Comm_rank(MPI_Comm, int *);
Returns the rank of the local task in the group associated with a communicator.