Branch data Line data Source code
1 : : // *****************************************************************************
2 : : /*!
3 : : \file src/Main/LBSwitch.cpp
4 : : \copyright 2012-2015 J. Bakosi,
5 : : 2016-2018 Los Alamos National Security, LLC.,
6 : : 2019-2021 Triad National Security, LLC.,
7 : : 2022-2025 J. Bakosi
8 : : All rights reserved. See the LICENSE file for details.
9 : : \brief Charm++ chare group for switching on/off load balancing
10 : : \details Charm++ chare group for switching on/off load balancing.
11 : : */
12 : : // *****************************************************************************
13 : :
14 : : #include <iostream>
15 : :
16 : : #include "LBSwitch.hpp"
17 : : #include "Print.hpp"
18 : :
19 : : using tk::LBSwitch;
20 : :
21 : 770 : LBSwitch::LBSwitch()
22 : : // *****************************************************************************
23 : : // Constructor: turn on automatic load balancing
24 : : // *****************************************************************************
25 : : {
26 [ + - ]: 770 : TurnManualLBOff();
27 [ + + ][ + - ]: 770 : if (CkMyPe() == 0) Print() << "Xyst> Load balancing on\n";
28 : 770 : }
29 : :
30 : : void
31 : : // cppcheck-suppress unusedFunction
32 : 804 : LBSwitch::off()
33 : : // *****************************************************************************
34 : : // Turn off automatic load balancing
35 : : //! \details Since this is a [initproc] routine, the runtime system executes the
36 : : //! routine exactly once on every PE early on in the Charm++ init
37 : : //! sequence. Must be static as it is called without an object. See also:
38 : : //! Section "Initializations at Program Startup" at in the Charm++ manual
39 : : //! http://charm.cs.illinois.edu/manuals/html/charm++/manual.html.
40 : : // *****************************************************************************
41 : : {
42 : 804 : TurnManualLBOn();
43 : :
44 [ + + ][ + - ]: 804 : if (CkMyPe() == 0) Print() << "Xyst> Load balancing off\n";
45 : 804 : }
46 : :
47 : : #include "NoWarning/lbswitch.def.h"
|