:orphan:
# VecCreateGhostBlock
Creates a parallel vector with ghost padding on each processor. The indicing of the ghost points is done with blocks. 
## Synopsis
```
#include "petscvec.h"   
PetscErrorCode VecCreateGhostBlock(MPI_Comm comm, PetscInt bs, PetscInt n, PetscInt N, PetscInt nghost, const PetscInt ghosts[], Vec *vv)
```
Collective


## Input Parameters

- ***comm -*** the MPI communicator to use
- ***bs -*** the block size
- ***n -*** local vector length
- ***N -*** global vector length (or `PETSC_DETERMINE` to have calculated if `n` is given)
- ***nghost -*** number of local ghost blocks
- ***ghosts -*** global indices of ghost blocks, counts are by block, not by individual index, these do not need to be in increasing order (sorted)



## Output Parameter

- ***vv -*** the global vector representation (without ghost points as part of vector)





## Notes
Use `VecGhostGetLocalForm()` to access the local, ghosted representation
of the vector.

`n` is the local vector size (total local size not the number of blocks) while `nghost`
is the number of blocks in the ghost portion, i.e. the number of elements in the ghost
portion is `bs*nghost`


## See Also
 [](ch_vectors), `Vec`, `VecType`, `VecCreateSeq()`, `VecCreate()`, `VecDuplicate()`, `VecDuplicateVecs()`, `VecCreateMPI()`,
`VecGhostGetLocalForm()`, `VecGhostRestoreLocalForm()`,
`VecCreateGhostWithArray()`, `VecCreateMPIWithArray()`, `VecCreateGhostBlockWithArray()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/impls/mpi/pbvec.c.html#VecCreateGhostBlock">src/vec/vec/impls/mpi/pbvec.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex14f.F90.html">src/vec/vec/tutorials/ex14f.F90</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/vec/vec/impls/mpi/pbvec.c)


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