Lines Matching refs:count
227 PetscErrorCode PetscByteSwap(void *data, PetscDataType pdtype, PetscCount count) in PetscByteSwap() argument
230 if (pdtype == PETSC_INT) PetscCall(PetscByteSwapInt((PetscInt *)data, count)); in PetscByteSwap()
231 else if (pdtype == PETSC_ENUM) PetscCall(PetscByteSwapEnum((PetscEnum *)data, count)); in PetscByteSwap()
232 else if (pdtype == PETSC_BOOL) PetscCall(PetscByteSwapBool((PetscBool *)data, count)); in PetscByteSwap()
233 else if (pdtype == PETSC_SCALAR) PetscCall(PetscByteSwapScalar((PetscScalar *)data, count)); in PetscByteSwap()
234 else if (pdtype == PETSC_REAL) PetscCall(PetscByteSwapReal((PetscReal *)data, count)); in PetscByteSwap()
235 else if (pdtype == PETSC_COMPLEX) PetscCall(PetscByteSwapReal((PetscReal *)data, 2 * count)); in PetscByteSwap()
236 else if (pdtype == PETSC_INT64) PetscCall(PetscByteSwapInt64((PetscInt64 *)data, count)); in PetscByteSwap()
237 else if (pdtype == PETSC_COUNT) PetscCall(PetscByteSwapInt64((PetscInt64 *)data, count)); in PetscByteSwap()
238 else if (pdtype == PETSC_INT32) PetscCall(PetscByteSwapInt32((PetscInt32 *)data, count)); in PetscByteSwap()
239 else if (pdtype == PETSC_DOUBLE) PetscCall(PetscByteSwapDouble((double *)data, count)); in PetscByteSwap()
240 else if (pdtype == PETSC_FLOAT) PetscCall(PetscByteSwapFloat((float *)data, count)); in PetscByteSwap()
241 else if (pdtype == PETSC_SHORT) PetscCall(PetscByteSwapShort((short *)data, count)); in PetscByteSwap()
242 else if (pdtype == PETSC_LONG) PetscCall(PetscByteSwapLong((long *)data, count)); in PetscByteSwap()
281 PetscErrorCode PetscBinaryRead(int fd, void *data, PetscCount num, PetscInt *count, PetscDataType t… in PetscBinaryRead() argument
293 if (count) *count = 0; in PetscBinaryRead()
332 PetscCheck(!m || count, PETSC_COMM_SELF, PETSC_ERR_FILE_READ, "Read past end of file"); in PetscBinaryRead()
335 …if (count) PetscCall(PetscIntCast(num, count)); /* TODO: This is most likely wrong for PETSC_BIT_L… in PetscBinaryRead()
616 …nchronizedRead(MPI_Comm comm, int fd, void *data, PetscInt num, PetscInt *count, PetscDataType typ… in PetscBinarySynchronizedRead() argument
636 if (rank == 0) ibuf[0] = (PetscInt)PetscBinaryRead(fd, data, num, count ? &ibuf[1] : NULL, type); in PetscBinarySynchronizedRead()
644 PetscCall(PetscMPIIntCast(count ? ibuf[1] : num, &cnt)); in PetscBinarySynchronizedRead()
648 if (count) *count = ibuf[1]; in PetscBinarySynchronizedRead()
753 …tscDataRep_read_conv_fn(void *userbuf, MPI_Datatype datatype, PetscMPIInt count, void *filebuf, MP… in PetscDataRep_read_conv_fn() argument
765 PetscCall(PetscMemcpy(userbuf, filebuf, count * dsize)); in PetscDataRep_read_conv_fn()
766 if (!PetscBinaryBigEndian()) PetscCall(PetscByteSwap(userbuf, pdtype, count)); in PetscDataRep_read_conv_fn()
770 PetscMPIInt PetscDataRep_write_conv_fn(void *userbuf, MPI_Datatype datatype, PetscMPIInt count, voi… in PetscDataRep_write_conv_fn() argument
782 PetscCall(PetscMemcpy(filebuf, userbuf, count * dsize)); in PetscDataRep_write_conv_fn()
783 if (!PetscBinaryBigEndian()) PetscCall(PetscByteSwap(filebuf, pdtype, count)); in PetscDataRep_write_conv_fn()