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

PetscBinaryRead

Reads from a binary file.

Synopsis

PetscErrorCode  PetscBinaryRead(int fd,void *p,PetscInt n,PetscDataType type)
Not Collective Many br

Input Parameters

fd - the file Many br
n - the number of items to read Many br
type - the type of items to read (PETSC_INT, PETSC_DOUBLE or PETSC_SCALAR) Many br

Output Parameters

p -the buffer Many br

Many br

Notes

PetscBinaryRead() uses byte swapping to work on all machines; the files Many brare written to file ALWAYS using big-endian ordering. On small-endian machines the numbers Many brare converted to the small-endian format when they are read in from the file. Many brWhen PETSc is ./configure with --with-64bit-indices the integers are written to the Many brfile as 64 bit integers, this means they can only be read back in when the option --with-64bit-indices Many bris used. Many br

See Also

PetscBinaryWrite(), PetscBinaryOpen(), PetscBinaryClose(), PetscViewerBinaryGetDescriptor(), PetscBinarySynchronizedWrite(),
PetscBinarySynchronizedRead(), PetscBinarySynchronizedSeek() Many br

Level:developer
Location:
src/sys/fileio/sysio.c
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages

Examples

src/vec/vec/examples/tutorials/ex6.c.html
src/mat/examples/tutorials/ex5.c.html
src/dm/examples/tutorials/ex15.c.html
src/ksp/ksp/examples/tutorials/ex54f.F.html