petsc-3.7.1 2016-05-15
Report Typos and Errors

# PetscViewerBinaryOpen

Opens a file for binary input/output.

### Synopsis

    #include "petscviewer.h"
    PetscErrorCode PetscViewerBinaryOpen(MPI_Comm comm,const char name[],PetscFileMode type,PetscViewer *binv)

Collective on MPI_Comm Many br

### Input Parameters

| comm | - MPI communicator Many br
| name | - name of file Many br
| type | - type of file Many br

       FILE_MODE_WRITE - create new file for binary output

       FILE_MODE_READ - open existing file for binary input

       FILE_MODE_APPEND - open existing file for binary output

### Output Parameter

binv -PetscViewer for binary input/output to use with the specified file Many br

### Options Database Keys

| -viewer_binary_filename <name> | - . -viewer_binary_skip_info Many br
| -viewer_binary_skip_options | - . -viewer_binary_skip_header Many br
| -viewer_binary_mpiio | - Many br Many br

### Note

This PetscViewer should be destroyed with PetscViewerDestroy(). Many br

For reading files, the filename may begin with ftp:// or http:// and/or Many brend with .gz; in this case file is brought over and uncompressed. Many br

For creating files, if the file name ends with .gz it is automatically Many brcompressed when closed. Many br

For writing files it only opens the file on processor 0 in the communicator. Many brFor readable files it opens the file on all nodes that have the file. If Many brnode 0 does not have the file it generates an error even if other nodes Many brdo have the file. Many br

### See Also

PetscViewerASCIIOpen(), PetscViewerPushFormat(), PetscViewerDestroy(),
VecView(), MatView(), VecLoad(), MatLoad(), PetscViewerBinaryGetDescriptor(), Many brPetscViewerBinaryGetInfoPointer(), PetscFileMode, PetscViewer, PetscViewerBinaryRead() Many br

Level:beginner
Location:src/sys/classes/viewer/impls/binary/binv.c
Index of all Viewer routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/sys/classes/viewer/examples/tutorials/ex1f90.F90.html
src/sys/examples/tutorials/ex5.c.html
src/sys/examples/tutorials/ex5f90.F90.html
src/vec/vec/examples/tutorials/ex5.c.html
src/vec/vec/examples/tutorials/ex6.c.html
src/vec/vec/examples/tutorials/ex10.c.html
src/mat/examples/tutorials/ex1.c.html
src/mat/examples/tutorials/ex4.c.html
src/mat/examples/tutorials/ex5.c.html
src/mat/examples/tutorials/ex9.c.html
src/mat/examples/tutorials/ex10.c.html