next up previous contents
Next: Comm_free Up: Collectives Previous: Context ID Creation

Comm_create

int MPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm *newcomm)
{
  IMPI_Uint8 newcid, maxcid;

  /* create a new context ID */
  MPI_Allreduce(&IMPI_max_cid, &maxcid, 1, IMPI_UINT8, MPI_MAX, comm);
  if (maxcid == IMPI_UINT8_MAX) {
    error out of contexts;
  }

  newcid = maxcid + 1;
  IMPI_max_cid = maxcid + 1;

  build a new communicator newcomm from group with context newcid;
}



IMPI Protocol ver 0.0
DRAFT March 22, 1999