MPI_COMM_WORLD code example
Example: MPI_COMM_WORLD
When a program is ran with MPI all the processes are grouped
in what we call a communicator. You can see a communicator as a box
grouping processes together, allowing them to communicate.
Every communication is linked to a communicator,
#allowing the communication to reach different processes.
Communications can be either of two types :
-Point-to-Point : Two processes in the same communicator are going to
communicate.
-Collective : All the processes in a communicator are going to communicate
together.
The default communicator is called MPI_COMM_WORLD.
It basically groups all the processes when the program started