Funktionsübersicht . . Kollektive Operationen

Hilfesystem für den Message Passing Interface Standard MPI


MPI_Reduce_scatter

Kombiniert Daten von allen Prozessen einer Gruppe und verteilt das Ergebnis an alle

Syntax:

Input Parameter: Output Parameter: Aufruf:

#include "mpi.h"
...

    int           numprocs, i;
    int           *recvcounts;
    void          *sendbuf, *recvbuf;
    MPI_Datatype  datatype;
    MPI_Op        op;
    MPI_Comm      comm;

    ...
    MPI_Comm_size(comm, &numprocs);
    recvcounts=(* int)malloc(numprocs*sizeof(int));

    for (i=0; i<numprocs; i++) {
	... counts[i] belegen ...
    }
    ...
    MPI_Reduce_scatter(sendbuf, recvbuf, recvcounts, datatype,  
                       op, comm);
    ...