Create Row Groups
int my_row, q, my_rank_in_row;
q = (int) sqrt((double) p);
/* my_rank is rank in MPI_COMM_WORLD, q*q = p */
MPI_Comm_split(MPI_COMM_WORLD, my_row, my_rank, &my_row_comm);
/* Test the new communicators */
MPI_Comm_rank(my_row_comm, &my_rank_in_row);
MPI_Bcast(&test, 1, MPI_INT, 0, my_row_comm);
printf("Process %d > my_row = %d, my_rank_in_row = %d, test = %d\n",
my_rank, my_row, my_rank_in_row, test);