Funktionsübersicht . . Gruppen, Kontexte und Kommunikatoren

Hilfesystem für den Message Passing Interface Standard MPI


MPI_Comm_split

Erzeugt neue Prozeßgruppen indem eine vorhandene in Gruppen gespalten wird

Syntax:

Input Parameter: Output Parameter: Aufruf:

zum Bilden von vier neuen Gruppen

#include "mpi.h"

#define NUMGROUPS 4 

    int         myid, color, numprocs;
    MPI_Comm    comm, newcomm;

    ...
    MPI_Comm_rank(comm, &myid);
    MPI_Comm_size(comm, &numprocs);
    color=myid%NUMGROUPS;
    MPI_Comm_split(comm, color, myid, &newcomm);
    ...

Beispiel