PetscSFReduceBegin#

begin reduction of leafdata into rootdata, to be completed with call to PetscSFReduceEnd()

Synopsis#

#include "petscsf.h" 
PetscErrorCode PetscSFReduceBegin(PetscSF sf, MPI_Datatype unit, const void *leafdata, void *rootdata, MPI_Op op)

Collective

Input Parameters#

  • sf - star forest

  • unit - data type

  • leafdata - values to reduce

  • op - reduction operation

Output Parameter#

  • rootdata - result of reduction of values from all leaves of each root

Note#

When PETSc is configured with device support, it will use its own mechanism to figure out whether the given data pointers are host pointers or device pointers, which may incur a noticeable cost. If you already knew the info, you should use PetscSFReduceWithMemTypeBegin() instead.

See Also#

PetscSF, PetscSFBcastBegin(), PetscSFReduceWithMemTypeBegin(), PetscSFReduceEnd()

Level#

intermediate

Location#

src/vec/is/sf/interface/sf.c

Examples#

src/vec/is/sf/tutorials/ex1f.F90
src/ts/tutorials/ex30.c
src/vec/is/sf/tutorials/ex1.c

Implementations#

PetscSFReduceBegin_Allgather() in src/vec/is/sf/impls/basic/allgather/sfallgather.c
PetscSFReduceBegin_Allgatherv() in src/vec/is/sf/impls/basic/allgatherv/sfallgatherv.c
PetscSFReduceBegin_Basic() in src/vec/is/sf/impls/basic/sfbasic.c
PetscSFReduceBegin_Window() in src/vec/is/sf/impls/window/sfwindow.c


Index of all PetscSF routines
Table of Contents for all manual pages
Index of all manual pages