# PetscViewerBinaryWriteAll
writes to a binary file from all MPI ranks, each rank writes its own portion of the data 
## Synopsis
```
#include "petscviewer.h"   
PetscErrorCode PetscViewerBinaryWriteAll(PetscViewer viewer, const void *data, PetscInt count, PetscInt start, PetscInt total, PetscDataType dtype)
```
Collective


## Input Parameters

- ***viewer -*** the binary viewer
- ***data -*** location of data
- ***count -*** local number of items of data to write
- ***start -*** local start, can be `PETSC_DETERMINE`
- ***total -*** global number of items of data to write, can be `PETSC_DETERMINE`
- ***dtype -*** type of data to write





## See Also
 [](sec_viewers), `PETSCVIEWERBINARY`, `PetscViewerBinaryOpen()`, `PetscViewerBinarySetUseMPIIO()`, `PetscViewerBinaryWriteAll()`, `PetscViewerBinaryReadAll()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/binary/binv.c.html#PetscViewerBinaryWriteAll">src/sys/classes/viewer/impls/binary/binv.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/classes/viewer/impls/binary/binv.c)


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