:orphan:
# PCASMGetSubKSP
Gets the local `KSP` contexts for all blocks on this processor. 
## Synopsis
```
#include "petscpc.h" 
PetscErrorCode PCASMGetSubKSP(PC pc, PetscInt *n_local, PetscInt *first_local, KSP *ksp[])
```
Collective iff first_local is requested


## Input Parameter

- ***pc -*** the preconditioner context



## Output Parameters

- ***n_local -*** the number of blocks on this processor or NULL
- ***first_local -*** the global number of the first block on this processor or NULL,
all processors must request or all must pass NULL
- ***ksp -*** the array of `KSP` contexts





## Notes
After `PCASMGetSubKSP()` the array of `KSP`s is not to be freed.

You must call `KSPSetUp()` before calling `PCASMGetSubKSP()`.


## Fortran Note
The output argument 'ksp' must be an array of sufficient length or `PETSC_NULL_KSP`. The latter can be used to learn the necessary length.


## See Also
 `PCASM`, `PCASMSetTotalSubdomains()`, `PCASMSetTotalSubdomains()`, `PCASMSetOverlap()`,
`PCASMCreateSubdomains2D()`,

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/asm/asm.c.html#PCASMGetSubKSP">src/ksp/pc/impls/asm/asm.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex8.c.html">src/ksp/ksp/tutorials/ex8.c</A><BR>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/asm/asm.c.html#PCASMGetSubKSP_ASM">PCASMGetSubKSP_ASM in src/ksp/pc/impls/asm/asm.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ksp/pc/impls/asm/asm.c)


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