/* Split current communicator in half */ myColor = myid >= (size / 2); newComm = comm.Split(myColor, 0); /* Create intercommunicators over the gap */ peerid = myColor ? (myid - size / 2) : (myid + size / 2); interComm = newComm.Create_intercomm(0, comm, peerid, 1);