petsc-3.12.5 2020-03-29
Report Typos and Errors

PetscViewerASCIISynchronizedPrintf

Prints synchronized output to the specified file from several processors. Output of the first processor is followed by that of the second, etc.

Synopsis

#include "petscviewer.h" 
PetscErrorCode  PetscViewerASCIISynchronizedPrintf(PetscViewer viewer,const char format[],...)
Not Collective, must call collective PetscViewerFlush() to get the results out

Input Parameters

viewer - the ASCII PetscViewer
format - the usual printf() format string

Notes

You must have previously called PetscViewerASCIIPushSynchronized() to allow this routine to be called. Then you can do multiple independent calls to this routine. The actual synchronized print is then done using PetscViewerFlush(). PetscViewerASCIIPopSynchronized() should be then called if we are already done with the synchronized output to conclude the "synchronized session". So the typical calling sequence looks like
PetscViewerASCIIPushSynchronized(viewer);
PetscViewerASCIISynchronizedPrintf(viewer, ...);
PetscViewerASCIISynchronizedPrintf(viewer, ...);
...
PetscViewerFlush(viewer);
PetscViewerASCIISynchronizedPrintf(viewer, ...);
PetscViewerASCIISynchronizedPrintf(viewer, ...);
...
PetscViewerFlush(viewer);
PetscViewerASCIIPopSynchronized(viewer);    

Fortran Note

Can only print a single character* string

See Also

PetscViewerASCIIPushSynchronized(), PetscViewerFlush(), PetscViewerASCIIPopSynchronized(),
PetscSynchronizedPrintf(), PetscViewerASCIIPrintf(), PetscViewerASCIIOpen(), PetscViewerCreate(), PetscViewerDestroy(), PetscViewerSetType()

Level

intermediate

Location

src/sys/classes/viewer/impls/ascii/filev.c

Examples

src/vec/is/sf/examples/tutorials/ex1.c.html
src/dm/examples/tutorials/swarm_ex1.c.html

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