votca 2024.2-dev
|
Worker, derived from Thread, does the work. More...
#include <csgapplication.h>
Public Member Functions | |
Worker ()=default | |
virtual void | EvalConfiguration (Topology *top, Topology *top_ref=nullptr)=0 |
overload with the actual computation | |
Index | getId () |
returns worker id | |
Public Member Functions inherited from votca::tools::Thread | |
Thread () | |
virtual | ~Thread () |
void | Start () |
Starts and runs a thread. | |
void | WaitDone () |
WaitDone() will not exit until thread ends computation. | |
bool | IsFinished () const |
Checks to see if the thread is done. | |
Protected Member Functions | |
void | Run (void) override |
Run() executes the actual code. | |
void | setApplication (CsgApplication *app) |
void | setId (Index id) |
Protected Member Functions inherited from votca::tools::Thread |
Protected Attributes | |
CsgApplication * | app_ = nullptr |
Topology | top_ |
Topology | top_cg_ |
std::unique_ptr< TopologyMap > | map_ |
Index | id_ = -1 |
Friends | |
class | CsgApplication |
Worker, derived from Thread, does the work.
Worker holds the information about the current frame, either in its own copy (e.g. Topology), or, by reference, from the parent CsgApplication. The computation is shifted from Run() into EvalConfiguration. The user is required to overload ForkWorker and Mergeworker and thereby define the initialization and merging of workers. By default, workers will be executed in correct order according to the frames. Also, output will follow the same order. Mutexes handle the locking of input/output and are also used to impose the correct order of frames for in/output.
Definition at line 105 of file csgapplication.h.
|
default |
|
pure virtual |
overload with the actual computation
Implemented in CsgREupdateWorker, MyWorker, RDFWorker, votca::csg::Imc::Worker, and votca::csg::RDFCalculator::Worker.
|
inline |
returns worker id
Definition at line 114 of file csgapplication.h.
|
overrideprotectedvirtual |
Run() executes the actual code.
It is left blank here and must be overloaded, for the thread to do any work. This method should never be called by the user, it is called internally by the Start method.
Implements votca::tools::Thread.
Definition at line 137 of file csgapplication.cc.
|
inlineprotected |
Definition at line 124 of file csgapplication.h.
|
inlineprotected |
Definition at line 126 of file csgapplication.h.
|
friend |
Definition at line 128 of file csgapplication.h.
|
protected |
Definition at line 117 of file csgapplication.h.
|
protected |
Definition at line 120 of file csgapplication.h.
|
protected |
Definition at line 119 of file csgapplication.h.
|
protected |
Definition at line 118 of file csgapplication.h.
|
protected |
Definition at line 118 of file csgapplication.h.