Main class

Charm++ main chare for the shock hydrodynamics executable, inciter.

Charm++ main chare for the unit test suite executable, unittest.

Charm++ main chare for the mesh converter executable, meshconv.

In inciter the Charm++ runtime system is initialized only after the mesh has been read in, partitioned, and the necessary data structures, e.g., communication maps, have been generated. This delayed initialization of the Charm++ runtime system is required since the mesh partitioning is done by Zoltan, an MPI library. Note that this Charm++ main chare object should not be in a namespace.

Note that this object should not be in a namespace.

Constructors, destructors, conversion operators

Main(CkArgMsg* msg)
Constructor.
Main(CkMigrateMessage* msg) explicit
Migrate constructor: returning from a checkpoint.
Main(CkArgMsg* msg)
Constructor.
Main(CkArgMsg* msg)
Constructor.

Public functions

void execute()
Execute driver created and initialized by constructor.
void finalize()
Towards normal exit but collect chare state first (if any)
void quiescence()
Entry method triggered when quiescence is detected.
void dumpstate(CkReductionMsg* msg)
Dump chare state.
void finalize()
Towards normal exit but collect chare state first (if any)
void timestamp(std::string label, tk::real stamp)
Add a time stamp contributing to final timers output.
void timestamp(const std::vector<std::pair<std::string, tk::real>>& s)
Add multiple time stamps contributing to final timers output.
void quiescence()
Entry method triggered when quiescence is detected.
void dumpstate(CkReductionMsg* msg)
Dump chare state.
void finalize(bool pass)
Towards normal exit but collect chare state first (if any)
void quiescence()
Entry method triggered when quiescence is detected.
void dumpstate(CkReductionMsg* msg)
Dump chare state.

Charm++ pack/unpack serializer member functions

int m_signal
Used to set signal handlers.
inciter::ctr::CmdLine m_cmdline
Command line.
inciter::CmdLineParser m_cmdParser
Command line parser.
inciter::InciterDriver m_driver
Driver.
std::vector<tk::Timer> m_timer
Timers.
std::vector<std::pair<std::string, tk::Timer::Watch>> m_timestamp
Time stamps in h:m:s with labels.
void pup(PUP::er& p) override
Pack/Unpack serialize member function.
void operator|(PUP::er& p, Main& m)
Pack/Unpack serialize operator|.

Function documentation

Main::Main(CkArgMsg* msg)

Constructor.

Inciter's main chare constructor is the entry point of the Charm++ portion of inciter, called by the Charm++ runtime system. The constructor does basic initialization steps, prints out some useful information to screen (in verbose mode), and instantiates a driver. Since Charm++ is fully asynchronous, the constructor usually spawns asynchronous objects and immediately exits. Thus in the body of the main chare constructor we fire up an 'execute' chare, which then calls back to Main::execute(). Finishing the main chare constructor the Charm++ runtime system then starts the network-migration of all global-scope data (if any). The execute chare calling back to Main::execute() signals the end of the migration of the global-scope data. Then we are ready to execute the driver. Since inciter is parallel and asynchronous, its driver fires up additional Charm++ chare objects which then call back to Main::finalize() at some point in the future when all work has been finished. finalize() then exits by calling Charm++'s CkExit(), shutting down the runtime system.

Main::Main(CkArgMsg* msg)

Constructor.

MeshConv's main chare constructor is the entry point of the program, called by the Charm++ runtime system. The constructor does basic initialization steps, e.g., parser the command-line, prints out some useful information to screen (in verbose mode), and instantiates a driver. Since Charm++ is fully asynchronous, the constructor usually spawns asynchronous objects and immediately exits. Thus in the body of the main chare constructor we fire up an 'execute' chare, which then calls back to Main::execute(). Finishing the main chare constructor the Charm++ runtime system then starts the network-migration of all global-scope data (if any). The execute chare calling back to Main::execute() signals the end of the migration of the global-scope data. Then we are ready to execute the driver which calls back to Main::finalize() when it finished. Then finalize() exits by calling Charm++'s CkExit(), shutting down the runtime system.

Main::Main(CkArgMsg* msg)

Constructor.

UnitTest's main chare constructor is the entry point of the program, called by the Charm++ runtime system. The constructor does basic initialization steps, e.g., parser the command-line, prints out some useful information to screen (in verbose mode), and instantiates a driver. Since Charm++ is fully asynchronous, the constructor usually spawns asynchronous objects and immediately exits. Thus in the body of the main chare constructor we fire up an 'execute' chare, which then calls back to Main::execute(). Finishing the main chare constructor the Charm++ runtime system then starts the network-migration of all global-scope data (if any). The execute chare calling back to Main::execute() signals the end of the migration of the global-scope data. Then we are ready to execute the driver. Since the unit test suite is parallel and asynchronous, its driver fires up additional Charm++ chare objects which then call back to Main::finalize() at some point in the future when all work has been finished. finalize() then exits by calling Charm++'s CkExit(), shutting down the runtime system.

void Main::pup(PUP::er& p) override

Pack/Unpack serialize member function.

Parameters
in/out Charm++'s PUP::er serializer object reference

void Main::operator|(PUP::er& p, Main& m)

Pack/Unpack serialize operator|.

Parameters
in/out Charm++'s PUP::er serializer object reference
in/out Mainchare object reference

Variable documentation

std::vector<tk::Timer> Main::m_timer

Timers.

Timers