1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// *****************************************************************************
/*!
  \file      src/Main/LBSwitch.hpp
  \copyright 2012-2015 J. Bakosi,
             2016-2018 Los Alamos National Security, LLC.,
             2019-2021 Triad National Security, LLC.,
             2022-2025 J. Bakosi
             All rights reserved. See the LICENSE file for details.
  \brief     Charm++ chare group for switching on/off load balancing
  \details   Charm++ chare group for switching on/off load balancing.
*/
// *****************************************************************************
#ifndef LBSwitch_h
#define LBSwitch_h

#include "Print.hpp"

#include "NoWarning/lbswitch.decl.h"<--- Include file: "NoWarning/lbswitch.decl.h" not found.

namespace tk {

//! Load balancer switch Charm++ chare group class
//! \details Instantiations of LBSwitch comprise a processor aware
//!   Charm++ chare group. When instantiated, a new object is created on each
//!   PE and not more (as opposed to individual chares or chare array object
//!   elements). See also the Charm++ interface file lbswitch.ci.
class LBSwitch : public CBase_LBSwitch {

  public:
    //! Constructor: turn on automatic load balancing
    explicit LBSwitch();

    #if defined(__clang__)
      #pragma clang diagnostic push
      #pragma clang diagnostic ignored "-Wundefined-func-template"
    #endif
    //! Migrate constructor
    explicit LBSwitch( CkMigrateMessage* m ) : CBase_LBSwitch( m ) {
      TurnManualLBOff();
      if (CkMyPe() == 0) Print() << "Xyst> Load balancing on\n";
    }
    #if defined(__clang__)
      #pragma clang diagnostic pop
    #endif

    //! Turn off automatic load balancing
    static void off();

    /** @name Charm++ pack/unpack serializer member functions */
    ///@{
    //! \brief Pack/Unpack serialize member function
    //! \note This is a Charm++ group, pup() is thus only for
    //!    checkpoint/restart.
    void pup( PUP::er& ) override {}
    //! \brief Pack/Unpack serialize operator|
    //! \param[in,out] p Charm++'s PUP::er serializer object reference
    //! \param[in,out] m LBSwitch object reference
    friend void operator|( PUP::er& p, LBSwitch& m ) { m.pup(p); }
    //@}
};

} // tk::

#endif // LBSwitch_h