[petsc-users] Multiple output using one viewer

Jed Brown jedbrown at mcs.anl.gov
Fri Jan 6 07:13:32 CST 2012


On Fri, Jan 6, 2012 at 06:51, Alexander Grayver <agrayver at gfz-potsdam.de>wrote:

> Ok, that was my meaning to use PetscViewerFileSetName from the beginning
> since if you have let's say ten different objects (Mat and Vec) and you
> need to output them at each iteration (time step or frequency for
> multi-freqs modeling) you need ten viewer objects which is not cool I
> guess, that is why I started to use one viewer and change just a name of
> the file.
> And to be honest I don't see any reason why having ten viewers is better
> than calling PetscViewerFileSetName ten times.
>

Ten open file handles is not a big deal, just use ten viewers. There is
file system metadata overhead associated with opening and closing files and
it can get quite large on parallel file systems.

If you planned to have thousands of open file handles, you should rethink
your output format.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120106/87a9d240/attachment-0001.htm>


More information about the petsc-users mailing list