This class works in conjuction with TTreeProcessorMP, reacting to messages received from it as specified by the Notify and HandleInput methods.
Definition at line 32 of file TMPWorkerTree.h.
Public Member Functions | |
TMPWorkerTree () | |
Class constructors. More... | |
TMPWorkerTree (const std::vector< std::string > &fileNames, TEntryList *entries, const std::string &treeName, UInt_t nWorkers, ULong64_t maxEntries, ULong64_t firstEntry) | |
TMPWorkerTree (const TMPWorkerTree &)=delete | |
TMPWorkerTree (TTree *tree, TEntryList *entries, UInt_t nWorkers, ULong64_t maxEntries, ULong64_t firstEntry) | |
virtual | ~TMPWorkerTree () |
TMPWorkerTree & | operator= (const TMPWorkerTree &)=delete |
Public Member Functions inherited from TMPWorker | |
TMPWorker () | |
TMPWorker (const TMPWorker &)=delete | |
TMPWorker (unsigned nWorkers, ULong64_t maxEntries) | |
virtual | ~TMPWorker () |
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. More... | |
TMPWorker & | operator= (const TMPWorker &)=delete |
void | Run () |
Protected Member Functions | |
void | CloseFile () |
Handle file closing. More... | |
ULong64_t | EvalMaxEntries (ULong64_t maxEntries) |
Max entries evaluation. More... | |
void | HandleInput (MPCodeBufPair &msg) |
Execute instructions received from a MP client. More... | |
void | Init (int fd, UInt_t workerN) |
Init overload definign max entries. More... | |
Int_t | LoadTree (UInt_t code, MPCodeBufPair &msg, Long64_t &start, Long64_t &finish, TEntryList **enl, std::string &errmsg) |
Load the requierd tree and evaluate the processing range. More... | |
TFile * | OpenFile (const std::string &fileName) |
Handle file opening. More... | |
virtual void | Process (UInt_t, MPCodeBufPair &) |
TTree * | RetrieveTree (TFile *fp) |
Retrieve a tree from an open file. More... | |
virtual void | SendResult () |
void | Setup () |
Auxilliary method for common initializations. More... | |
void | SetupTreeCache (TTree *tree) |
Tree cache handling. More... | |
Protected Member Functions inherited from TMPWorker | |
void | SendError (const std::string &errmsg, unsigned int code=MPCode::kError) |
Error sender. More... | |
Protected Attributes | |
TEntryList * | fEntryList |
entrylist More... | |
TFile * | fFile |
last open file More... | |
std::vector< std::string > | fFileNames |
the files to be processed by all workers More... | |
ULong64_t | fFirstEntry |
first entry to br processed More... | |
TTree * | fTree |
pointer to the tree to be processed. It is only used if the tree is directly passed to TProcessExecutor::Process as argument More... | |
std::string | fTreeName |
the name of the tree to be processed More... | |
Protected Attributes inherited from TMPWorker | |
std::string | fId |
identifier string in the form W<nwrk>|P<proc id> More... | |
ULong64_t | fMaxNEntries |
the maximum number of entries to be processed by this worker More... | |
unsigned | fNWorkers |
the number of workers spawned More... | |
ULong64_t | fProcessedEntries |
the number of entries processed by this worker so far More... | |
Private Attributes | |
Long64_t | fCacheSize |
Cache size. More... | |
TTreeCache * | fTreeCache |
instance of the tree cache for the tree More... | |
Bool_t | fTreeCacheIsLearning |
Whether cache is in learning phase. More... | |
Bool_t | fUseTreeCache |
Control usage of the tree cache. More... | |
#include <TMPWorkerTree.h>
TMPWorkerTree::TMPWorkerTree | ( | ) |
Class constructors.
Note that this does not set variables like fPid or fS (worker's socket).
These operations are handled by the Init method, which is called after forking.
This separation is in place because the instantiation of a worker must be done once before forking, while the initialization of the members must be done after forking by each of the children processes.
Definition at line 46 of file TMPWorkerTree.cxx.
TMPWorkerTree::TMPWorkerTree | ( | const std::vector< std::string > & | fileNames, |
TEntryList * | entries, | ||
const std::string & | treeName, | ||
UInt_t | nWorkers, | ||
ULong64_t | maxEntries, | ||
ULong64_t | firstEntry | ||
) |
Definition at line 53 of file TMPWorkerTree.cxx.
TMPWorkerTree::TMPWorkerTree | ( | TTree * | tree, |
TEntryList * | entries, | ||
UInt_t | nWorkers, | ||
ULong64_t | maxEntries, | ||
ULong64_t | firstEntry | ||
) |
Definition at line 62 of file TMPWorkerTree.cxx.
|
virtual |
Definition at line 70 of file TMPWorkerTree.cxx.
|
delete |
|
protected |
Handle file closing.
Definition at line 88 of file TMPWorkerTree.cxx.
Max entries evaluation.
Definition at line 190 of file TMPWorkerTree.cxx.
|
protectedvirtual |
Execute instructions received from a MP client.
Generic input handling.
Reimplemented from TMPWorker.
Definition at line 204 of file TMPWorkerTree.cxx.
Init overload definign max entries.
Definition at line 180 of file TMPWorkerTree.cxx.
|
protected |
Load the requierd tree and evaluate the processing range.
Definition at line 273 of file TMPWorkerTree.cxx.
|
protected |
Handle file opening.
Definition at line 101 of file TMPWorkerTree.cxx.
|
delete |
|
inlineprotectedvirtual |
Reimplemented in TMPWorkerTreeFunc< F >, and TMPWorkerTreeSel.
Definition at line 56 of file TMPWorkerTree.h.
Retrieve a tree from an open file.
Definition at line 119 of file TMPWorkerTree.cxx.
|
inlineprotectedvirtual |
Reimplemented in TMPWorkerTreeFunc< F >, and TMPWorkerTreeSel.
Definition at line 58 of file TMPWorkerTree.h.
|
protected |
Auxilliary method for common initializations.
Definition at line 78 of file TMPWorkerTree.cxx.
Tree cache handling.
Definition at line 151 of file TMPWorkerTree.cxx.
|
private |
Cache size.
Definition at line 75 of file TMPWorkerTree.h.
|
protected |
entrylist
Definition at line 66 of file TMPWorkerTree.h.
|
protected |
last open file
Definition at line 65 of file TMPWorkerTree.h.
|
protected |
the files to be processed by all workers
Definition at line 62 of file TMPWorkerTree.h.
|
protected |
first entry to br processed
Definition at line 67 of file TMPWorkerTree.h.
|
protected |
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.
|
private |
instance of the tree cache for the tree
Definition at line 72 of file TMPWorkerTree.h.
|
private |
Whether cache is in learning phase.
Definition at line 73 of file TMPWorkerTree.h.
|
protected |
the name of the tree to be processed
Definition at line 63 of file TMPWorkerTree.h.
|
private |
Control usage of the tree cache.
Definition at line 74 of file TMPWorkerTree.h.