Skip to main content
`Ctrl`+`K`

# PetscSFGatherBegin

begin pointwise gather of all leaves into multi-roots, to be completed with `PetscSFGatherEnd()`

## Synopsis

    #include "petscsf.h"
    PetscErrorCode PetscSFGatherBegin(PetscSF sf, MPI_Datatype unit, const void *leafdata, void *multirootdata)

Collective

## Input Parameters

- sf - star forest

- unit - data type

- leafdata - leaf data to gather to roots

## Output Parameter

- multirootdata - root buffer to gather into, amount of space per root is equal to its degree (which is the number of leaves that root has)

## See Also

PetscSF - an alternative to low-level MPI calls for data communication, `PetscSF`, `PetscSFComputeDegreeBegin()`, `PetscSFScatterBegin()`

## Level

intermediate

## Location

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

## Examples

src/vec/is/sf/tutorials/ex1.c

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