@@ -243,7 +243,6 @@ PatchKernel::PatchKernel(const PatchKernel &other)
243243 m_boxMaxCounter(other.m_boxMaxCounter),
244244 m_adjacenciesBuildStrategy(other.m_adjacenciesBuildStrategy),
245245 m_interfacesBuildStrategy(other.m_interfacesBuildStrategy),
246- m_spawnStatus(other.m_spawnStatus),
247246 m_adaptionMode(other.m_adaptionMode),
248247 m_adaptionStatus(other.m_adaptionStatus),
249248 m_dimension(other.m_dimension),
@@ -330,7 +329,6 @@ PatchKernel::PatchKernel(PatchKernel &&other)
330329 m_boxMaxCounter(std::move(other.m_boxMaxCounter)),
331330 m_adjacenciesBuildStrategy(std::move(other.m_adjacenciesBuildStrategy)),
332331 m_interfacesBuildStrategy(std::move(other.m_interfacesBuildStrategy)),
333- m_spawnStatus(std::move(other.m_spawnStatus)),
334332 m_adaptionMode(std::move(other.m_adaptionMode)),
335333 m_adaptionStatus(std::move(other.m_adaptionStatus)),
336334 m_id(std::move(other.m_id)),
@@ -420,7 +418,6 @@ PatchKernel & PatchKernel::operator=(PatchKernel &&other)
420418 m_boxMaxCounter = std::move (other.m_boxMaxCounter );
421419 m_adjacenciesBuildStrategy = std::move (other.m_adjacenciesBuildStrategy );
422420 m_interfacesBuildStrategy = std::move (other.m_interfacesBuildStrategy );
423- m_spawnStatus = std::move (other.m_spawnStatus );
424421 m_adaptionMode = std::move (other.m_adaptionMode );
425422 m_adaptionStatus = std::move (other.m_adaptionStatus );
426423 m_id = std::move (other.m_id );
@@ -524,13 +521,10 @@ void PatchKernel::initialize()
524521 // Set interfaces build strategy
525522 setInterfacesBuildStrategy (INTERFACES_NONE);
526523
527- // Set the spawn as unneeded
528- //
529- // Specific implementation will set the appropriate status during their
530- // initialization.
531- setSpawnStatus (SPAWN_UNNEEDED);
532-
533524 // 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.
534528 setAdaptionStatus (ADAPTION_CLEAN);
535529
536530#if BITPIT_ENABLE_MPI==1
@@ -646,12 +640,6 @@ std::vector<adaption::Info> PatchKernel::update(bool trackAdaption, bool squeeze
646640 // Finalize alterations
647641 finalizeAlterations (squeezeStorage);
648642
649- // Spawn
650- bool spawnNeeed = (getSpawnStatus () == SPAWN_NEEDED);
651- if (spawnNeeed) {
652- mergeAdaptionInfo (spawn (trackAdaption), updateInfo);
653- }
654-
655643 // Adaption
656644 bool adaptionDirty = (getAdaptionStatus (true ) == ADAPTION_DIRTY);
657645 if (adaptionDirty) {
@@ -681,44 +669,6 @@ void PatchKernel::simulateCellUpdate(const long id, adaption::Marker marker, std
681669 throw std::runtime_error (" This function has not been implemented for the specified patch." );
682670}
683671
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-
722672/* !
723673 Execute patch adaption.
724674
@@ -1335,33 +1285,6 @@ void PatchKernel::_writeFinalize()
13351285 // Nothing to do
13361286}
13371287
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-
13651288/* !
13661289 Checks if the patch supports adaption.
13671290
@@ -1470,10 +1393,6 @@ bool PatchKernel::isDirty(bool global) const
14701393 assert (isDirty || m_alteredInterfaces.empty ());
14711394 }
14721395
1473- if (!isDirty) {
1474- isDirty |= (getSpawnStatus () == SPAWN_NEEDED);
1475- }
1476-
14771396 if (!isDirty) {
14781397 isDirty |= (getAdaptionStatus (false ) == ADAPTION_DIRTY);
14791398 }
@@ -5265,24 +5184,6 @@ void PatchKernel::restoreInterfaces(std::istream &stream)
52655184 setAdaptionMode (previousAdaptionMode);
52665185}
52675186
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-
52865187/* !
52875188 Prepares the patch for performing the adaption.
52885189
@@ -8335,9 +8236,6 @@ bool PatchKernel::dump(std::ostream &stream) const
83358236 utils::binary::write (stream, 0 );
83368237#endif
83378238
8338- // Spawn status
8339- utils::binary::write (stream, m_spawnStatus);
8340-
83418239 // Adaption information
83428240 utils::binary::write (stream, m_adaptionMode);
83438241 utils::binary::write (stream, m_adaptionStatus);
@@ -8436,9 +8334,6 @@ void PatchKernel::restore(std::istream &stream, bool reregister)
84368334 utils::binary::read (stream, dummyHaloSize);
84378335#endif
84388336
8439- // Spawn status
8440- utils::binary::read (stream, m_spawnStatus);
8441-
84428337 // Adaption information
84438338 utils::binary::read (stream, m_adaptionMode);
84448339 utils::binary::read (stream, m_adaptionStatus);
0 commit comments