src/Main/UnitTest.C file

UnitTest's Charm++ main chare and main().


UnitTest's Charm++ main chare and main(). This file contains the definition of the Charm++ main chare, equivalent to main() in Charm++- land, running the serial and Charm++ unit tests as well as the ordinary main() function, running the MPI unit test suite.


namespace unittest
UnitTest declarations and definitions.


class Main
Charm++ main chare for the file converter executable, fileconv.
class execute
Charm++ chare execute.


auto main(int argc, char** argv) -> int
UnitTest main()


CProxy_Main mainProxy
Charm handle to the main proxy, facilitates call-back to finalize, etc., must be in global scope, unique per executable.
tk::CProxy_ChareStateCollector stateProxy
Chare state collector Charm++ chare group proxy.

Function documentation

int main(int argc, char** argv)

UnitTest main()

UnitTest does have a main() function so that we can have tests calling MPI functions. Thus we are using Charm++'s MPI-interoperation capability as would have to be done with interoperation with an MPI library. This is necessary, since MPI_Init() is a bit adamant about capturing resources it wants and hence it has to be called before Charm is initialized.