OpenAtom
Version1.5a
|
The Main of CPAIMD, it calls all the init functions. More...
Functions | |
void | InstanceController::doneInit (CkReductionMsg *msg) |
The Main of CPAIMD, it calls all the init functions.
Phase 0 is kicked off by reaching the end of main. This turns execution completely over to the Charm++ scheduler, at which point it will process the object constructor messages that we triggered in the proxy creation in main. Object construction will occur in this order + all readonlies will be initialized. + all groups will be constructed + all arrays will be constructed
The ordering within those phases is non-deterministic, so we don't expect to have control over the ordering of chare array construction. The upshot of this is that in order to safely make array sections we wait until the objects are constructed and then call a second phase of initialization. In practice this means that arrays will contribute to reductions during construction and the completion of those reductions will trigger a chain of section creation which will eventually feed back into a reduction that reports to the global startup phase ordering in InstanceController.
Startup parses the physics simulation input, parses the parallel driver config file, constructs chares, computes chare placement, coordinates the launch of chares in parallel, the reading of input, and initiates computation when everything is initialized and ready to start timestepping.
1) Read PINY config and the rest of the physical system parameter files to set the constants which determine problem size. These are stored in the CPcharmParaInfo class object named sim (for simulation).
2) Read the cpaimd_config file which determines parallel decomposition. This is mostly stored in the config object, but a bunch of readonly globals also get instantiated with this information.
3) Topological map setup : we initialize several structures which will be useful for using network topology for more optimal chare placement
4) Parallel Object Proxy Creation We loop through a four deep nested launcher by integral, kpoint, temper, and spin to construct the appropriate chare arrays for each instance.
In each case we are constructing the proxy and calling for parallel object construction of the elements in each of those arrays. Note that while we are inside Main the chares for PE 0 will be constructed inline in program order. No assumptions should be made about chares constructed on other PEs until we exit main and pass control to the Charm++ scheduler for parallel launch.