Two of the first questions asked in a parallel program are: How many processes are there? and Who am I?
How many is answered with MPI_Comm_size and who am I is answered with MPI_Comm_rank.
The rank is a number between zero and size-1.