mpi split communicator

  1. Use the MPI_Comm_size function to determine the number of processes in the original communicator.
  2. Use the MPI_Comm_rank function to obtain the rank of the calling process in the original communicator.
  3. Use the MPI_Comm_split function to create new communicators based on the ranks of the processes in the original communicator.
  4. Specify the color and key parameters to control the creation of the new sub-communicators.
  5. Use the new communicators for communication and coordination among the processes with similar color values.