MPI_Initialize calls what ever subroutines required to set up communication to the other processors.
int MPI_Initialize(int argc, char** argv)
MPI_Finalize returns the rank of a process in its second argument.
A communicator (MPI_Comm) is a collection of processors that can send messages to each other. For basic programs, the only communicator needed is MPI_COMM_WORLD. It is predefined in MPI and consists of all the
processors running when program execution begins. In more complex programs it may desirable to create subsets of MPI_COMM_WORLD to partition the processors into smaller communication groups. Message communicators
much match between message sender and receiver. Communicators can also be used to determine the number of processors participating in a particular communicator set and the sequence of the processor in the communicator.
The processor's location in the communicator sequence is determined by the MPI_Comm_rank function. The total number of processors in the communicator can be determed by the MPI_Comm_size.