49 PDB(kPacketizer,1)
Info(
"TPacketizerMulti",
50 "enter (first %lld, num %lld)", first, num);
57 if (!dset || !wrks || !input || !st) {
58 Error(
"TPacketizerMulti",
"invalid inputs: dset:%p wrks:%p input:%p st:%p",
59 dset, wrks, input, st);
63 fPacketizers =
new TList;
66 TNamed *progTimerFlag =
new TNamed(
"PROOF_StartProgressTimer",
"no");
67 input->Add(progTimerFlag);
73 if ((packetizer = CreatePacketizer(dset, wrks, first, num, input, st))) {
74 fPacketizers->Add(packetizer);
77 Error(
"TPacketizerMulti",
"problems initializing packetizer for single dataset");
78 input->Remove(progTimerFlag);
84 TIter nxds(dset->GetListOfElements());
86 while ((ds = (
TDSet *)nxds())) {
87 if ((packetizer = CreatePacketizer(ds, wrks, first, num, input, st))) {
88 fPacketizers->
Add(packetizer);
91 Error(
"TPacketizerMulti",
"problems initializing packetizer for dataset '%s'", ds->GetName());
96 input->Remove(progTimerFlag);
100 if (fPacketizers->GetSize() <= 0) {
101 Error(
"TPacketizerMulti",
"no valid packetizer could be initialized - aborting");
105 Info(
"TPacketizerMulti",
"%d packetizer(s) have been successfully initialized (%lld events in total)",
106 fPacketizers->GetSize(), fTotalEntries);
108 TIter nxp(fPacketizers);
114 fPacketizersIter =
new TIter(fPacketizers);
119 Error(
"TPacketizerMulti",
"could not point to the first valid packetizer");
120 fPacketizers->SetOwner(
kTRUE);
127 fAssignedPack =
new TMap;
132 PDB(kPacketizer,1)
Info(
"TPacketizerMulti",
"done");
167 if (lastPacketizer && lastPacketizer !=
fCurrent) {
169 Info(
"GetNextPacket",
"%s: asking old packetizer %p ... ", wrk->
GetOrdinal(), lastPacketizer);
170 if ((elem = lastPacketizer->
GetNextPacket(wrk, r)))
return elem;
175 if (oldstat && curstat)
191 TMap *oldStats = (lastPacketizer && lastPacketizer ==
fCurrent) ? lastPacketizer->GetSlaveStats() : 0;
199 if (oldstat && curstat)
216 Info(
"GetNextPacket",
"assigned packetizer %p to %s (check: %p)",
223 Error(
"GetNextPacket",
"Processed too many entries!");
243 if (!dset || !wrks || !input || !st) {
244 Error(
"CreatePacketizer",
"invalid inputs: dset:%p wrks:%p input:%p st:%p",
245 dset, wrks, input, st);
251 Error(
"CreatePacketizer",
"dataset is empty: protocol error?");
256 TList *listOfMissingFiles = 0;
265 if (!(listOfMissingFiles = (
TList *) input->
FindObject(
"MissingFiles"))) {
267 listOfMissingFiles =
new TList;
269 input->
Add(listOfMissingFiles);
275 Error(
"CreatePacketizer",
"no files from the data set were found - skipping");
281 packetizername =
"TPacketizer";
283 Info(
"CreatePacketizer",
"using alternate packetizer: %s", packetizername.
Data());
289 Error(
"CreatePacketizer",
"class '%s' not found", packetizername.
Data());
294 callEnv.
InitWithPrototype(cl, cl->GetName(),
"TDSet*,TList*,Long64_t,Long64_t,TList*,TProofProgressStatus*");
296 Error(
"CreatePacketizer",
"cannot find correct constructor for '%s'", cl->GetName());
315 Error(
"CreatePacketizer",
"cannot construct '%s'", cl->GetName());
320 Error(
"CreatePacketizer",
321 "instantiated packetizer object '%s' is invalid", cl->GetName());
328 TIter nxe(dset->GetListOfElements());
332 dset->Remove(elem,
kFALSE);
TFileInfo * GetFileInfo(const char *type="TTree")
Return the content of this element in the form of a TFileInfo.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
void SetValue(TObject *val)
TObject * GetParameter(const char *par) const
Get specified parameter.
Bool_t TestBit(UInt_t f) const
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
void Add(TObject *obj)
This function may not be used (but we need to provide it since it is a pure virtual in TCollection)...
const char * GetOrdinal() const
Long64_t GetEntries() const
TList * GetListOfElements() const
virtual Bool_t HandleTimer(TTimer *timer)
Send progress message to client.
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
TVirtualPacketizer * CreatePacketizer(TDSet *dset, TList *wrks, Long64_t first, Long64_t num, TList *input, TProofProgressStatus *st)
Create a packetizer for dataset 'dset' Return null on failure.
The TNamed class is the base class for all named ROOT classes.
TMap * GetSlaveStats() const
TDSetElement * GetNextPacket(TSlave *wrk, TMessage *r)
Get next packet from the current packetizer.
void Info(const char *location, const char *msgfmt,...)
Method or function calling interface.
void Error(const char *location, const char *msgfmt,...)
TProofProgressStatus * fProgressStatus
Long64_t GetTotalEntries() const
void SetTotalEntries(Long64_t ent)
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
The ROOT global object gROOT contains a list of all defined classes.
Bool_t IsValid() const
Return true if the method call has been properly initialized and is usable.
void InitWithPrototype(TClass *cl, const char *method, const char *proto, Bool_t objectIsConst=kFALSE, ROOT::EFunctionMatchMode mode=ROOT::kConversionMatch)
Initialize the method invocation environment.
Class used by TMap to store (key,value) pairs.
void ResetParam()
Reset parameter list. To be used before the first call the SetParam().
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
virtual TDSetElement * GetNextPacket(TSlave *sl, TMessage *r)
Get next packet.
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
TVirtualPacketizer * fCurrent
void Lookup(Bool_t removeMissing=kFALSE, TList **missingFiles=0)
Resolve the end-point URL for the current elements of this data set If the removeMissing option is se...
virtual Bool_t Add(const char *file, const char *objname=0, const char *dir=0, Long64_t first=0, Long64_t num=-1, const char *msd=0)
Add file to list of files to be analyzed.
TObject * FindObject(const char *keyname) const
Check if a (key,value) pair exists with keyname as name of the key.
virtual ~TPacketizerMulti()
Destructor.
virtual void Add(TObject *obj)
void Execute(const char *, const char *, int *=0)
Execute method on this object with the given parameter string, e.g.
void SetParam(Long_t l)
Add a long method parameter.
TObject * GetValue(const char *keyname) const
Returns a pointer to the value associated with keyname as name of the key.
TProofProgressStatus * GetProgressStatus()
virtual Int_t GetSize() const
const char * Data() const