PlasCom2  1.0
XPACC Multi-physics simluation application
application Class Reference

Detailed Description

Definition at line 40 of file PlasCom2.H.

#include <PlasCom2.H>

Public Member Functions

 application (int numArgs, char **argList, MPI_Comm mpiCommunicator)
 
virtual int ConfigureApplication ()
 Read & BC configuration, process application-wide configuration. More...
 
virtual int ConfigureSimulation ()
 Configure simluation-specific constructs. More...
 
virtual int ConfigureDomains ()
 Configure simulation domains. More...
 
virtual int InitializeApplication ()
 
virtual int RunApplication ()
 
virtual int FinalizeApplication ()
 
virtual int WriteDomains ()
 
virtual int ReadDomains ()
 
virtual int Restart ()
 
void SetRestart (int trufals=1)
 
int RunEulerPBSPeriodic ()
 
int RunPlasCom2 ()
 
int RunMaxwellSolver ()
 
int ConfigureGeometries ()
 Configure simulation geometries. More...
 
void SetNumGrids (int nGrids)
 
int SetNumPointsGrid (int iGrid, size_t numPoints)
 
void SetNumSteps (size_t nSteps)
 
- Public Member Functions inherited from application< DomainBaseT >
 application (int numArgs, char **argList, MPI_Comm mpiCommunicator)
 
virtual int AdvanceDomains ()
 
virtual bool Finished ()
 
virtual int InitializeRun ()
 
virtual int InitializeDomains ()
 
virtual int Advance ()
 
virtual int FinalizeRun ()
 
virtual int FinalizeDomains ()
 
virtual bool RestartStep ()
 
virtual bool OutputStep ()
 
virtual int InitializeStep ()
 
virtual int FinalizeStep ()
 
virtual int RestartDomains ()
 
virtual int WriteRestart ()
 
virtual int InitializeSimulation ()
 
DomainInfoType DomainInfo ()
 
int NumberOfDomains ()
 
domainvectorGetDomains ()
 
- Public Member Functions inherited from parallelprogram
 parallelprogram ()
 Default constructor. More...
 
 parallelprogram (int nargs, char **args)
 Constructor designed to take all commandline args. More...
 
 parallelprogram (int nargs, char **args, MPI_Comm inMPICommunicator)
 Constructor designed to take all commandline args and an MPI Communicator. More...
 
 parallelprogram (commandline &comline, CommunicatorType &incomm)
 Constructor designed to take a commandline object, and communicator object. More...
 
virtual int Initialize ()
 Populates native data structures from commandline. More...
 
virtual ~parallelprogram ()
 Destructor. More...
 
virtual int Run ()
 This function implements the main function executed by the program. More...
 
virtual int Finalize ()
 Finalizes the global object, and it's profiler object. More...
 
- Public Member Functions inherited from mpiprogram< ComLineType >
 mpiprogram ()
 
 mpiprogram (mpiglobal &inglob)
 
 mpiprogram (ComLineType &incom)
 
 mpiprogram (int narg, char **args)
 
 mpiprogram (ComLineType &incom, mpiglobal &inglob)
 
 mpiprogram (int narg, char **args, mpiglobal &inglob)
 
 mpiprogram (int narg, char **args, MPI_Comm &inComm)
 
ComLineType & CommandLine ()
 
virtual ~mpiprogram ()
 
- Public Member Functions inherited from mpiglobal
 mpiglobal ()
 
 mpiglobal (parallelglobal &inglob)
 
 mpiglobal (mpiglobal &pglobin)
 
 mpiglobal (const std::string &name)
 
 mpiglobal (const std::string &name, unsigned int id)
 
 mpiglobal (int narg, char **args)
 
 mpiglobal (int narg, char **args, CommunicatorType &incomm)
 
 mpiglobal (int narg, char **args, MPI_Comm &incomm)
 
int NumProc ()
 
