[petsc-users] printing from some processors to a file

Randall Mackie rlmackie862 at gmail.com
Tue Nov 26 15:45:22 CST 2013


I am trying to print a character string to a file from one or more
processors in a communicator. I thought that I could do this using
PetscViewerASCIISynchronizedPrintf, but it prints to the screen instead of
to the file opened as a viewer. The attached simple program illustrates the
issue. If I remove the (if rank == 1) and therefore call
PetscViewerASCIISynchronizedPrintf from every process, it works as
expected. If called from only 1 process, it prints to the screen. I
thought, from the documentation, that it was not collective, but maybe I am
not understanding it's usage.


Randy M.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20131126/11b1f1e4/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.F90
Type: application/octet-stream
Size: 615 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20131126/11b1f1e4/attachment.obj>


More information about the petsc-users mailing list