# PetscObjectCompareId
compares the objects ID with a given id 
## Synopsis
```
#include "petscsys.h"    
PetscErrorCode PetscObjectCompareId(PetscObject obj, PetscObjectId id, PetscBool *eq)
```
Not Collective


## Input Parameters

- ***obj -*** object
- ***id -*** integer ID


Output Parameter;

- ***eq -*** the ids are equal





## 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()`, `PetscObjectGetId()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/objects/state.c.html#PetscObjectCompareId">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](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
