Line data Source code
1 0 : // Distributed under the MIT License. 2 : // See LICENSE.txt for details. 3 : 4 : #pragma once 5 : 6 : #include "IO/Observer/Initialize.hpp" 7 : #include "IO/Observer/Tags.hpp" 8 : #include "Parallel/Algorithms/AlgorithmGroup.hpp" 9 : #include "Parallel/Algorithms/AlgorithmNodegroup.hpp" 10 : #include "Parallel/ArrayComponentId.hpp" 11 : #include "Parallel/GlobalCache.hpp" 12 : #include "Parallel/ParallelComponentHelpers.hpp" 13 : #include "Parallel/Phase.hpp" 14 : #include "Parallel/PhaseDependentActionList.hpp" 15 : #include "Parallel/Tags/InputSource.hpp" 16 : #include "ParallelAlgorithms/Actions/TerminatePhase.hpp" 17 : #include "Utilities/TMPL.hpp" 18 : 19 : namespace observers { 20 : /*! 21 : * \ingroup ObserversGroup 22 : * \brief The group parallel component that is responsible for reducing data 23 : * to be observed. 24 : * 25 : * Once the data from all elements on the processing element (usually a core) 26 : * has been collected, it is copied (not sent over the network) to the local 27 : * nodegroup parallel component, `ObserverWriter`, for writing to disk. 28 : */ 29 : template <class Metavariables> 30 1 : struct Observer { 31 0 : using chare_type = Parallel::Algorithms::Group; 32 0 : static constexpr bool checkpoint_data = false; 33 0 : using metavariables = Metavariables; 34 0 : using phase_dependent_action_list = tmpl::list< 35 : Parallel::PhaseActions<Parallel::Phase::Initialization, 36 : tmpl::list<Actions::Initialize<Metavariables>, 37 : Parallel::Actions::TerminatePhase>>>; 38 0 : using simple_tags_from_options = Parallel::get_simple_tags_from_options< 39 : Parallel::get_initialization_actions_list<phase_dependent_action_list>>; 40 : 41 0 : static void execute_next_phase( 42 : const Parallel::Phase /*next_phase*/, 43 : Parallel::CProxy_GlobalCache<Metavariables>& /*global_cache*/) {} 44 : }; 45 : 46 : /*! 47 : * \ingroup ObserversGroup 48 : * \brief The nodegroup parallel component that is responsible for writing data 49 : * to disk. 50 : */ 51 : template <class Metavariables> 52 1 : struct ObserverWriter { 53 0 : using chare_type = Parallel::Algorithms::Nodegroup; 54 0 : static constexpr bool checkpoint_data = false; 55 0 : using const_global_cache_tags = 56 : tmpl::list<Tags::ReductionFileName, Tags::VolumeFileName, 57 : ::Parallel::Tags::InputSource>; 58 0 : using metavariables = Metavariables; 59 0 : using phase_dependent_action_list = tmpl::list<Parallel::PhaseActions< 60 : Parallel::Phase::Initialization, 61 : tmpl::list<Actions::InitializeWriter<Metavariables>, 62 : Parallel::Actions::TerminatePhase>>>; 63 0 : using simple_tags_from_options = Parallel::get_simple_tags_from_options< 64 : Parallel::get_initialization_actions_list<phase_dependent_action_list>>; 65 : 66 0 : static void execute_next_phase( 67 : const Parallel::Phase /*next_phase*/, 68 : Parallel::CProxy_GlobalCache<Metavariables>& /*global_cache*/) {} 69 : }; 70 : } // namespace observers