:orphan: # PetscSFGetGraph Get the graph specifying a parallel star forest ## Synopsis ``` #include "petscsf.h" PetscErrorCode PetscSFGetGraph(PetscSF sf, PetscInt *nroots, PetscInt *nleaves, const PetscInt **ilocal, const PetscSFNode **iremote) ``` Not Collective ## Input Parameter - ***sf -*** star forest ## Output Parameters - ***nroots -*** number of root vertices on the current process (these are possible targets for other process to attach leaves) - ***nleaves -*** number of leaf vertices on the current process, each of these references a root on any process - ***ilocal -*** locations of leaves in leafdata buffers (if returned value is `NULL`, it means leaves are in contiguous storage) - ***iremote -*** remote locations of root vertices for each leaf on the current process ## Notes We are not currently requiring that the graph is set, thus returning `nroots` = -1 if it has not been set yet The returned `ilocal` and `iremote` might contain values in different order than the input ones in `PetscSFSetGraph()` ## Fortran Notes The returned `iremote` array is a copy and must be deallocated after use. Consequently, if you want to update the graph, you must call `PetscSFSetGraph()` after modifying the `iremote` array. To check for a `NULL` `ilocal` use ```none if (loc(ilocal) == loc(PETSC_NULL_INTEGER)) then ``` ## See Also `PetscSF`, `PetscSFType`, `PetscSFCreate()`, `PetscSFView()`, `PetscSFSetGraph()` ## Level intermediate ## Location src/vec/is/sf/interface/sf.c ## Examples src/ts/tutorials/ex11_sa.c
src/vec/is/sf/tutorials/ex1.c
src/vec/is/sf/tutorials/ex1f.F90
## Implementations PetscSFGetGraph_Allgatherv in src/vec/is/sf/impls/basic/allgatherv/sfallgatherv.c
PetscSFGetGraph_Alltoall in src/vec/is/sf/impls/basic/alltoall/sfalltoall.c
--- [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](/manualpages/index.md) [Index of all manual pages](/manualpages/singleindex.md)