@@ -66,8 +66,11 @@ namespace bitpit {
66
66
\param haloSize is the size, expressed in number of layers, of the ghost
67
67
cells halo
68
68
\param adaptionMode is the adaption mode that will be used for the patch
69
+ \param partitioningMode is the partitioning mode that will be used for the
70
+ patch
69
71
*/
70
- PatchKernel::PatchKernel (MPI_Comm communicator, std::size_t haloSize, AdaptionMode adaptionMode)
72
+ PatchKernel::PatchKernel (MPI_Comm communicator, std::size_t haloSize,
73
+ AdaptionMode adaptionMode, PartitioningMode partitioningMode)
71
74
#else
72
75
/* !
73
76
Creates a patch.
@@ -77,6 +80,9 @@ PatchKernel::PatchKernel(MPI_Comm communicator, std::size_t haloSize, AdaptionMo
77
80
PatchKernel::PatchKernel (AdaptionMode adaptionMode)
78
81
#endif
79
82
: m_adaptionMode(adaptionMode)
83
+ #if BITPIT_ENABLE_MPI==1
84
+ , m_partitioningMode(partitioningMode)
85
+ #endif
80
86
{
81
87
// Initialize the patch
82
88
#if BITPIT_ENABLE_MPI==1
@@ -108,8 +114,11 @@ PatchKernel::PatchKernel(AdaptionMode adaptionMode)
108
114
\param haloSize is the size, expressed in number of layers, of the ghost
109
115
cells halo
110
116
\param adaptionMode is the adaption mode that will be used for the patch
117
+ \param partitioningMode is the partitioning mode that will be used for the
118
+ patch
111
119
*/
112
- PatchKernel::PatchKernel (int dimension, MPI_Comm communicator, std::size_t haloSize, AdaptionMode adaptionMode)
120
+ PatchKernel::PatchKernel (int dimension, MPI_Comm communicator, std::size_t haloSize,
121
+ AdaptionMode adaptionMode, PartitioningMode partitioningMode)
113
122
#else
114
123
/* !
115
124
Creates a patch.
@@ -120,6 +129,9 @@ PatchKernel::PatchKernel(int dimension, MPI_Comm communicator, std::size_t haloS
120
129
PatchKernel::PatchKernel (int dimension, AdaptionMode adaptionMode)
121
130
#endif
122
131
: m_adaptionMode(adaptionMode)
132
+ #if BITPIT_ENABLE_MPI==1
133
+ , m_partitioningMode(partitioningMode)
134
+ #endif
123
135
{
124
136
// Initialize the patch
125
137
#if BITPIT_ENABLE_MPI==1
@@ -155,8 +167,11 @@ PatchKernel::PatchKernel(int dimension, AdaptionMode adaptionMode)
155
167
\param haloSize is the size, expressed in number of layers, of the ghost
156
168
cells halo
157
169
\param adaptionMode is the adaption mode that will be used for the patch
170
+ \param partitioningMode is the partitioning mode that will be used for the
171
+ patch
158
172
*/
159
- PatchKernel::PatchKernel (int id, int dimension, MPI_Comm communicator, std::size_t haloSize, AdaptionMode adaptionMode)
173
+ PatchKernel::PatchKernel (int id, int dimension, MPI_Comm communicator, std::size_t haloSize,
174
+ AdaptionMode adaptionMode, PartitioningMode partitioningMode)
160
175
#else
161
176
/* !
162
177
Creates a patch.
@@ -168,6 +183,9 @@ PatchKernel::PatchKernel(int id, int dimension, MPI_Comm communicator, std::size
168
183
PatchKernel::PatchKernel (int id, int dimension, AdaptionMode adaptionMode)
169
184
#endif
170
185
: m_adaptionMode(adaptionMode)
186
+ #if BITPIT_ENABLE_MPI==1
187
+ , m_partitioningMode(partitioningMode)
188
+ #endif
171
189
{
172
190
// Initialize the patch
173
191
#if BITPIT_ENABLE_MPI==1
@@ -232,7 +250,8 @@ PatchKernel::PatchKernel(const PatchKernel &other)
232
250
m_toleranceCustom(other.m_toleranceCustom),
233
251
m_tolerance(other.m_tolerance)
234
252
#if BITPIT_ENABLE_MPI==1
235
- , m_partitioningStatus(other.m_partitioningStatus),
253
+ , m_partitioningMode(other.m_partitioningMode),
254
+ m_partitioningStatus (other.m_partitioningStatus),
236
255
m_owner(other.m_owner),
237
256
m_haloSize(other.m_haloSize),
238
257
m_partitioningCellsTag(other.m_partitioningCellsTag),
@@ -322,6 +341,7 @@ PatchKernel::PatchKernel(PatchKernel &&other)
322
341
m_nProcessors(std::move(other.m_nProcessors))
323
342
#if BITPIT_ENABLE_MPI==1
324
343
, m_communicator(std::move(MPI_COMM_NULL)),
344
+ m_partitioningMode (other.m_partitioningMode),
325
345
m_partitioningStatus(std::move(other.m_partitioningStatus)),
326
346
m_owner(std::move(other.m_owner)),
327
347
m_haloSize(std::move(other.m_haloSize)),
@@ -411,6 +431,7 @@ PatchKernel & PatchKernel::operator=(PatchKernel &&other)
411
431
m_nProcessors = std::move (other.m_nProcessors );
412
432
#if BITPIT_ENABLE_MPI==1
413
433
m_communicator = std::move (MPI_COMM_NULL);
434
+ m_partitioningMode = std::move (other.m_partitioningMode );
414
435
m_partitioningStatus = std::move (other.m_partitioningStatus );
415
436
m_owner = std::move (other.m_owner );
416
437
m_haloSize = std::move (other.m_haloSize );
@@ -520,11 +541,7 @@ void PatchKernel::initialize()
520
541
initializeHaloSize (haloSize);
521
542
522
543
// Mark patch as partioned
523
- if (getCommunicator () != MPI_COMM_NULL) {
524
- setPartitioningStatus (PARTITIONING_CLEAN);
525
- } else {
526
- setPartitioningStatus (PARTITIONING_UNSUPPORTED);
527
- }
544
+ setPartitioningStatus (PARTITIONING_CLEAN);
528
545
529
546
// Initialize partitioning tags
530
547
m_partitioningCellsTag = -1 ;
@@ -8325,11 +8342,13 @@ bool PatchKernel::dump(std::ostream &stream) const
8325
8342
utils::binary::write (stream, m_adaptionMode);
8326
8343
utils::binary::write (stream, m_adaptionStatus);
8327
8344
8328
- // Partition status
8345
+ // Partition information
8329
8346
#if BITPIT_ENABLE_MPI==1
8347
+ utils::binary::write (stream, m_partitioningMode);
8330
8348
utils::binary::write (stream, m_partitioningStatus);
8331
8349
#else
8332
- utils::binary::write (stream, PARTITIONING_UNSUPPORTED);
8350
+ utils::binary::write (stream, PARTITIONING_DISABLED);
8351
+ utils::binary::write (stream, PARTITIONING_CLEAN);
8333
8352
#endif
8334
8353
8335
8354
// Adjacencies build strategy
@@ -8424,10 +8443,14 @@ void PatchKernel::restore(std::istream &stream, bool reregister)
8424
8443
utils::binary::read (stream, m_adaptionMode);
8425
8444
utils::binary::read (stream, m_adaptionStatus);
8426
8445
8427
- // Partition status
8446
+ // Partition information
8428
8447
#if BITPIT_ENABLE_MPI==1
8448
+ utils::binary::read (stream, m_partitioningMode);
8429
8449
utils::binary::read (stream, m_partitioningStatus);
8430
8450
#else
8451
+ PartitioningStatus dummyPartitioningMode;
8452
+ utils::binary::read (stream, dummyPartitioningMode);
8453
+
8431
8454
PartitioningStatus dummyPartitioningStatus;
8432
8455
utils::binary::read (stream, dummyPartitioningStatus);
8433
8456
#endif
0 commit comments