@@ -1576,7 +1576,8 @@ std::vector<adaption::Info> PatchKernel::partitioningPrepare(MPI_Comm communicat
1576
1576
1577
1577
Information available on the sender side for tracking purposes are the
1578
1578
following:
1579
- - internal cells that will be send.
1579
+ - internal cells that will be send;
1580
+ - internal vertices that will be send.
1580
1581
1581
1582
No information about tracking are provided on the receiver side.
1582
1583
@@ -1675,16 +1676,24 @@ std::vector<adaption::Info> PatchKernel::partitioningPrepare(const std::unordere
1675
1676
Information available on the sender side for tracking purposes are the
1676
1677
following:
1677
1678
- internal cells that have been sent;
1679
+ - internal vertices that have been sent;
1678
1680
- new ghost cells that have been created (some of the internal cells that
1679
1681
have been sent may have become ghosts cells);
1680
- - ghost cells that have been deleted.
1682
+ - new ghost vertices that have been created (some of the internal vertices
1683
+ that have been sent may have become ghosts vertices);
1684
+ - ghost cells that have been deleted;
1685
+ - ghost vertices that have been deleted.
1681
1686
1682
1687
Information available on the receiver side for tracking purposes are the
1683
1688
following:
1684
1689
- internal cells that have been received;
1690
+ - internal vertices that have been received;
1685
1691
- new ghost cells that have been created;
1692
+ - new ghost vertices that have been created;
1686
1693
- ghost cells that have been deleted (some ghost cells may have been
1687
- replaced by internal cells that have just been received).
1694
+ replaced by internal cells that have just been received);
1695
+ - ghost vertices that have been deleted (some ghost vertices may have been
1696
+ replaced by internal vertices that have just been received).
1688
1697
1689
1698
\param trackPartitioning if set to true the function will return the changes
1690
1699
done to the patch during the partitioning
@@ -2170,6 +2179,13 @@ std::vector<adaption::Info> PatchKernel::_partitioningPrepare(const std::unorder
2170
2179
}
2171
2180
2172
2181
// Fill tracking data structures
2182
+ partitioningData.emplace_back ();
2183
+ adaption::Info &partitioningVertexInfo = partitioningData.back ();
2184
+ partitioningVertexInfo.entity = adaption::ENTITY_VERTEX;
2185
+ partitioningVertexInfo.type = adaption::TYPE_PARTITION_SEND;
2186
+ partitioningVertexInfo.rank = recvRank;
2187
+ partitioningVertexInfo.previous = getOrderedCellsVertices (cellsToSend, true , false );
2188
+
2173
2189
partitioningData.emplace_back ();
2174
2190
adaption::Info &partitioningCellInfo = partitioningData.back ();
2175
2191
partitioningCellInfo.entity = adaption::ENTITY_CELL;
@@ -2418,6 +2434,15 @@ std::vector<adaption::Info> PatchKernel::_partitioningAlter_deleteGhosts(bool tr
2418
2434
2419
2435
// Track changes
2420
2436
if (trackPartitioning) {
2437
+ partitioningData.emplace_back ();
2438
+ adaption::Info &partitioningVertexInfo = partitioningData.back ();
2439
+ partitioningVertexInfo.entity = adaption::ENTITY_VERTEX;
2440
+ partitioningVertexInfo.type = adaption::TYPE_DELETION;
2441
+ partitioningVertexInfo.current .reserve (getGhostVertexCount ());
2442
+ for (VertexConstIterator itr = ghostVertexConstBegin (); itr != ghostVertexConstEnd (); ++itr) {
2443
+ partitioningVertexInfo.current .push_back (itr.getId ());
2444
+ }
2445
+
2421
2446
partitioningData.emplace_back ();
2422
2447
adaption::Info &partitioningCellInfo = partitioningData.back ();
2423
2448
partitioningCellInfo.entity = adaption::ENTITY_CELL;
@@ -2868,6 +2893,13 @@ std::vector<adaption::Info> PatchKernel::_partitioningAlter_sendCells(const std:
2868
2893
// two processes are able to exchange cell data without additional
2869
2894
// communications (they already know the list of cells for which
2870
2895
// data is needed and the order in which these data will be sent).
2896
+ partitioningData.emplace_back ();
2897
+ adaption::Info &partitioningVertexInfo = partitioningData.back ();
2898
+ partitioningVertexInfo.entity = adaption::ENTITY_VERTEX;
2899
+ partitioningVertexInfo.type = adaption::TYPE_PARTITION_SEND;
2900
+ partitioningVertexInfo.rank = recvRank;
2901
+ partitioningVertexInfo.current = getOrderedCellsVertices (cellSendList, true , false );
2902
+
2871
2903
partitioningData.emplace_back ();
2872
2904
adaption::Info &partitioningCellInfo = partitioningData.back ();
2873
2905
partitioningCellInfo.entity = adaption::ENTITY_CELL;
@@ -3147,6 +3179,16 @@ std::vector<adaption::Info> PatchKernel::_partitioningAlter_sendCells(const std:
3147
3179
cellCreationInfo.type = adaption::TYPE_CREATION;
3148
3180
cellCreationInfo.rank = getRank ();
3149
3181
cellCreationInfo.current = getOrderedCellsVertices (trackedCreatedGhostCells, false , true );
3182
+
3183
+ std::vector<long > deletedGhostVertices = getOrderedCellsVertices (trackedCreatedGhostCells, false , true );
3184
+ if (!deletedGhostVertices.empty ()) {
3185
+ partitioningData.emplace_back ();
3186
+ adaption::Info &vertexCreationInfo = partitioningData.back ();
3187
+ vertexCreationInfo.entity = adaption::ENTITY_VERTEX;
3188
+ vertexCreationInfo.type = adaption::TYPE_CREATION;
3189
+ vertexCreationInfo.rank = getRank ();
3190
+ vertexCreationInfo.current = std::move (deletedGhostVertices);
3191
+ }
3150
3192
}
3151
3193
3152
3194
// Delete frame cells that are not ghosts
@@ -3245,11 +3287,43 @@ std::vector<adaption::Info> PatchKernel::_partitioningAlter_sendCells(const std:
3245
3287
// Prune stale interfaces
3246
3288
pruneStaleInterfaces ();
3247
3289
3290
+ // Identify orphan vertices
3291
+ std::vector<long > orphanVertices = findOrphanVertices ();
3292
+
3293
+ // Track ghost vertices deletion
3294
+ //
3295
+ // Only ghost vertices need to be tracked, all orphan internal vertex
3296
+ // have already been tracked among the vertices that have been send.
3297
+ if (trackPartitioning && !orphanVertices.empty ()) {
3298
+ partitioningData.emplace_back ();
3299
+ adaption::Info &vertexDeletionInfo = partitioningData.back ();
3300
+ vertexDeletionInfo.entity = adaption::ENTITY_VERTEX;
3301
+ vertexDeletionInfo.type = adaption::TYPE_DELETION;
3302
+ vertexDeletionInfo.rank = getRank ();
3303
+ for (long vertexId : orphanVertices) {
3304
+ const Vertex &vertex = getVertex (vertexId);
3305
+ if (vertex.isInterior ()) {
3306
+ continue ;
3307
+ }
3308
+
3309
+ vertexDeletionInfo.current .push_back (vertexId);
3310
+ }
3311
+ }
3312
+
3248
3313
// Delete orphan vertices
3249
- deleteOrphanVertices ( );
3314
+ deleteVertices (orphanVertices );
3250
3315
} else {
3251
3316
// All ghost cells will be deleted
3252
3317
if (trackPartitioning) {
3318
+ partitioningData.emplace_back ();
3319
+ adaption::Info &partitioningVertexInfo = partitioningData.back ();
3320
+ partitioningVertexInfo.entity = adaption::ENTITY_VERTEX;
3321
+ partitioningVertexInfo.type = adaption::TYPE_DELETION;
3322
+ partitioningVertexInfo.current .reserve (getGhostVertexCount ());
3323
+ for (VertexConstIterator itr = ghostVertexConstBegin (); itr != ghostVertexConstEnd (); ++itr) {
3324
+ partitioningVertexInfo.current .push_back (itr.getId ());
3325
+ }
3326
+
3253
3327
partitioningData.emplace_back ();
3254
3328
adaption::Info &partitioningCellInfo = partitioningData.back ();
3255
3329
partitioningCellInfo.entity = adaption::ENTITY_CELL;
@@ -3905,6 +3979,13 @@ std::vector<adaption::Info> PatchKernel::_partitioningAlter_receiveCells(const s
3905
3979
// Track changes
3906
3980
if (trackPartitioning) {
3907
3981
if (!trackedReceivedInteriorCells.empty ()) {
3982
+ partitioningData.emplace_back ();
3983
+ adaption::Info &vertexRecvInfo = partitioningData.back ();
3984
+ vertexRecvInfo.entity = adaption::ENTITY_VERTEX;
3985
+ vertexRecvInfo.type = adaption::TYPE_PARTITION_RECV;
3986
+ vertexRecvInfo.rank = sendRank;
3987
+ vertexRecvInfo.current = getOrderedCellsVertices (trackedReceivedInteriorCells, true , false );
3988
+
3908
3989
partitioningData.emplace_back ();
3909
3990
adaption::Info &cellRecvInfo = partitioningData.back ();
3910
3991
cellRecvInfo.entity = adaption::ENTITY_CELL;
@@ -3915,6 +3996,14 @@ std::vector<adaption::Info> PatchKernel::_partitioningAlter_receiveCells(const s
3915
3996
}
3916
3997
3917
3998
if (!trackedCreatedGhostCells.empty ()) {
3999
+ partitioningData.emplace_back ();
4000
+ adaption::Info &vertexCreationInfo = partitioningData.back ();
4001
+ vertexCreationInfo.entity = adaption::ENTITY_VERTEX;
4002
+ vertexCreationInfo.type = adaption::TYPE_CREATION;
4003
+ vertexCreationInfo.rank = patchRank;
4004
+ vertexCreationInfo.current = getOrderedCellsVertices (trackedCreatedGhostCells, false , true );
4005
+
4006
+
3918
4007
partitioningData.emplace_back ();
3919
4008
adaption::Info &cellCreationInfo = partitioningData.back ();
3920
4009
cellCreationInfo.entity = adaption::ENTITY_CELL;
0 commit comments