PetscSFGetRootRanks — PETSc 3.25.1 documentation

Skip to main content
`Ctrl`+`K`

# PetscSFGetRootRanks

Get the root MPI ranks and number of vertices referenced by leaves on this process

## Synopsis

    #include "petscsf.h"
    PetscErrorCode PetscSFGetRootRanks(PetscSF sf, PetscMPIInt *nranks, const PetscMPIInt *ranks[], const PetscInt *roffset[], const PetscInt *rmine[], const PetscInt *rremote[])

Not Collective

## Input Parameter

- sf - star forest

## Output Parameters

- nranks - number of MPI processes referenced by local part

- ranks - [`nranks`] array of MPI ranks

- roffset - [`nranks`+1] offset in `rmine` and `rremote` for each MPI process

- rmine - [`roffset`[`nranks`]] concatenated array holding local indices referencing each remote MPI process, or `NULL`

- rremote - [`roffset`[`nranks`]] concatenated array holding remote indices referenced for each remote MPI process, or `NULL`

## See Also

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

## Level

developer

## Location

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

## Examples

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

## Implementations

PetscSFGetRootRanks_Allgatherv() in src/vec/is/sf/impls/basic/allgatherv/sfallgatherv.c

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