#pragma once /* MANSEC = Vec */ /* SUBMANSEC = PetscSF */ /*S PetscSF - PETSc object for managing the communication of certain entries of arrays and `Vec` between MPI processes. Level: intermediate `PetscSF` uses the concept of star forests to indicate and determine the communication patterns concisely and efficiently. A star forest is simply a collection of trees of height 1. The leave nodes represent "ghost locations" for the root nodes. The standard usage paradigm for `PetscSF` is to provide the communication pattern with `PetscSFSetGraph()` or `PetscSFSetGraphWithPattern()` and then perform the communication using `PetscSFBcastBegin()` and `PetscSFBcastEnd()`, `PetscSFReduceBegin()` and `PetscSFReduceEnd()`. .seealso: [](sec_petscsf), `PetscSFCreate()`, `PetscSFSetGraph()`, `PetscSFSetGraphWithPattern()`, `PetscSFBcastBegin()`, `PetscSFBcastEnd()`, `PetscSFReduceBegin()`, `PetscSFReduceEnd()`, `VecScatter`, `VecScatterCreate()` S*/ typedef struct _p_PetscSF *PetscSF; /*J PetscSFType - String with the name of a `PetscSF` type. Each `PetscSFType` uses different mechanisms to perform the communication. Level: beginner Available Types: + `PETSCSFBASIC` - use MPI sends and receives . `PETSCSFNEIGHBOR` - use MPI_Neighbor operations . `PETSCSFALLGATHERV` - use MPI_Allgatherv operations . `PETSCSFALLGATHER` - use MPI_Allgather operations . `PETSCSFGATHERV` - use MPI_Igatherv and MPI_Iscatterv operations . `PETSCSFGATHER` - use MPI_Igather and MPI_Iscatter operations . `PETSCSFALLTOALL` - use MPI_Ialltoall operations - `PETSCSFWINDOW` - use MPI_Win operations Note: Some `PetscSFType` only provide specialized code for a subset of the `PetscSF` operations and use `PETSCSFBASIC` for the others. .seealso: [](sec_petscsf), `PetscSFSetType()`, `PetscSF` J*/ typedef const char *PetscSFType; #define PETSCSFBASIC "basic" #define PETSCSFNEIGHBOR "neighbor" #define PETSCSFALLGATHERV "allgatherv" #define PETSCSFALLGATHER "allgather" #define PETSCSFGATHERV "gatherv" #define PETSCSFGATHER "gather" #define PETSCSFALLTOALL "alltoall" #define PETSCSFWINDOW "window" /*S PetscSFNode - specifier of MPI rank owner and local index for array or `Vec` entry locations that are to be communicated with a `PetscSF` Level: beginner Sample Usage: .vb PetscSFNode *remote; PetscCall(PetscMalloc1(nleaves,&remote)); for (i=0; i