WARPXM v1.10.0
|
The logical flow of setting up a simulation is not necessarily how it all happens under the hood. The following describes the code structure and how it pertains to the logical components described in the WARPXM structure page.
An overview of the structure of WARPXM can also be found in Chapter 4 of Iman Datta's dissertation.
warpxm.cc
holds the main method which accepts any command line arguments and calls three major sub-methods:
warpxm_init()
: Initializes MPI and PETSc.warpxm_main()
: Does a number of things to set up and run the simulation:warpxm_finalize()
: Cleans up MPI and PETSc processes.WmSimulation builds and runs the simulation based on the instructions contained in the WARPXM input file.
The setup reads general simulation parameters from the cryptset:
"debug"
or "info"
, and determines the whether only the info stream or both the info stream and debug stream are printed to the console.data
directory, one for each process.Loggers are created with the desired verbosity in mind.
Finally, a WmSolver is instantiated and it's setup method is called.
The simulate method primarily just calls WmSolver::solve().
It also prints some stuff to the console and notes the time the simulation started and stopped.
The solver initializes a spatial domain, initializes variables, sets up all the WmHostActions and sorts them into sequenced groups, and manages the order that all events occur in time. The WmSolver also handles simulation restarts, manages time step and frame incrimination, handles exceptions, and writes a lot of the progress messages for the debug and informational logging streams.