votca 2024.2-dev
|
#include <csgapplication.h>
Classes | |
class | Worker |
Worker, derived from Thread, does the work. More... | |
Public Member Functions | |
CsgApplication ()=default | |
~CsgApplication () override=default | |
void | Initialize () override |
Initialize application data. | |
bool | EvaluateOptions () override |
Process command line options. | |
void | Run (void) override |
Main body of application. | |
void | ShowHelpText (std::ostream &out) override |
virtual bool | DoMapping (void) |
overload and return true to enable mapping command line options | |
virtual bool | DoMappingDefault (void) |
if DoMapping is true, will by default require mapping or not | |
virtual bool | DoTrajectory (void) |
overload and return true to enable trajectory command line options | |
virtual bool | DoThreaded (void) |
virtual bool | SynchronizeThreads (void) |
virtual bool | NeedsTopology (void) |
if topology is always needed | |
virtual bool | EvaluateTopology (Topology *, Topology *=nullptr) |
called after topology was loaded | |
void | AddObserver (CGObserver *observer) |
virtual void | BeginEvaluate (Topology *top, Topology *top_ref=nullptr) |
called before the first frame | |
virtual void | EndEvaluate () |
called after the last frame | |
virtual void | EvalConfiguration (Topology *top, Topology *top_ref=nullptr) |
bool | ProcessData (Worker *worker) |
Gets frames from TrajectoryReader in an ordered way and, if successful, calls Worker::EvalConfiguration for that frame. | |
virtual std::unique_ptr< Worker > | ForkWorker (void) |
virtual void | MergeWorker (Worker *worker) |
Public Member Functions inherited from votca::tools::Application | |
Application () | |
virtual | ~Application () |
int | Exec (int argc, char **argv) |
executes the program | |
virtual std::string | ProgramName ()=0 |
program name | |
virtual std::string | VersionString () |
version string of application | |
virtual void | HelpText (std::ostream &out)=0 |
help text of application without version information | |
void | CheckRequired (const std::string &option_name, const std::string &error_msg="") |
Check weather required option is set. | |
boost::program_options::options_description_easy_init | AddProgramOptions (const std::string &group="") |
add option for command line | |
boost::program_options::variables_map & | OptionsMap () |
get available program options & descriptions | |
boost::program_options::options_description & | OptionsDesc () |
boost::program_options::options_description & | VisibleOptions () |
filters out the Hidden group from the options descriptions | |
void | StopExecution () |
call StopExecution after EvaluateOptions | |
Protected Attributes | |
std::list< CGObserver * > | observers_ |
bool | do_mapping_ |
std::vector< std::unique_ptr< Worker > > | myWorkers_ |
Index | nframes_ |
bool | is_first_frame_ |
Index | nthreads_ |
tools::Mutex | nframesMutex_ |
tools::Mutex | traj_readerMutex_ |
std::vector< std::unique_ptr< tools::Mutex > > | threadsMutexesIn_ |
stores Mutexes used to impose order for input | |
std::vector< std::unique_ptr< tools::Mutex > > | threadsMutexesOut_ |
stores Mutexes used to impose order for output | |
std::unique_ptr< TrajectoryReader > | traj_reader_ |
Protected Attributes inherited from votca::tools::Application | |
std::map< std::string, boost::program_options::options_description > | op_groups_ |
bool | continue_execution_ = true |
Additional Inherited Members | |
Protected Member Functions inherited from votca::tools::Application |
Definition at line 36 of file csgapplication.h.
|
default |
|
overridedefault |
|
inline |
Definition at line 170 of file csgapplication.h.
|
virtual |
called before the first frame
Reimplemented in CGForceMatching, CGOrderParam, CsgDensityApp, CsgFluctuations, CsgMapApp, CsgParallelTestApp, CsgPartialRdfApp, CsgREupdate, CsgStatApp, CsgTestApp, OrientCorrApp, and TrajForce.
Definition at line 413 of file csgapplication.cc.
|
inlinevirtual |
overload and return true to enable mapping command line options
Reimplemented in CGForceMatching, CGOrderParam, CsgBoltzmann, CsgDensityApp, CsgDumpApp, CsgFluctuations, CsgMapApp, CsgPartialRdfApp, CsgREupdate, CsgStatApp, DLPTopolApp, GmxTopolApp, and TrajForce.
Definition at line 50 of file csgapplication.h.
|
inlinevirtual |
if DoMapping is true, will by default require mapping or not
Reimplemented in CsgDensityApp, CsgDumpApp, CsgPartialRdfApp, and CsgStatApp.
Definition at line 53 of file csgapplication.h.
|
inlinevirtual |
Reimplemented in CsgParallelTestApp, CsgPartialRdfApp, CsgREupdate, CsgStatApp, and OrientCorrApp.
Definition at line 59 of file csgapplication.h.
|
inlinevirtual |
overload and return true to enable trajectory command line options
Reimplemented in CGForceMatching, CGOrderParam, CsgBoltzmann, CsgDensityApp, CsgFluctuations, CsgMapApp, CsgParallelTestApp, CsgPartialRdfApp, CsgRadiiApp, CsgREupdate, CsgStatApp, CsgTestApp, OrientCorrApp, and TrajForce.
Definition at line 56 of file csgapplication.h.
|
virtual |
called after the last frame
Reimplemented in CGForceMatching, CGOrderParam, CsgDensityApp, CsgFluctuations, CsgMapApp, CsgParallelTestApp, CsgPartialRdfApp, CsgRadiiApp, CsgREupdate, CsgStatApp, CsgTestApp, OrientCorrApp, and TrajForce.
Definition at line 419 of file csgapplication.cc.
|
virtual |
Reimplemented in CGForceMatching, CGOrderParam, CsgDensityApp, CsgFluctuations, CsgMapApp, CsgRadiiApp, CsgTestApp, and TrajForce.
Definition at line 425 of file csgapplication.cc.
|
overridevirtual |
Process command line options.
EvaluateOptions is called by Run after parsing the command line. return true if everything is ok, false to stop and show help text.
Implements votca::tools::Application.
Reimplemented in CsgBoltzmann, CsgDensityApp, CsgFluctuations, CsgMapApp, CsgPartialRdfApp, CsgREupdate, CsgStatApp, DLPTopolApp, GmxTopolApp, and TrajForce.
Definition at line 87 of file csgapplication.cc.
|
inlinevirtual |
called after topology was loaded
Reimplemented in CsgBoltzmann, CsgDumpApp, DLPTopolApp, and GmxTopolApp.
Definition at line 76 of file csgapplication.h.
|
virtual |
User is required to overload ForkWorker and initialize workers.
Reimplemented in CsgParallelTestApp, CsgPartialRdfApp, CsgREupdate, CsgStatApp, and OrientCorrApp.
Definition at line 431 of file csgapplication.cc.
|
overridevirtual |
Initialize application data.
Initialize is called by run before parsing the command line. All necessary command line arguments can be added here
Implements votca::tools::Application.
Reimplemented in CsgBoltzmann, CsgDensityApp, CsgDumpApp, CsgFluctuations, CsgMapApp, CsgParallelTestApp, CsgPartialRdfApp, CsgRadiiApp, CsgREupdate, CsgStatApp, CsgTestApp, DLPTopolApp, GmxTopolApp, OrientCorrApp, and TrajForce.
Definition at line 34 of file csgapplication.cc.
|
virtual |
User is required to overload MergeWorker and merge data from each worker.
worker |
Reimplemented in CsgParallelTestApp, CsgPartialRdfApp, CsgREupdate, CsgStatApp, and OrientCorrApp.
Definition at line 436 of file csgapplication.cc.
|
inlinevirtual |
if topology is always needed
Reimplemented in CsgREupdate.
Definition at line 72 of file csgapplication.h.
bool votca::csg::CsgApplication::ProcessData | ( | Worker * | worker | ) |
Gets frames from TrajectoryReader in an ordered way and, if successful, calls Worker::EvalConfiguration for that frame.
worker |
Definition at line 148 of file csgapplication.cc.
|
overridevirtual |
Main body of application.
Run is called after command line was parsed + evaluated. All the work should be done in here.
Implements votca::tools::Application.
Reimplemented in CsgBoltzmann, and CsgREupdate.
Definition at line 200 of file csgapplication.cc.
|
overridevirtual |
Reimplemented from votca::tools::Application.
Definition at line 125 of file csgapplication.cc.
|
inlinevirtual |
Reimplemented in CsgPartialRdfApp, CsgREupdate, CsgStatApp, and OrientCorrApp.
Definition at line 63 of file csgapplication.h.
|
protected |
Definition at line 155 of file csgapplication.h.
|
protected |
Definition at line 158 of file csgapplication.h.
|
protected |
Definition at line 156 of file csgapplication.h.
|
protected |
Definition at line 157 of file csgapplication.h.
|
protected |
Definition at line 160 of file csgapplication.h.
|
protected |
Definition at line 159 of file csgapplication.h.
|
protected |
Definition at line 154 of file csgapplication.h.
|
protected |
stores Mutexes used to impose order for input
Definition at line 164 of file csgapplication.h.
|
protected |
stores Mutexes used to impose order for output
Definition at line 166 of file csgapplication.h.
|
protected |
Definition at line 167 of file csgapplication.h.
|
protected |
Definition at line 161 of file csgapplication.h.