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

# PetscBinarySynchronizedWrite

writes to a binary file.

### Synopsis

    PetscErrorCode  PetscBinarySynchronizedWrite(MPI_Comm comm,int fd,void *p,PetscInt n,PetscDataType type,PetscBool istemp)

Collective on MPI_Comm Many br

### Input Parameters

| comm | - the MPI communicator Many br
| fd | - the file Many br
| n | - the number of items to write Many br
| p | - the buffer Many br
| istemp | - the buffer may be changed Many br
| type | - the type of items to write (PETSC_INT, PETSC_DOUBLE or PETSC_SCALAR) Many br

Many br

### Notes

Process 0 does a PetscBinaryWrite() Many br

PetscBinarySynchronizedWrite() uses byte swapping to work on all machines. Many brIntegers are stored on the file as 32 long, regardless of whether Many brthey are stored in the machine as 32 or 64, this means the same Many brbinary file may be read on any machine. Many br

Notes: because byte-swapping may be done on the values in data it cannot be declared const Many br

WARNING: This is NOT like PetscSynchronizedFPrintf()! This routine ignores calls on all but process 0, Many brwhile PetscSynchronizedFPrintf() has all processes print their strings in order. Many br

### See Also

PetscBinaryWrite(), PetscBinaryOpen(), PetscBinaryClose(), PetscBinaryRead(), 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