@@ -243,7 +243,6 @@ PatchKernel::PatchKernel(const PatchKernel &other)
243
243
m_boxMaxCounter(other.m_boxMaxCounter),
244
244
m_adjacenciesBuildStrategy(other.m_adjacenciesBuildStrategy),
245
245
m_interfacesBuildStrategy(other.m_interfacesBuildStrategy),
246
- m_spawnStatus(other.m_spawnStatus),
247
246
m_adaptionMode(other.m_adaptionMode),
248
247
m_adaptionStatus(other.m_adaptionStatus),
249
248
m_dimension(other.m_dimension),
@@ -330,7 +329,6 @@ PatchKernel::PatchKernel(PatchKernel &&other)
330
329
m_boxMaxCounter(std::move(other.m_boxMaxCounter)),
331
330
m_adjacenciesBuildStrategy(std::move(other.m_adjacenciesBuildStrategy)),
332
331
m_interfacesBuildStrategy(std::move(other.m_interfacesBuildStrategy)),
333
- m_spawnStatus(std::move(other.m_spawnStatus)),
334
332
m_adaptionMode(std::move(other.m_adaptionMode)),
335
333
m_adaptionStatus(std::move(other.m_adaptionStatus)),
336
334
m_id(std::move(other.m_id)),
@@ -420,7 +418,6 @@ PatchKernel & PatchKernel::operator=(PatchKernel &&other)
420
418
m_boxMaxCounter = std::move (other.m_boxMaxCounter );
421
419
m_adjacenciesBuildStrategy = std::move (other.m_adjacenciesBuildStrategy );
422
420
m_interfacesBuildStrategy = std::move (other.m_interfacesBuildStrategy );
423
- m_spawnStatus = std::move (other.m_spawnStatus );
424
421
m_adaptionMode = std::move (other.m_adaptionMode );
425
422
m_adaptionStatus = std::move (other.m_adaptionStatus );
426
423
m_id = std::move (other.m_id );
@@ -524,13 +521,10 @@ void PatchKernel::initialize()
524
521
// Set interfaces build strategy
525
522
setInterfacesBuildStrategy (INTERFACES_NONE);
526
523
527
- // Set the spawn as unneeded
528
- //
529
- // Specific implementation will set the appropriate status during their
530
- // initialization.
531
- setSpawnStatus (SPAWN_UNNEEDED);
532
-
533
524
// Set the adaption as clean
525
+ //
526
+ // Setting the adaptation as dirty guarantees that, at the first patch
527
+ // updated, all the data structures will be properly initialized.
534
528
setAdaptionStatus (ADAPTION_CLEAN);
535
529
536
530
#if BITPIT_ENABLE_MPI==1
@@ -646,12 +640,6 @@ std::vector<adaption::Info> PatchKernel::update(bool trackAdaption, bool squeeze
646
640
// Finalize alterations
647
641
finalizeAlterations (squeezeStorage);
648
642
649
- // Spawn
650
- bool spawnNeeed = (getSpawnStatus () == SPAWN_NEEDED);
651
- if (spawnNeeed) {
652
- mergeAdaptionInfo (spawn (trackAdaption), updateInfo);
653
- }
654
-
655
643
// Adaption
656
644
bool adaptionDirty = (getAdaptionStatus (true ) == ADAPTION_DIRTY);
657
645
if (adaptionDirty) {
@@ -681,44 +669,6 @@ void PatchKernel::simulateCellUpdate(const long id, adaption::Marker marker, std
681
669
throw std::runtime_error (" This function has not been implemented for the specified patch." );
682
670
}
683
671
684
- /* !
685
- Generates the patch.
686
-
687
- \param trackSpawn if set to true the changes to the patch will be tracked
688
- \result Returns a vector of adaption::Info that can be used to track
689
- the changes done during the spawn.
690
- */
691
- std::vector<adaption::Info> PatchKernel::spawn (bool trackSpawn)
692
- {
693
- std::vector<adaption::Info> spawnInfo;
694
-
695
- #if BITPIT_ENABLE_MPI==1
696
- // This is a collevtive operation and should be called by all processes
697
- if (isPartitioned ()) {
698
- const auto &communicator = getCommunicator ();
699
- MPI_Barrier (communicator);
700
- }
701
- #endif
702
-
703
- // Check spawn status
704
- SpawnStatus spawnStatus = getSpawnStatus ();
705
- if (spawnStatus == SPAWN_UNNEEDED || spawnStatus == SPAWN_DONE) {
706
- return spawnInfo;
707
- }
708
-
709
- // Spawn the patch
710
- spawnInfo = _spawn (trackSpawn);
711
-
712
- // Finalize patch alterations
713
- finalizeAlterations (true );
714
-
715
- // Spwan is done
716
- setSpawnStatus (SPAWN_DONE);
717
-
718
- // Done
719
- return spawnInfo;
720
- }
721
-
722
672
/* !
723
673
Execute patch adaption.
724
674
@@ -1335,33 +1285,6 @@ void PatchKernel::_writeFinalize()
1335
1285
// Nothing to do
1336
1286
}
1337
1287
1338
- /* !
1339
- Returns the current spawn status.
1340
-
1341
- Span functionality is obsolete. The patch dosn't need to be spawned
1342
- anymore.
1343
-
1344
- \return The current spawn status.
1345
- */
1346
- PatchKernel::SpawnStatus PatchKernel::getSpawnStatus () const
1347
- {
1348
- // There is no need to check the spawn status globally because the spawn
1349
- // status will always be the same on all the processes.
1350
-
1351
- return m_spawnStatus;
1352
- }
1353
-
1354
- /* !
1355
- Set the current spawn status.
1356
-
1357
- \param status is the spawn status that will be set
1358
- */
1359
- void PatchKernel::setSpawnStatus (SpawnStatus status)
1360
- {
1361
- m_spawnStatus = status;
1362
- }
1363
-
1364
-
1365
1288
/* !
1366
1289
Checks if the patch supports adaption.
1367
1290
@@ -1470,10 +1393,6 @@ bool PatchKernel::isDirty(bool global) const
1470
1393
assert (isDirty || m_alteredInterfaces.empty ());
1471
1394
}
1472
1395
1473
- if (!isDirty) {
1474
- isDirty |= (getSpawnStatus () == SPAWN_NEEDED);
1475
- }
1476
-
1477
1396
if (!isDirty) {
1478
1397
isDirty |= (getAdaptionStatus (false ) == ADAPTION_DIRTY);
1479
1398
}
@@ -5265,24 +5184,6 @@ void PatchKernel::restoreInterfaces(std::istream &stream)
5265
5184
setAdaptionMode (previousAdaptionMode);
5266
5185
}
5267
5186
5268
- /* !
5269
- Generates the patch.
5270
-
5271
- Default implementation is a no-op function.
5272
-
5273
- \param trackSpawn if set to true the changes to the patch will be tracked
5274
- \result Returns a vector of adaption::Info that can be used to track
5275
- the changes done during the spawn.
5276
- */
5277
- std::vector<adaption::Info> PatchKernel::_spawn (bool trackSpawn)
5278
- {
5279
- BITPIT_UNUSED (trackSpawn);
5280
-
5281
- assert (false && " The patch needs to implement _spawn" );
5282
-
5283
- return std::vector<adaption::Info>();
5284
- }
5285
-
5286
5187
/* !
5287
5188
Prepares the patch for performing the adaption.
5288
5189
@@ -8335,9 +8236,6 @@ bool PatchKernel::dump(std::ostream &stream) const
8335
8236
utils::binary::write (stream, 0 );
8336
8237
#endif
8337
8238
8338
- // Spawn status
8339
- utils::binary::write (stream, m_spawnStatus);
8340
-
8341
8239
// Adaption information
8342
8240
utils::binary::write (stream, m_adaptionMode);
8343
8241
utils::binary::write (stream, m_adaptionStatus);
@@ -8436,9 +8334,6 @@ void PatchKernel::restore(std::istream &stream, bool reregister)
8436
8334
utils::binary::read (stream, dummyHaloSize);
8437
8335
#endif
8438
8336
8439
- // Spawn status
8440
- utils::binary::read (stream, m_spawnStatus);
8441
-
8442
8337
// Adaption information
8443
8338
utils::binary::read (stream, m_adaptionMode);
8444
8339
utils::binary::read (stream, m_adaptionStatus);
0 commit comments