Skip to main content
`Ctrl`+`K`

# PetscPrintf

Prints to standard out, only from the first MPI process in the communicator. Calls from other processes are ignored.

## Synopsis

    PetscErrorCode PetscPrintf(MPI_Comm comm, const char format[], ...)

Not Collective

## Input Parameters

- comm - the communicator

- format - the usual `printf()` format string

## Note

Deprecated information: `PetscPrintf()` supports some format specifiers that are unique to PETSc. See the manual page for `PetscFormatConvert()` for details.

## Fortran Notes

The call sequence is `PetscPrintf`(MPI_Comm, character(*), `PetscErrorCode` ierr) from Fortran. That is, you can only pass a single character string from Fortran.

## See Also

`PetscFPrintf()`, `PetscSynchronizedPrintf()`, `PetscFormatConvert()`, `PetscFFlush()`

## Level

intermediate

## Location

src/sys/fileio/mprint.c

## Examples

src/dm/impls/stag/tutorials/ex1.c
src/dm/impls/plex/tutorials/ex8.c
src/dm/impls/plex/tutorials/ex15.c
src/dm/impls/plex/tutorials/ex19.c
src/dm/impls/plex/tutorials/ex5.c
src/dm/impls/plex/tutorials/ex16.c
src/dm/impls/plex/tutorials/ex6.c
src/dm/impls/plex/tutorials/ex11.c
src/dm/impls/plex/tutorials/ex17.c
src/dm/impls/plex/tutorials/ex18.c

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