@@ -65,8 +65,11 @@ namespace bitpit {
65
65
\param haloSize is the size, expressed in number of layers, of the ghost
66
66
cells halo
67
67
\param adaptionMode is the adaption mode that will be used for the patch
68
+ \param partitioningMode is the partitioning mode that will be used for the
69
+ patch
68
70
*/
69
- PatchKernel::PatchKernel (MPI_Comm communicator, std::size_t haloSize, AdaptionMode adaptionMode)
71
+ PatchKernel::PatchKernel (MPI_Comm communicator, std::size_t haloSize,
72
+ AdaptionMode adaptionMode, PartitioningMode partitioningMode)
70
73
#else
71
74
/* !
72
75
Creates a patch.
@@ -76,6 +79,9 @@ PatchKernel::PatchKernel(MPI_Comm communicator, std::size_t haloSize, AdaptionMo
76
79
PatchKernel::PatchKernel (AdaptionMode adaptionMode)
77
80
#endif
78
81
: m_adaptionMode(adaptionMode)
82
+ #if BITPIT_ENABLE_MPI==1
83
+ , m_partitioningMode(partitioningMode)
84
+ #endif
79
85
{
80
86
// Initialize the patch
81
87
#if BITPIT_ENABLE_MPI==1
@@ -107,8 +113,11 @@ PatchKernel::PatchKernel(AdaptionMode adaptionMode)
107
113
\param haloSize is the size, expressed in number of layers, of the ghost
108
114
cells halo
109
115
\param adaptionMode is the adaption mode that will be used for the patch
116
+ \param partitioningMode is the partitioning mode that will be used for the
117
+ patch
110
118
*/
111
- PatchKernel::PatchKernel (int dimension, MPI_Comm communicator, std::size_t haloSize, AdaptionMode adaptionMode)
119
+ PatchKernel::PatchKernel (int dimension, MPI_Comm communicator, std::size_t haloSize,
120
+ AdaptionMode adaptionMode, PartitioningMode partitioningMode)
112
121
#else
113
122
/* !
114
123
Creates a patch.
@@ -119,6 +128,9 @@ PatchKernel::PatchKernel(int dimension, MPI_Comm communicator, std::size_t haloS
119
128
PatchKernel::PatchKernel (int dimension, AdaptionMode adaptionMode)
120
129
#endif
121
130
: m_adaptionMode(adaptionMode)
131
+ #if BITPIT_ENABLE_MPI==1
132
+ , m_partitioningMode(partitioningMode)
133
+ #endif
122
134
{
123
135
// Initialize the patch
124
136
#if BITPIT_ENABLE_MPI==1
@@ -154,8 +166,11 @@ PatchKernel::PatchKernel(int dimension, AdaptionMode adaptionMode)
154
166
\param haloSize is the size, expressed in number of layers, of the ghost
155
167
cells halo
156
168
\param adaptionMode is the adaption mode that will be used for the patch
169
+ \param partitioningMode is the partitioning mode that will be used for the
170
+ patch
157
171
*/
158
- PatchKernel::PatchKernel (int id, int dimension, MPI_Comm communicator, std::size_t haloSize, AdaptionMode adaptionMode)
172
+ PatchKernel::PatchKernel (int id, int dimension, MPI_Comm communicator, std::size_t haloSize,
173
+ AdaptionMode adaptionMode, PartitioningMode partitioningMode)
159
174
#else
160
175
/* !
161
176
Creates a patch.
@@ -167,6 +182,9 @@ PatchKernel::PatchKernel(int id, int dimension, MPI_Comm communicator, std::size
167
182
PatchKernel::PatchKernel (int id, int dimension, AdaptionMode adaptionMode)
168
183
#endif
169
184
: m_adaptionMode(adaptionMode)
185
+ #if BITPIT_ENABLE_MPI==1
186
+ , m_partitioningMode(partitioningMode)
187
+ #endif
170
188
{
171
189
// Initialize the patch
172
190
#if BITPIT_ENABLE_MPI==1
@@ -231,7 +249,8 @@ PatchKernel::PatchKernel(const PatchKernel &other)
231
249
m_toleranceCustom(other.m_toleranceCustom),
232
250
m_tolerance(other.m_tolerance)
233
251
#if BITPIT_ENABLE_MPI==1
234
- , m_partitioningStatus(other.m_partitioningStatus),
252
+ , m_partitioningMode(other.m_partitioningMode),
253
+ m_partitioningStatus (other.m_partitioningStatus),
235
254
m_owner(other.m_owner),
236
255
m_haloSize(other.m_haloSize),
237
256
m_partitioningCellsTag(other.m_partitioningCellsTag),
@@ -321,6 +340,7 @@ PatchKernel::PatchKernel(PatchKernel &&other)
321
340
m_nProcessors(std::move(other.m_nProcessors))
322
341
#if BITPIT_ENABLE_MPI==1
323
342
, m_communicator(std::move(MPI_COMM_NULL)),
343
+ m_partitioningMode (other.m_partitioningMode),
324
344
m_partitioningStatus(std::move(other.m_partitioningStatus)),
325
345
m_owner(std::move(other.m_owner)),
326
346
m_haloSize(std::move(other.m_haloSize)),
@@ -410,6 +430,7 @@ PatchKernel & PatchKernel::operator=(PatchKernel &&other)
410
430
m_nProcessors = std::move (other.m_nProcessors );
411
431
#if BITPIT_ENABLE_MPI==1
412
432
m_communicator = std::move (MPI_COMM_NULL);
433
+ m_partitioningMode = std::move (other.m_partitioningMode );
413
434
m_partitioningStatus = std::move (other.m_partitioningStatus );
414
435
m_owner = std::move (other.m_owner );
415
436
m_haloSize = std::move (other.m_haloSize );
@@ -519,11 +540,7 @@ void PatchKernel::initialize()
519
540
initializeHaloSize (haloSize);
520
541
521
542
// Mark patch as partioned
522
- if (isPartitioned ()) {
523
- setPartitioningStatus (PARTITIONING_CLEAN);
524
- } else {
525
- setPartitioningStatus (PARTITIONING_UNSUPPORTED);
526
- }
543
+ setPartitioningStatus (PARTITIONING_CLEAN);
527
544
528
545
// Initialize partitioning tags
529
546
m_partitioningCellsTag = -1 ;
@@ -8331,11 +8348,13 @@ bool PatchKernel::dump(std::ostream &stream) const
8331
8348
utils::binary::write (stream, m_adaptionMode);
8332
8349
utils::binary::write (stream, m_adaptionStatus);
8333
8350
8334
- // Partition status
8351
+ // Partition information
8335
8352
#if BITPIT_ENABLE_MPI==1
8353
+ utils::binary::write (stream, m_partitioningMode);
8336
8354
utils::binary::write (stream, m_partitioningStatus);
8337
8355
#else
8338
- utils::binary::write (stream, PARTITIONING_UNSUPPORTED);
8356
+ utils::binary::write (stream, PARTITIONING_DISABLED);
8357
+ utils::binary::write (stream, PARTITIONING_CLEAN);
8339
8358
#endif
8340
8359
8341
8360
// Adjacencies build strategy
@@ -8430,10 +8449,14 @@ void PatchKernel::restore(std::istream &stream, bool reregister)
8430
8449
utils::binary::read (stream, m_adaptionMode);
8431
8450
utils::binary::read (stream, m_adaptionStatus);
8432
8451
8433
- // Partition status
8452
+ // Partition information
8434
8453
#if BITPIT_ENABLE_MPI==1
8454
+ utils::binary::read (stream, m_partitioningMode);
8435
8455
utils::binary::read (stream, m_partitioningStatus);
8436
8456
#else
8457
+ PartitioningStatus dummyPartitioningMode;
8458
+ utils::binary::read (stream, dummyPartitioningMode);
8459
+
8437
8460
PartitioningStatus dummyPartitioningStatus;
8438
8461
utils::binary::read (stream, dummyPartitioningStatus);
8439
8462
#endif
0 commit comments