Templated derivation of TMPWorkerTree handlign generic function tree processing.
Definition at line 79 of file TMPWorkerTree.h.
Public Member Functions | |
| TMPWorkerTreeFunc (F procFunc, const std::vector< std::string > &fileNames, TEntryList *entries, const std::string &treeName, UInt_t nWorkers, ULong64_t maxEntries, ULong64_t firstEntry) | |
| TMPWorkerTreeFunc (F procFunc, TTree *tree, TEntryList *entries, UInt_t nWorkers, ULong64_t maxEntries, ULong64_t firstEntry) | |
| ~TMPWorkerTreeFunc () override | |
| unsigned | GetNWorker () const |
| pid_t | GetPid () |
| TSocket * | GetSocket () |
| virtual void | Init (int fd, unsigned workerN) |
| This method is called by children processes right after forking. | |
| void | Run () |
Protected Member Functions | |
| void | CloseFile () |
| Handle file closing. | |
| ULong64_t | EvalMaxEntries (ULong64_t maxEntries) |
| Max entries evaluation. | |
| void | HandleInput (MPCodeBufPair &msg) override |
| Execute instructions received from a MP client. | |
| void | Init (int fd, UInt_t workerN) override |
| Init overload defining max entries. | |
| Int_t | LoadTree (UInt_t code, MPCodeBufPair &msg, Long64_t &start, Long64_t &finish, TEntryList **enl, std::string &errmsg) |
| Load the required tree and evaluate the processing range. | |
| TFile * | OpenFile (const std::string &fileName) |
| Handle file opening. | |
| TTree * | RetrieveTree (TFile *fp) |
| Retrieve a tree from an open file. | |
| void | SendError (const std::string &errmsg, unsigned int code=MPCode::kError) |
| Error sender. | |
| void | Setup () |
| Auxiliary method for common initialization. | |
| void | SetupTreeCache (TTree *tree) |
| Tree cache handling. | |
Protected Attributes | |
| TEntryList * | fEntryList |
| entrylist | |
| TFile * | fFile |
| last open file | |
| std::vector< std::string > | fFileNames |
| the files to be processed by all workers | |
| ULong64_t | fFirstEntry |
| first entry to br processed | |
| std::string | fId |
| identifier string in the form W<nwrk>|P<proc id> | |
| ULong64_t | fMaxNEntries |
| the maximum number of entries to be processed by this worker | |
| unsigned | fNWorkers |
| the number of workers spawned | |
| ULong64_t | fProcessedEntries |
| the number of entries processed by this worker so far | |
| TTree * | fTree |
| pointer to the tree to be processed. It is only used if the tree is directly passed to TProcessExecutor::Process as argument | |
| std::string | fTreeName |
| the name of the tree to be processed | |
Private Member Functions | |
| void | Process (UInt_t code, MPCodeBufPair &msg) override |
| void | SendResult () override |
| Generic function processing SendResult and Process overload. | |
Private Attributes | |
| Long64_t | fCacheSize |
| Cache size. | |
| bool | fCanReduce |
| true if fReducedResult can be reduced with a new result, false until we have produced one result | |
| unsigned | fNWorker |
| the ordinal number of this worker (0 to nWorkers-1) | |
| pid_t | fPid |
| the PID of the process in which this worker is running | |
| F | fProcFunc |
| copy the function to be executed | |
| ROOT::TypeTraits::InvokeResult_t< F, std::reference_wrapper< TTreeReader > > | fReducedResult |
| the results of the executions of fProcFunc merged together | |
| std::unique_ptr< TSocket > | fS |
| This worker's socket. The unique_ptr makes sure resources are released. | |
| TTreeCache * | fTreeCache |
| instance of the tree cache for the tree | |
| bool | fTreeCacheIsLearning |
| Whether cache is in learning phase. | |
| bool | fUseTreeCache |
| Control usage of the tree cache. | |
#include <TMPWorkerTree.h>
|
inline |
Definition at line 81 of file TMPWorkerTree.h.
|
inline |
Definition at line 87 of file TMPWorkerTree.h.
|
inlineoverride |
Definition at line 93 of file TMPWorkerTree.h.
|
protectedinherited |
Handle file closing.
Definition at line 88 of file TMPWorkerTree.cxx.
Max entries evaluation.
Definition at line 190 of file TMPWorkerTree.cxx.
|
inlineinherited |
Definition at line 41 of file TMPWorker.h.
|
inlineinherited |
Definition at line 40 of file TMPWorker.h.
|
inlineinherited |
Definition at line 39 of file TMPWorker.h.
|
overrideprotectedvirtualinherited |
Execute instructions received from a MP client.
Generic input handling.
Reimplemented from TMPWorker.
Definition at line 204 of file TMPWorkerTree.cxx.
|
virtualinherited |
This method is called by children processes right after forking.
Initialization of worker properties that must be delayed until after forking must be done here.
For example, Init saves the pid into fPid, and adds the TMPWorker to the main eventloop (as a TFileHandler).
Make sure this operations are performed also by overriding implementations, e.g. by calling TMPWorker::Init explicitly.
Definition at line 52 of file TMPWorker.cxx.
Init overload defining max entries.
Definition at line 180 of file TMPWorkerTree.cxx.
|
protectedinherited |
Load the required tree and evaluate the processing range.
Definition at line 276 of file TMPWorkerTree.cxx.
|
protectedinherited |
Handle file opening.
Definition at line 101 of file TMPWorkerTree.cxx.
|
overrideprivatevirtual |
Reimplemented from TMPWorkerTree.
Definition at line 189 of file TMPWorkerTree.h.
Retrieve a tree from an open file.
Definition at line 119 of file TMPWorkerTree.cxx.
|
inherited |
Definition at line 61 of file TMPWorker.cxx.
|
protectedinherited |
Error sender.
Definition at line 112 of file TMPWorker.cxx.
|
overrideprivatevirtual |
Generic function processing SendResult and Process overload.
Reimplemented from TMPWorkerTree.
Definition at line 182 of file TMPWorkerTree.h.
|
protectedinherited |
Auxiliary method for common initialization.
Definition at line 78 of file TMPWorkerTree.cxx.
|
protectedinherited |
Tree cache handling.
Definition at line 151 of file TMPWorkerTree.cxx.
|
privateinherited |
Cache size.
Definition at line 75 of file TMPWorkerTree.h.
|
private |
true if fReducedResult can be reduced with a new result, false until we have produced one result
Definition at line 103 of file TMPWorkerTree.h.
|
protectedinherited |
entrylist
Definition at line 66 of file TMPWorkerTree.h.
|
protectedinherited |
last open file
Definition at line 65 of file TMPWorkerTree.h.
|
protectedinherited |
the files to be processed by all workers
Definition at line 62 of file TMPWorkerTree.h.
|
protectedinherited |
first entry to br processed
Definition at line 67 of file TMPWorkerTree.h.
|
protectedinherited |
identifier string in the form W<nwrk>|P<proc id>
Definition at line 44 of file TMPWorker.h.
|
protectedinherited |
the maximum number of entries to be processed by this worker
Definition at line 46 of file TMPWorker.h.
|
privateinherited |
the ordinal number of this worker (0 to nWorkers-1)
Definition at line 56 of file TMPWorker.h.
|
protectedinherited |
the number of workers spawned
Definition at line 45 of file TMPWorker.h.
|
privateinherited |
the PID of the process in which this worker is running
Definition at line 55 of file TMPWorker.h.
|
protectedinherited |
the number of entries processed by this worker so far
Definition at line 47 of file TMPWorker.h.
|
private |
copy the function to be executed
Definition at line 99 of file TMPWorkerTree.h.
|
private |
the results of the executions of fProcFunc merged together
Definition at line 101 of file TMPWorkerTree.h.
|
privateinherited |
This worker's socket. The unique_ptr makes sure resources are released.
Definition at line 54 of file TMPWorker.h.
|
protectedinherited |
pointer to the tree to be processed. It is only used if the tree is directly passed to TProcessExecutor::Process as argument
Definition at line 64 of file TMPWorkerTree.h.
|
privateinherited |
instance of the tree cache for the tree
Definition at line 72 of file TMPWorkerTree.h.
|
privateinherited |
Whether cache is in learning phase.
Definition at line 73 of file TMPWorkerTree.h.
|
protectedinherited |
the name of the tree to be processed
Definition at line 63 of file TMPWorkerTree.h.
|
privateinherited |
Control usage of the tree cache.
Definition at line 74 of file TMPWorkerTree.h.