- Public Member Functions inherited from ParallelGlobalObj< CommunicatorType, StackType, ErrorType, ProfilerType >
 ParallelGlobalObj ()
 
 ParallelGlobalObj (GlobalType &inglob)
 
 ParallelGlobalObj (ParallelGlobalObj< CommunicatorType, StackType, ErrorType, ProfilerType > &pglobin)
 
 ParallelGlobalObj (const std::string &name)
 
 ParallelGlobalObj (const std::string &name, unsigned int id)
 
 ParallelGlobalObj (int narg, char **args)
 
 ParallelGlobalObj (int narg, char **args, CommunicatorType &incomm)
 
virtual int Init (const std::string &name, CommunicatorType &incomm)
 
virtual int Init (const std::string &name)
 
virtual int Init (const std::string &name, unsigned int id)
 
virtual int Init (int narg, char **args)
 
bool ProfilingBarriers ()
 
void EnableProfilingBarriers ()
 
void DisableProfilingBarriers ()
 
virtual void FunctionEntry (const StackType &stackentry)
 FunctionEntry updates the Stack as well as the Profiler. More...
 
virtual void FunctionExit (const StackType &stackentry)
 FunctionExit updates the Stack as well as the Profiler. More...
 
virtual int Rank ()
 
virtual int NProc ()
 
virtual CommunicatorTypeCommunicator ()
 
virtual ~ParallelGlobalObj ()
 
- Public Member Functions inherited from GlobalObj< StackType, ErrorType, ProfilerType >
 GlobalObj ()
 Default constructor. Profiling is OFF by default. More...
 
 GlobalObj (int narg, char **args)
 Default constructor. More...
 
 GlobalObj (GlobalObj< StackType, ErrorType, ProfilerType > &globin)
 Constructor with args. More...
 
 GlobalObj (const StackType &name)
 Constructor with args. More...
 
 GlobalObj (const StackType &name, int id)
 Constructor with args. More...
 
virtual int Init (const StackType &name)
 Initializes the global object and it's profiler object /// Initializes the global object and it's profiler object Profiling is ON by default if Init is invoked. More...
 
virtual int Init (const StackType &name, unsigned int id)
 Initializes the global object and it's profiler object Profiling is ON by default if Init is invoked. More...
 
virtual bool WriteProfiles ()
 Get state of enablement for writing profile files. More...
 
virtual bool WriteProfiles (bool yn)
 Enable or disable profile file writing. More...
 
virtual bool Profiling ()
 Get profiling state. More...
 
virtual bool Profiling (bool yn)
 Enable or disable profiling. More...
 
virtual void Report (std::ostream &ReportStream)
 Creates the final profiling report on the specified stream. More...
 
virtual void Register (const StackType &stackentry)
 Register will push to the Stack only. More...
 
virtual void DeRegister (const StackType &stackentry)
 DeRegister will pop from the stack only. More...
 
virtual void FunctionExitAll ()
 FunctionExitAll exits all from the Profiler only. More...
 
virtual void Error (const ErrorType &error)
 Pushes an error onto the error stack. More...
 
virtual void DumpErrors (std::ostream &Ostr)
 Dumps the errors themselves to the indicated stream. More...
 
virtual void DumpStack (std::ostream &Ostr)
 Dumps the code construct statck to the indicated stream. More...
 
virtual void DumpProfile (std::ostream &Ostr)
 Dumps the timing profile to the indicated stream. More...
 
bool DebugStreamReady ()
 Checks debug stream. More...
 
void SetDebugStream (std::ostream &dbstream)
 Sets the debug stream object. More...
 
std::ostream & DebugStream ()
 Gets the debug stream object. More...
 
std::ostream * DebugStreamPtr ()
 Gets the debug stream pointer. More...
 
bool ErrStreamReady ()
 Checks error stream. More...
 
void SetErrStream (std::ostream &dbstream)
 Sets the error stream object. More...
 
std::ostream & ErrStream ()
 Gets the error stream object. More...
 
std::ostream * ErrStreamPtr ()
 Gets the error stream pointer. More...
 
bool OutStreamReady ()
 Checks out stream. More...
 
void SetOutStream (std::ostream &outstream)
 Sets the stdout stream object. More...
 
std::ostream & OutStream ()
 Gets the stdout stream object. More...
 
std::ostream * OutStreamPtr ()
 Gets the stdout stream pointer. More...
 
