:orphan:
# PetscObjectGetId
get a unique object ID for the `PetscObject` 
## Synopsis
```
#include "petscsys.h"    
PetscErrorCode PetscObjectGetId(PetscObject obj, PetscObjectId *id)
```
Not Collective


## Input Parameter

- ***obj -*** object



## Output Parameter

- ***id -*** integer ID





## Note
The object ID may be different on different processes, but object IDs are never reused so local equality implies global equality.


## See Also
 `PetscObjectStateGet()`, `PetscObjectCompareId()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/objects/state.c.html#PetscObjectGetId">src/sys/objects/state.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/objects/state.c)


[Index of all Sys routines](index.md)  
[Table of Contents for all manual pages](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
