:orphan:
# PetscSFFetchAndOpWithMemTypeBegin
begin operation with explicit memory types that fetches values from root and updates atomically by applying operation using my leaf value, to be completed with `PetscSFFetchAndOpEnd()` 
## Synopsis
```
#include "petscsf.h" 
PetscErrorCode PetscSFFetchAndOpWithMemTypeBegin(PetscSF sf, MPI_Datatype unit, PetscMemType rootmtype, void *rootdata, PetscMemType leafmtype, const void *leafdata, PetscMemType leafupdatemtype, void *leafupdate, MPI_Op op)
```
Collective


## Input Parameters

- ***sf -*** star forest
- ***unit -*** data type
- ***rootmtype -*** memory type of rootdata
- ***leafmtype -*** memory type of leafdata
- ***leafdata -*** leaf values to use in reduction
- ***leafupdatemtype -*** memory type of leafupdate
- ***op -*** operation to use for reduction



## Output Parameters

- ***rootdata -*** root values to be updated, input state is seen by first process to perform an update
- ***leafupdate -*** state at each leaf's respective root immediately prior to my atomic update





## Note
See `PetscSFFetchAndOpBegin()` for more details.


## See Also
 `PetscSF`, `PetscSFFetchAndOpBegin()`, `PetscSFComputeDegreeBegin()`, `PetscSFReduceBegin()`, `PetscSFSetGraph()`, `PetscSFFetchAndOpEnd()`

## Level
advanced

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


---
[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)  
