# PetscBagCreate

Create a bag of values Collective on MPI_Comm

### Synopsis

    PetscErrorCode PetscBagCreate(MPI_Comm comm,C struct name,PetscBag **bag);

### Input Parameters

| comm | - communicator to share bag
| C struct name | - name of the C structure holding the values

### Output Parameter

bag -the bag of values

### Notes

The size of the A struct must be small enough to fit in a PetscInt; by default PetscInt is 4 bytes. The warning about casting to a shorter length can be ignored below unless your A struct is too large

### See Also

PetscBag, PetscBagGetName(), PetscBagView(), PetscBagLoad()
PetscBagRegisterReal(), PetscBagRegisterInt(), PetscBagRegisterTruth(), PetscBagRegisterScalar() PetscBagSetFromOptions(), PetscBagRegisterVec(), PetscBagCreate(), PetscBagDestroy(), PetscBagRegisterEnum()

Level:Intermediate
Location:include/petscbag.h
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/sys/examples/tutorials/ex5.c.html