void UnsetOutStream ()
 Sets outstream to NULL. More...
 
bool LogStreamReady ()
 Checks log stream. More...
 
void SetLogStream (std::ostream &logstream)
 Sets the stdout stream object. More...
 
std::ostream & LogStream ()
 Gets the log stream object. More...
 
std::ostream * LogStreamPtr ()
 Gets the log stream pointer. More...
 
void SetProfiler (ProfilerType &profiler)
 Sets the Profiler object. More...
 
virtual void SetName (const std::string &name)
 
virtual void ReName (const std::string &name)
 
virtual const std::string & Name ()
 
ProfilerTypeProfiler ()
 Gets the debug stream object. More...
 
void SetDebugLevel (unsigned char l)
 Sets the level of debugging. More...
 
unsigned char DebugLevel ()
 Returns the debugging level. More...
 
void SetVerbLevel (unsigned char l)
 
unsigned char VerbLevel ()
 Returns the verbosity level. More...
 
void SetLogLevel (unsigned char l)
 
unsigned char LogLevel ()
 Returns the verbosity level. More...
 
void DeSyncIO ()
 DeSync IO - relinquish control over IO, revert to standard. More...
 
void SyncIO ()
 Syncronize IO - assume control over IO, using established streams. More...
 
virtual int ForceOut (const std::string &outstr, unsigned char inlev=1)
 
virtual int StdOut (const std::string &outstr, unsigned char inlev=1)
 
virtual int ErrOut (const std::string &outstr)
 
virtual int DebugOut (const std::string &outstr, int inlev=1)
 
virtual int LogOut (const std::string &outstr, int inlev=0)
 
virtual ~GlobalObj ()
 Destructor. More...
 

Protected Attributes

pcpp::PlatformInfoType platformInfo
 System information. More...
 
pcpp::VirtualNodeType virtualNode
 
int isRestart
 
size_t numSteps
 
int numGrids
 
std::vector< size_t > numPointsGrid
 
- Protected Attributes inherited from application< DomainBaseT >
fixtures::ConfigurationType appConfig
 
DomainInfoType domainInfo
 
GeometryInfoType geometryInfo
 
domainvector appDomains
 
advancervector domainAdvancers
 
initializervector domainInitializers
 
int errorState
 
int iStep
 
int numStepsMax
 
int numStepsIO
 
int numStepsStatus
 
- Protected Attributes inherited from parallelprogram
std::string outFileName
 Name of file for output. More...
 
int verblevel
 Verbosity level. More...
 
std::ofstream * outFilePtr
 Output file stream object for output. More...
 
int ndiv
 Number of partitions for domain. More...
 
int numProcessors
 Number of processors. More...
 
int numThreads
 Number of threads. More...
 
- Protected Attributes inherited from mpiprogram< ComLineType >
ComLineType _command_line
 
- Protected Attributes inherited from ParallelGlobalObj< CommunicatorType, StackType, ErrorType, ProfilerType >
bool profilingBarrier
 
CommunicatorType globalCommunicator
 
- Protected Attributes inherited from GlobalObj< StackType, ErrorType, ProfilerType >
std::ostream * _DebugStream
 DebugStream is useful for parallel programs that cannot stream debugging information to the screen. More...
 
std::ostream * _OutStream
 
std::ostream * _LogStream
 
std::ostream * _ErrStream
 
ProfilerType_Profiler
 This is a placeholder for a generic profiling tool. More...
 

Additional Inherited Members

- Public Types inherited from application< DomainBaseT >
typedef DomainBaseT DomainBaseType
 
typedef DomainBaseType::GridType GridType
 
typedef DomainBaseType::StateType StateType
 
typedef std::vector< DomainBaseTypedomainvector
 
typedef advancer::base< DomainBaseTypeAdvancerType
 
typedef std::vector< AdvancerType * > advancervector
 
typedef domain::Initializer< DomainBaseTypeDomainInitializerType
 
typedef std::vector< DomainInitializerTypeinitializervector
 
typedef domain::info DomainInfoType
 
typedef geometry::info GeometryInfoType
 
