# DMCompareLabels
Compare labels of two `DMPLEX` meshes 
## Synopsis
```
#include "petscdm.h"          
#include "petscdmlabel.h"     
#include "petscds.h"     
PetscErrorCode DMCompareLabels(DM dm0, DM dm1, PetscBool *equal, char **message)
```
Collective


## Input Parameters

- ***dm0 -*** First `DM` object
- ***dm1 -*** Second `DM` object


Output Parameters

- ***equal   -*** (Optional) Flag whether labels of dm0 and dm1 are the same
- ***message -*** (Optional) Message describing the difference, or NULL if there is no difference





## Notes
The output flag equal will be the same on all processes.

If equal is passed as NULL and difference is found, an error is thrown on all processes.

Make sure to pass equal is NULL on all processes or none of them.

The output message is set independently on each rank.

message must be freed with `PetscFree()`

If message is passed as NULL and a difference is found, the difference description is printed to stderr in synchronized manner.

Make sure to pass message as NULL on all processes or no processes.

Labels are matched by name. If the number of labels and their names are equal,
`DMLabelCompare()` is used to compare each pair of labels with the same name.


## Fortran Note
This function is not available from Fortran.


## See Also
 `DMLabel`, `DMAddLabel()`, `DMCopyLabelsMode`, `DMLabelCompare()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/interface/dm.c.html#DMCompareLabels">src/dm/interface/dm.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/label/tutorials/ex1.c.html">src/dm/label/tutorials/ex1.c.html</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/dm/interface/dm.c)


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