:orphan:
# PetscFPrintf
Prints to a file, only from the first MPI process in the communicator.
## Synopsis
```
PetscErrorCode PetscFPrintf(MPI_Comm comm, FILE *fd, const char format[], ...)
```
Not Collective; No Fortran Support
## Input Parameters
- ***comm -*** the MPI communicator
- ***fd -*** the file pointer
- ***format -*** the usual `printf()` format string
## Developer Note
This maybe, and is, called from PETSc error handlers and `PetscMallocValidate()` hence it does not use `PetscCallMPI()` which
could recursively restart the malloc validation.
## See Also
`PetscPrintf()`, `PetscSynchronizedPrintf()`, `PetscViewerASCIIPrintf()`,
`PetscViewerASCIISynchronizedPrintf()`, `PetscSynchronizedFlush()`, `PetscFFlush()`
## Level
intermediate
## Location
src/sys/fileio/mprint.c
## Examples
src/ksp/ksp/tutorials/ex18.c
src/ksp/ksp/tutorials/ex2.c
src/ksp/ksp/tutorials/ex42.c
src/ksp/ksp/tutorials/ex43.c
src/ksp/ksp/tutorials/ex46.c
src/ksp/ksp/tutorials/ex49.c
src/ksp/ksp/tutorials/ex52.c
---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/fileio/mprint.c)
[Index of all Sys routines](index.md)
[Table of Contents for all manual pages](/manualpages/index.md)
[Index of all manual pages](/manualpages/singleindex.md)