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 : using metavariables = Metavariables; 33 0 : using phase_dependent_action_list = tmpl::list< 34 : Parallel::PhaseActions<Parallel::Phase::Initialization, 35 : tmpl::list<Actions::Initialize<Metavariables>, 36 : Parallel::Actions::TerminatePhase>>>; 37 0 : using simple_tags_from_options = Parallel::get_simple_tags_from_options< 38 : Parallel::get_initialization_actions_list<phase_dependent_action_list>>; 39 : 40 0 : static void execute_next_phase( 41 : const Parallel::Phase /*next_phase*/, 42 : Parallel::CProxy_GlobalCache<Metavariables>& /*global_cache*/) {} 43 : }; 44 : 45 : /*! 46 : * \ingroup ObserversGroup 47 : * \brief The nodegroup parallel component that is responsible for writing data 48 : * to disk. 49 : */ 50 : template <class Metavariables> 51 1 : struct ObserverWriter { 52 0 : using chare_type = Parallel::Algorithms::Nodegroup; 53 0 : using const_global_cache_tags = 54 : tmpl::list<Tags::ReductionFileName, Tags::VolumeFileName, 55 : ::Parallel::Tags::InputSource>; 56 0 : using metavariables = Metavariables; 57 0 : using phase_dependent_action_list = tmpl::list<Parallel::PhaseActions< 58 : Parallel::Phase::Initialization, 59 : tmpl::list<Actions::InitializeWriter<Metavariables>, 60 : Parallel::Actions::TerminatePhase>>>; 61 0 : using simple_tags_from_options = Parallel::get_simple_tags_from_options< 62 : Parallel::get_initialization_actions_list<phase_dependent_action_list>>; 63 : 64 0 : static void execute_next_phase( 65 : const Parallel::Phase /*next_phase*/, 66 : Parallel::CProxy_GlobalCache<Metavariables>& /*global_cache*/) {} 67 : }; 68 : } // namespace observers