PetscFPrintf — PETSc 3.21.4 documentation

Skip to main content
`Ctrl`+`K`

# 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 Notes

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/ex42.c
src/ksp/ksp/tutorials/ex49.c
src/ksp/ksp/tutorials/ex43.c

Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages