Quinoa all test code coverage report
Current view: top level - Base - ChareStateCollector.hpp (source / functions) Hit Total Coverage
Commit: -128-NOTFOUND Lines: 6 6 100.0 %
Date: 2024-04-29 14:42:33 Functions: 3 3 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : // *****************************************************************************
       2                 :            : /*!
       3                 :            :   \file      src/Base/ChareStateCollector.hpp
       4                 :            :   \copyright 2012-2015 J. Bakosi,
       5                 :            :              2016-2018 Los Alamos National Security, LLC.,
       6                 :            :              2019-2021 Triad National Security, LLC.
       7                 :            :              All rights reserved. See the LICENSE file for details.
       8                 :            :   \brief     Charm++ chare state collector group
       9                 :            :   \details   Charm++ chare state collectory group used for debugging.
      10                 :            : */
      11                 :            : // *****************************************************************************
      12                 :            : #ifndef ChareStateCollector_h
      13                 :            : #define ChareStateCollector_h
      14                 :            : 
      15                 :            : #include <string>
      16                 :            : 
      17                 :            : #include "Timer.hpp"
      18                 :            : #include "ChareState.hpp"
      19                 :            : 
      20                 :            : #include "NoWarning/charestatecollector.decl.h"
      21                 :            : 
      22                 :            : namespace tk {
      23                 :            : 
      24                 :            : //! Chare state Charm++ chare group class
      25                 :            : //! \details Instantiations of ChareStateCollector comprise a processor aware
      26                 :            : //!   Charm++ chare group. When instantiated, a new object is created on each
      27                 :            : //!   PE and not more (as opposed to individual chares or chare array object
      28                 :            : //!   elements). See also the Charm++ interface file charestatecollector.ci.
      29                 :            : class ChareStateCollector : public CBase_ChareStateCollector {
      30                 :            : 
      31                 :            :   public:
      32                 :            :     #if defined(__clang__)
      33                 :            :       #pragma clang diagnostic push
      34                 :            :       #pragma clang diagnostic ignored "-Wundefined-func-template"
      35                 :            :     #endif
      36                 :            :     //! Constructor
      37                 :            :     //! \details Start timer when constructor is called
      38                 :        412 :     explicit ChareStateCollector() : m_state(), m_timer() {}
      39                 :            : 
      40                 :            :     //! Migrate constructor
      41                 :          5 :     explicit ChareStateCollector( CkMigrateMessage* m ) :
      42                 :          5 :       CBase_ChareStateCollector( m ) {}
      43                 :            :     #if defined(__clang__)
      44                 :            :       #pragma clang diagnostic pop
      45                 :            :     #endif
      46                 :            : 
      47                 :            :     //! Configure Charm++ reduction types
      48                 :            :     static void registerReducers();
      49                 :            : 
      50                 :            :     //! Insert new state entry
      51                 :            :     void insert( const std::string& ch, int id, int pe, uint64_t it,
      52                 :            :                  const std::string& fn );
      53                 :            : 
      54                 :            :     //! Collect chare state
      55                 :            :     void collect( bool error, CkCallback cb );
      56                 :            : 
      57                 :            :     /** @name Charm++ pack/unpack serializer member functions */
      58                 :            :     ///@{
      59                 :            :     //! \brief Pack/Unpack serialize member function
      60                 :            :     //! \param[in,out] p Charm++'s PUP::er serializer object reference
      61                 :            :     //! \note This is a Charm++ group, pup() is thus only for
      62                 :            :     //!    checkpoint/restart.
      63                 :        260 :     void pup( PUP::er &p ) override {
      64                 :        260 :       p | m_state;
      65                 :            :       p | m_timer;
      66                 :        260 :     }
      67                 :            :     //! \brief Pack/Unpack serialize operator|
      68                 :            :     //! \param[in,out] p Charm++'s PUP::er serializer object reference
      69                 :            :     //! \param[in,out] i ChareStateCollector object reference
      70                 :            :     friend void operator|( PUP::er& p, ChareStateCollector& i ) { i.pup(p); }
      71                 :            :     //@}
      72                 :            : 
      73                 :            :   private:
      74                 :            :     std::vector< ChareState > m_state;  //!< Chare states
      75                 :            :     Timer m_timer;                      //!< Timer for getting time stamps
      76                 :            : };
      77                 :            : 
      78                 :            : } // tk::
      79                 :            : 
      80                 :            : #endif // ChareStateCollector_h

Generated by: LCOV version 1.14