# PetscSFComputeDegreeBegin
begin computation of degree for each root vertex, to be completed with `PetscSFComputeDegreeEnd()` 
## Synopsis
```
#include "petscsf.h" 
PetscErrorCode PetscSFComputeDegreeBegin(PetscSF sf, const PetscInt **degree)
```
Collective


## Input Parameter

- ***sf -*** star forest



## Output Parameter

- ***degree -*** degree of each root vertex





## Note
The returned array is owned by `PetscSF` and automatically freed by `PetscSFDestroy()`. Hence no need to call `PetscFree()` on it.


## See Also
 `PetscSF`, `PetscSFGatherBegin()`, `PetscSFComputeDegreeEnd()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/is/sf/interface/sf.c.html#PetscSFComputeDegreeBegin">src/vec/is/sf/interface/sf.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/is/sf/tutorials/ex1.c.html">src/vec/is/sf/tutorials/ex1.c.html</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/vec/is/sf/interface/sf.c)


[Index of all PetscSF routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