Inheritance diagram for application:
Collaboration diagram for application:

Constructor & Destructor Documentation

◆ application()

application ( int  numArgs,
char **  argList,
MPI_Comm  mpiCommunicator 
)
inline

Definition at line 46 of file PlasCom2.H.

Member Function Documentation

◆ ConfigureApplication()

int ConfigureApplication ( )
virtual

Read & BC configuration, process application-wide configuration.

This function is repsonsible for populating the simulation-wide configuration object. If available, it reads the specified configuration file(s) on processor 0 and BCast it out to all the other processors. If not available, it will look for the configuration information from a restart file. Simulation-specific constructs are configured with the populated configuration object through a call from this function.

Function is native, it access the command line and any configuration information Populates the configuration object for application and all simulation constructs

Returns
0 on success, error-code otherwise
Todo:
Implement configuration from restart file

Reimplemented from application< DomainBaseT >.

Definition at line 225 of file PC2Configuration.C.

References pcpp::report::Configuration(), ConfigureBuildInformation(), plascom2::util::ConvertLegacyConfiguration(), PC2DefaultConfiguration(), ix::sys::PlatformInfo(), pcpp::util::ProcessConfigurationFile(), pcpp::util::ProcessConfigurationRestart(), ix::util::RenewStream(), and ix::sys::SystemInfo().

Here is the call graph for this function:

◆ ConfigureDomains()

int ConfigureDomains ( )
virtual

Configure simulation domains.

This function sets up the simulation application for advancing (and coupling) 1 or more domains. Each domain is configured, and split among the available processors of the simulation application.

Uses the already-populated configuration object Configures all domains and splits the communicators appropriately

Returns
0 on success, error code otherwise

Reimplemented from application< DomainBaseT >.

Definition at line 408 of file PC2Configuration.C.

References pcpp::util::ExtractConfigParams(), ix::util::RenewStream(), and plascom2::util::SplitDomains().

Here is the call graph for this function:

◆ ConfigureGeometries()

int ConfigureGeometries ( )

Configure simulation geometries.

This function sets up the grids used by the simulation application

Uses the already-populated configuration object Configures the grids and assigns them among the domains

Returns
0 on success, error code otherwise
Todo:
Consider changing grid configuration to configure from geometryinfo struct {instead of,in addition to} configuration object [mtc]

Definition at line 363 of file PC2Configuration.C.

References plascom2::util::ConfigureGridInfo().

Here is the call graph for this function:

◆ ConfigureSimulation()

int ConfigureSimulation ( )
virtual

Configure simluation-specific constructs.

This function configures the simulation specific constructs:

  • Domain(s)
  • State(s)
  • Grid(s)
  • Initializer(s)
  • Advancer(s) It does this through calls to the construct-specific configuration routines for each.

Uses the already-populated configuration object for the application After return, all simulation-specific constructs are configured (not initialized)

Todo:
Construct-specific configuration for Grid, Initializer, and Advancer
Todo:
Robustificate the setting of the required halo depths to jibe with WENO and other options which affect halo depths.
Todo:
fix domain config hard-coded to grid 0
Todo:
support legacy decomp map for grid partitioning
Todo:
numScalar hard-coded to 0 in PC2Configuration
Todo:
grid population/generation for grids other than Uniform-rectangular

Reimplemented from application< DomainBaseT >.

Definition at line 536 of file PC2Configuration.C.

References bufferSizes, paralleltopologyinfo::cartDecompDirections, pcpp::report::CartesianSetup(), pcpp::util::ConfigKey(), plascom2::util::ConfigureVirtualNode(), apptools::DumpContents(), pcpp::io::hdf5::FetchGridData(), plascom2::GenerateGrid(), simulation::report::Grid(), gridSizes, gridType, plascom2::operators::sbp::Initialize(), sizeextent::InitSimple(), paralleltopologyinfo::isPeriodic, plascom2::operators::sbp::IsValidOrder(), subregion::normalDirection, paralleltopologyinfo::numDimensions, numPointsBuffer, numScalar, pcpp::util::PartitionCartesianInterval(), simulation::grid::RECTILINEAR, subregion::regionInterval, ix::util::RenewStream(), pcpp::comm::SetupCartesianTopology(), CommunicatorObject::Size(), and plascom2::VirtualNodeReport().

