@@ -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
@@ -2141,6 +2150,13 @@ std::vector<adaption::Info> PatchKernel::_partitioningPrepare(const std::unorder
2141
2150
}
2142
2151
2143
2152
// Fill tracking data structures
2153
+ partitioningData.emplace_back ();
2154
+ adaption::Info &partitioningVertexInfo = partitioningData.back ();
2155
+ partitioningVertexInfo.entity = adaption::ENTITY_VERTEX;
2156
+ partitioningVertexInfo.type = adaption::TYPE_PARTITION_SEND;
2157
+ partitioningVertexInfo.rank = recvRank;
2158
+ partitioningVertexInfo.previous = getOrderedCellsVertices (cellsToSend, true , false );
2159
+
2144
2160
partitioningData.emplace_back ();
2145
2161
adaption::Info &partitioningCellInfo = partitioningData.back ();
2146
2162
partitioningCellInfo.entity = adaption::ENTITY_CELL;
@@ -2389,6 +2405,15 @@ std::vector<adaption::Info> PatchKernel::_partitioningAlter_deleteGhosts(bool tr
2389
2405
2390
2406
// Track changes
2391
2407
if (trackPartitioning) {
2408
+ partitioningData.emplace_back ();
2409
+ adaption::Info &partitioningVertexInfo = partitioningData.back ();
2410
+ partitioningVertexInfo.entity = adaption::ENTITY_VERTEX;
2411
+ partitioningVertexInfo.type = adaption::TYPE_DELETION;
2412
+ partitioningVertexInfo.current .reserve (getGhostVertexCount ());
2413
+ for (VertexConstIterator itr = ghostVertexConstBegin (); itr != ghostVertexConstEnd (); ++itr) {
2414
+ partitioningVertexInfo.current .push_back (itr.getId ());
2415
+ }
2416
+
2392
2417
partitioningData.emplace_back ();
2393
2418
adaption::Info &partitioningCellInfo = partitioningData.back ();
2394
2419
partitioningCellInfo.entity = adaption::ENTITY_CELL;
@@ -2839,6 +2864,13 @@ std::vector<adaption::Info> PatchKernel::_partitioningAlter_sendCells(const std:
2839
2864
// two processes are able to exchange cell data without additional
2840
2865
// communications (they already know the list of cells for which
2841
2866
// data is needed and the order in which these data will be sent).
2867
+ partitioningData.emplace_back ();
2868
+ adaption::Info &partitioningVertexInfo = partitioningData.back ();
2869
+ partitioningVertexInfo.entity = adaption::ENTITY_VERTEX;
2870
+ partitioningVertexInfo.type = adaption::TYPE_PARTITION_SEND;
2871
+ partitioningVertexInfo.rank = recvRank;
2872
+ partitioningVertexInfo.current = getOrderedCellsVertices (cellSendList, true , false );
2873
+
2842
2874
partitioningData.emplace_back ();
2843
2875
adaption::Info &partitioningCellInfo = partitioningData.back ();
2844
2876
partitioningCellInfo.entity = adaption::ENTITY_CELL;
@@ -3118,6 +3150,16 @@ std::vector<adaption::Info> PatchKernel::_partitioningAlter_sendCells(const std:
3118
3150
cellCreationInfo.type = adaption::TYPE_CREATION;
3119
3151
cellCreationInfo.rank = getRank ();
3120
3152
cellCreationInfo.current = getOrderedCellsVertices (trackedCreatedGhostCells, false , true );
3153
+
3154
+ std::vector<long > deletedGhostVertices = getOrderedCellsVertices (trackedCreatedGhostCells, false , true );
3155
+ if (!deletedGhostVertices.empty ()) {
3156
+ partitioningData.emplace_back ();
3157
+ adaption::Info &vertexCreationInfo = partitioningData.back ();
3158
+ vertexCreationInfo.entity = adaption::ENTITY_VERTEX;
3159
+ vertexCreationInfo.type = adaption::TYPE_CREATION;
3160
+ vertexCreationInfo.rank = getRank ();
3161
+ vertexCreationInfo.current = std::move (deletedGhostVertices);
3162
+ }
3121
3163
}
3122
3164
3123
3165
// Delete frame cells that are not ghosts
@@ -3216,11 +3258,43 @@ std::vector<adaption::Info> PatchKernel::_partitioningAlter_sendCells(const std:
3216
3258
// Prune stale interfaces
3217
3259
pruneStaleInterfaces ();
3218
3260
3261
+ // Identify orphan vertices
3262
+ std::vector<long > orphanVertices = findOrphanVertices ();
3263
+
3264
+ // Track ghost vertices deletion
3265
+ //
3266
+ // Only ghost vertices need to be tracked, all orphan internal vertex
3267
+ // have already been tracked among the vertices that have been send.
3268
+ if (trackPartitioning && !orphanVertices.empty ()) {
3269
+ partitioningData.emplace_back ();
3270
+ adaption::Info &vertexDeletionInfo = partitioningData.back ();
3271
+ vertexDeletionInfo.entity = adaption::ENTITY_VERTEX;
3272
+ vertexDeletionInfo.type = adaption::TYPE_DELETION;
3273
+ vertexDeletionInfo.rank = getRank ();
3274
+ for (long vertexId : orphanVertices) {
3275
+ const Vertex &vertex = getVertex (vertexId);
3276
+ if (vertex.isInterior ()) {
3277
+ continue ;
3278
+ }
3279
+
3280
+ vertexDeletionInfo.current .push_back (vertexId);
3281
+ }
3282
+ }
3283
+
3219
3284
// Delete orphan vertices
3220
- deleteOrphanVertices ( );
3285
+ deleteVertices (orphanVertices );
3221
3286
} else {
3222
3287
// All ghost cells will be deleted
3223
3288
if (trackPartitioning) {
3289
+ partitioningData.emplace_back ();
3290
+ adaption::Info &partitioningVertexInfo = partitioningData.back ();
3291
+ partitioningVertexInfo.entity = adaption::ENTITY_VERTEX;
3292
+ partitioningVertexInfo.type = adaption::TYPE_DELETION;
3293
+ partitioningVertexInfo.current .reserve (getGhostVertexCount ());
3294
+ for (VertexConstIterator itr = ghostVertexConstBegin (); itr != ghostVertexConstEnd (); ++itr) {
3295
+ partitioningVertexInfo.current .push_back (itr.getId ());
3296
+ }
3297
+
3224
3298
partitioningData.emplace_back ();
3225
3299
adaption::Info &partitioningCellInfo = partitioningData.back ();
3226
3300
partitioningCellInfo.entity = adaption::ENTITY_CELL;
@@ -3876,6 +3950,13 @@ std::vector<adaption::Info> PatchKernel::_partitioningAlter_receiveCells(const s
3876
3950
// Track changes
3877
3951
if (trackPartitioning) {
3878
3952
if (!trackedReceivedInteriorCells.empty ()) {
3953
+ partitioningData.emplace_back ();
3954
+ adaption::Info &vertexRecvInfo = partitioningData.back ();
3955
+ vertexRecvInfo.entity = adaption::ENTITY_VERTEX;
3956
+ vertexRecvInfo.type = adaption::TYPE_PARTITION_RECV;
3957
+ vertexRecvInfo.rank = sendRank;
3958
+ vertexRecvInfo.current = getOrderedCellsVertices (trackedReceivedInteriorCells, true , false );
3959
+
3879
3960
partitioningData.emplace_back ();
3880
3961
adaption::Info &cellRecvInfo = partitioningData.back ();
3881
3962
cellRecvInfo.entity = adaption::ENTITY_CELL;
@@ -3886,6 +3967,14 @@ std::vector<adaption::Info> PatchKernel::_partitioningAlter_receiveCells(const s
3886
3967
}
3887
3968
3888
3969
if (!trackedCreatedGhostCells.empty ()) {
3970
+ partitioningData.emplace_back ();
3971
+ adaption::Info &vertexCreationInfo = partitioningData.back ();
3972
+ vertexCreationInfo.entity = adaption::ENTITY_VERTEX;
3973
+ vertexCreationInfo.type = adaption::TYPE_CREATION;
3974
+ vertexCreationInfo.rank = patchRank;
3975
+ vertexCreationInfo.current = getOrderedCellsVertices (trackedCreatedGhostCells, false , true );
3976
+
3977
+
3889
3978
partitioningData.emplace_back ();
3890
3979
adaption::Info &cellCreationInfo = partitioningData.back ();
3891
3980
cellCreationInfo.entity = adaption::ENTITY_CELL;
0 commit comments