SpECTRE Documentation Coverage Report
Current view: top level - ParallelAlgorithms/EventsAndTriggers - Completion.hpp Hit Total Coverage
Commit: b1342d46f40e2d46bbd11d0cef68fd973031a24b Lines: 1 8 12.5 %
Date: 2020-09-24 20:24:42
Legend: Lines: hit not hit

          Line data    Source code
       1           0 : // Distributed under the MIT License.
       2             : // See LICENSE.txt for details.
       3             : 
       4             : #pragma once
       5             : 
       6             : #include "Options/Options.hpp"
       7             : #include "Parallel/CharmPupable.hpp"
       8             : #include "Parallel/GlobalCache.hpp"
       9             : #include "ParallelAlgorithms/EventsAndTriggers/Event.hpp"
      10             : #include "Utilities/Registration.hpp"
      11             : #include "Utilities/TMPL.hpp"
      12             : 
      13           0 : namespace Events {
      14             : /// \ingroup EventsAndTriggersGroup
      15             : /// Sets the termination flag for the code to exit.  This event is
      16             : /// automatically registered.
      17             : template <typename EventRegistrars = tmpl::list<>>
      18           1 : class Completion : public Event<EventRegistrars> {
      19             :  public:
      20             :   /// \cond
      21             :   explicit Completion(CkMigrateMessage* /*unused*/) noexcept {}
      22             :   using PUP::able::register_constructor;
      23             :   WRAPPED_PUPable_decl_template(Completion);  // NOLINT
      24             :   /// \endcond
      25             : 
      26           0 :   using options = tmpl::list<>;
      27           0 :   static constexpr Options::String help = {
      28             :       "Sets the termination flag for the code to exit."};
      29             : 
      30           0 :   Completion() = default;
      31             : 
      32           0 :   using argument_tags = tmpl::list<>;
      33             : 
      34             :   template <typename Metavariables, typename ArrayIndex, typename Component>
      35           0 :   void operator()(Parallel::GlobalCache<Metavariables>& cache,
      36             :                   const ArrayIndex& array_index,
      37             :                   const Component* const /*meta*/) const noexcept {
      38             :     auto al_gore =
      39             :         Parallel::get_parallel_component<Component>(cache)[array_index]
      40             :             .ckLocal();
      41             :     al_gore->set_terminate(true);
      42             :   }
      43             : };
      44             : 
      45             : /// \cond
      46             : template <typename EventRegistrars>
      47             : PUP::able::PUP_ID Completion<EventRegistrars>::my_PUP_ID = 0;  // NOLINT
      48             : /// \endcond
      49             : }  // namespace Events

Generated by: LCOV version 1.14