:orphan:
# PetscViewerHDF5SetSPOutput
Data is written to disk in single precision even if PETSc is compiled with double precision `PetscReal`. 
## Synopsis
```
#include "petscviewerhdf5.h" 
PetscErrorCode PetscViewerHDF5SetSPOutput(PetscViewer viewer, PetscBool flg)
```
Logically Collective


## Input Parameters

- ***viewer -*** the PetscViewer; if it is a `PETSCVIEWERHDF5` then this command is ignored
- ***flg -*** if `PETSC_TRUE` the data will be written to disk with single precision



## Options Database Key

- ***-viewer_hdf5_sp_output -*** turns on (true) or off (false) output in single precision





## Note
Setting this option does not make any difference if PETSc is compiled with single precision
in the first place. It does not affect reading datasets (HDF5 handle this internally).


## See Also
 [](sec_viewers), `PETSCVIEWERHDF5`, `PetscViewerFileSetMode()`, `PetscViewerCreate()`, `PetscViewerSetType()`, `PetscViewerBinaryOpen()`,
`PetscReal`, `PetscViewerHDF5GetSPOutput()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/hdf5/hdf5v.c.html#PetscViewerHDF5SetSPOutput">src/sys/classes/viewer/impls/hdf5/hdf5v.c</A>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/hdf5/hdf5v.c.html#PetscViewerHDF5SetSPOutput_HDF5">PetscViewerHDF5SetSPOutput_HDF5 in src/sys/classes/viewer/impls/hdf5/hdf5v.c</A><BR>


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


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