> Let me see if I understand, You have a distributed label. Some process marks 
> a shared point, but another process with that same shared point does not mark 
> it

If I'm not making any previous mistake in the setup, seems like that.

See attached a MWE and the mesh. I get this output with 2 ranks:

// label : start / end
[1,0]<stdout>:surf_1 : s / e : 0 / 1
[1,0]<stdout>:surf_2 : s / e : 1 / 2
[1,0]<stdout>:surf_3 : s / e : -1 / -1
[1,0]<stdout>:surf_4 : s / e : -1 / -1
[1,0]<stdout>:edge : s / e : 7 / 10
[1,0]<stdout>:P1 : s / e : 2 / 3
[1,0]<stdout>:P2 : s / e : 3 / 4
[1,0]<stdout>:P3 : s / e : -1 / -1
[1,1]<stdout>:surf_1 : s / e : -1 / -1
[1,1]<stdout>:surf_2 : s / e : -1 / -1
[1,1]<stdout>:surf_3 : s / e : 0 / 1
[1,1]<stdout>:surf_4 : s / e : 1 / 2
[1,1]<stdout>:edge : s / e : -1 / -1
[1,1]<stdout>:P1 : s / e : -1 / -1
[1,1]<stdout>:P2 : s / e : -1 / -1
[1,1]<stdout>:P3 : s / e : 2 / 3

In my machine, rank 0 gets the lower left (surf_1) and lower right triangles 
(surf_2), whereas rank 1 gets the top (surf_3) and middle bottom (surf_4). 
Point label coordinates are P1 (0,0), P2(1,0) and P3(0,1).

So for example, for the (0,0) vertex (label P1), from rank 0, start/end is 2/3, 
which seems correct whereas in rank 1 it is -1/-1, which also makes sense since 
it is not part of the rank.

The "edge" label is the one that I found confusing. It contains the three 
points att the botom (0,0), (0.5,0) and (1,0). So in rank 1, the vertex at 
(0.5,0) should be marked (?). But it returns -1/-1

> I think you can just call DMLabelPropagatePush() with no merge or update.

I'll give it a try.

Thank you,

---
Noam
#include <petscdm.h>
#include <petscdmplex.h>
#include <petscdmlabel.h>

int main(int argc, char *argv[]) {

    DM dm_, dm;

    PetscFunctionBeginUser;
    PetscCall(PetscInitialize(&argc, &argv, NULL, NULL));

    PetscCall(DMCreate(PETSC_COMM_WORLD, &dm_));
    PetscCall(DMSetType(dm_, DMPLEX));
    PetscCall(DMSetFromOptions(dm_));

    PetscCall(DMPlexDistribute(dm_,0,NULL,&dm));

    PetscInt n_labels;
    PetscCall(DMGetNumLabels(dm, &n_labels));
    for (PetscInt n = 2; n < n_labels; n++) {   // skip celltype & depth
        DMLabel     label;
        PetscInt    pStart, pEnd;
        const char *labelName;
        PetscCall(DMGetLabelByNum(dm, n, &label));
        PetscCall(DMGetLabelName(dm, n, &labelName));
        //PetscCall(DMPlexLabelComplete(dm, label));
        PetscCall(DMLabelGetBounds(label, &pStart, &pEnd));
        PetscCall(PetscPrintf(PETSC_COMM_SELF, "%s : s / e : %" PetscInt_FMT " / %" PetscInt_FMT "\n", labelName, pStart, pEnd));
    }

    PetscCall(DMDestroy(&dm));

    PetscCall(PetscFinalize());
}

/*
 *
 * mpirun -n 2 --tag-output ./test -dm_plex_filename mesh.msh -dm_plex_gmsh_use_regions -dm_plex_gmsh_mark_vertices -dm_plex_gmsh_multiple_tags
 *
 */

Attachment: mesh.msh
Description: Mesh model

Reply via email to