Here is the call graph for this function:

◆ FinalizeApplication()

int FinalizeApplication ( )
virtual

Reimplemented from application< DomainBaseT >.

Definition at line 102 of file PC2Initialize.C.

References mpiprogram< ComLineType >::Finalize().

Here is the call graph for this function:

◆ InitializeApplication()

int InitializeApplication ( )
virtual

Reimplemented from application< DomainBaseT >.

Definition at line 37 of file PC2Initialize.C.

References parallelprogram::Initialize(), and plascom2::Splash().

Referenced by TestOverkit_Config().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadDomains()

◆ Restart()

virtual int Restart ( )
inlinevirtual

Reimplemented from application< DomainBaseT >.

Definition at line 58 of file PlasCom2.H.

Referenced by application::RunMaxwellSolver(), and application::RunPlasCom2().

Here is the caller graph for this function:

◆ RunApplication()

◆ RunEulerPBSPeriodic()

int RunEulerPBSPeriodic ( )

◆ RunMaxwellSolver()

int RunMaxwellSolver ( )
Todo:
User-space way to initialize solution
Todo:
Start from file, restart re-integration
Todo:
Change Domain/RHS/Advancer interface so that Advancer takes Domain, not RHS
Todo:
RHS configuration in PlasCom2 configuration not RunPlasCom2.
Todo:
FIXME! SKIP threaded time marching - for BC's config DEBUG ing
Todo:
domain-specific stopping mechanism
Todo:
Add status/health method for major simulation constructs

Definition at line 27 of file RunMaxwellSolver.C.

References rk4advancer< DomainType >::AdvanceDomain(), application< DomainBaseT >::appConfig, application< DomainBaseT >::appDomains, pcpp::util::ConfigKey(), application< DomainBaseT >::domainInfo, info::domainNames, apptools::DumpContents(), EPS0, application< DomainBaseT >::errorState, GlobalObj< StackType, ErrorType, ProfilerType >::ErrOut(), ParallelGlobalObj< CommunicatorType, StackType, ErrorType, ProfilerType >::FunctionEntry(), ParallelGlobalObj< CommunicatorType, StackType, ErrorType, ProfilerType >::FunctionExit(), rk4advancer< DomainType >::GetTimers(), Parameters::GetValue(), Parameters::GetValueVector(), ParallelGlobalObj< CommunicatorType, StackType, ErrorType, ProfilerType >::globalCommunicator, gridSizes, rk4advancer< DomainType >::InitializeAdvancer(), Maxwell::util::InitializeMaxwellParameters(), Maxwell::util::InitializeMaxwellStateConstFields(), InitializeSolution(), Parameters::IsSet(), application< DomainBaseT >::iStep, MU0, CommunicatorObject::NProc(), parallelprogram::numProcessors, application< DomainBaseT >::numStepsIO, application< DomainBaseT >::numStepsMax, application< DomainBaseT >::numStepsStatus, parallelprogram::numThreads, CommunicatorObject::Rank(), pcpp::comm::ReduceTimers(), ix::util::RenewStream(), ReportTimings(), application::Restart(), rk4advancer< DomainType >::SetTimers(), GlobalObj< StackType, ErrorType, ProfilerType >::StdOut(), rk4advancer< DomainType >::SyncIntervals(), rk4advancer< DomainType >::SyncStates(), timerNames, and application::WriteDomains().

Referenced by application::RunApplication().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RunPlasCom2()

int RunPlasCom2 ( )
Todo:
User-space way to initialize solution
Todo:
Change Domain/RHS/Advancer interface so that Advancer takes Domain, not RHS
Todo:
RHS configuration in PlasCom2 configuration not RunPlasCom2.
Todo:
domain-specific stopping mechanism
Todo:
Add status/health method for major simulation constructs

Definition at line 20 of file RunPlasCom2.C.

References rk4advancer< DomainType >::AdvanceDomain(), application< DomainBaseT >::appConfig, application< DomainBaseT >::appDomains, parallel_blockstructured::BufferSizes(), pcpp::util::ConfigKey(), base::CopyStateData(), application< DomainBaseT >::domainInfo, info::domainNames, apptools::DumpContents(), application< DomainBaseT >::errorState, GlobalObj< StackType, ErrorType, ProfilerType >::ErrOut(), pcpp::io::hdf5::FetchStateData(), pcpp::io::hdf5::FileInfo(), simfileinfo::formatBits, ParallelGlobalObj< CommunicatorType, StackType, ErrorType, ProfilerType >::FunctionEntry(), ParallelGlobalObj< CommunicatorType, StackType, ErrorType, ProfilerType >::FunctionExit(), rk4advancer< DomainType >::GetTimers(), Parameters::GetValue(), Parameters::GetValueVector(), ParallelGlobalObj< CommunicatorType, StackType, ErrorType, ProfilerType >::globalCommunicator, gridSizes, parallel_blockstructured::GridSizes(), parallel_blockstructured::Halo(), rk4advancer< DomainType >::InitializeAdvancer(), dataset::InitializeFieldHandles(), euler::util::InitializeQuiescentState(), InitializeSolution(), pcpp::io::ISLEGACY, Parameters::IsSet(), application< DomainBaseT >::iStep, CommunicatorObject::NProc(), application::numGrids, application::numPointsGrid, parallelprogram::numProcessors, application< DomainBaseT >::numStepsIO, application< DomainBaseT >::numStepsMax, application< DomainBaseT >::numStepsStatus, parallelprogram::numThreads, parallel_blockstructured::PartitionBufferInterval(), parallel_blockstructured::PartitionInterval(), CommunicatorObject::Rank(), pcpp::comm::ReduceTimers(), ix::util::RenewStream(), ReportTimings(), application::Restart(), rk4advancer< DomainType >::SetCommunication(), application::SetNumGrids(), application::SetNumPointsGrid(), application::SetNumSteps(), rk4advancer< DomainType >::SetTimers(), simfileinfo::simStep, simfileinfo::simTime, GlobalObj< StackType, ErrorType, ProfilerType >::StdOut(), rk4advancer< DomainType >::SyncIntervals(), rk4advancer< DomainType >::SyncStates(), timerNames, and application::WriteDomains().

Referenced by application::RunApplication().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetNumGrids()

void SetNumGrids ( int  nGrids)
inline

Definition at line 64 of file PlasCom2.H.

Referenced by application::RunPlasCom2().

Here is the caller graph for this function:

◆ SetNumPointsGrid()

int SetNumPointsGrid ( int  iGrid,
size_t  numPoints 
)
inline

Definition at line 69 of file PlasCom2.H.

References numPoints.

Referenced by application::RunPlasCom2().

Here is the caller graph for this function:

◆ SetNumSteps()

void SetNumSteps ( size_t  nSteps)
inline

Definition at line 76 of file PlasCom2.H.

Referenced by application::RunPlasCom2().

Here is the caller graph for this function:

◆ SetRestart()

void SetRestart ( int  trufals = 1)
inline

Definition at line 59 of file PlasCom2.H.

◆ WriteDomains()

int WriteDomains ( )
virtual

Member Data Documentation

◆ isRestart

int isRestart
protected

Definition at line 88 of file PlasCom2.H.

◆ numGrids

int numGrids
protected

Definition at line 93 of file PlasCom2.H.

Referenced by application::ReadDomains(), and application::RunPlasCom2().

◆ numPointsGrid

std::vector<size_t> numPointsGrid
protected

Definition at line 94 of file PlasCom2.H.

Referenced by application::RunPlasCom2().

◆ numSteps

size_t numSteps
protected

Definition at line 92 of file PlasCom2.H.

◆ platformInfo

pcpp::PlatformInfoType platformInfo
protected

System information.

Definition at line 76 of file PlasCom2.H.

◆ virtualNode

pcpp::VirtualNodeType virtualNode
protected

Definition at line 87 of file PlasCom2.H.


The documentation for this class was generated from the following files: