#ifndef ROOT_TVirtualPacketizer
#define ROOT_TVirtualPacketizer
#ifndef ROOT_TObject
#include "TObject.h"
#endif
#ifndef ROOT_TSlave
#include "TSlave.h"
#endif
#ifndef ROOT_TProofProgressStatus
#include "TProofProgressStatus.h"
#endif
class TDSet;
class TDSetElement;
class TSlave;
class TMessage;
class TNtupleD;
class TVirtualPacketizer : public TObject {
friend class TPacketizer;
friend class TPacketizerAdaptive;
friend class TPacketizerProgressive;
friend class TPacketizerUnit;
public:
class TVirtualSlaveStat;
private:
enum EUseEstOpt {
kEstOff = 0,
kEstCurrent = 1,
kEstAverage = 2
};
TProofProgressStatus *fProgressStatus;
TTimer *fProgress;
Long64_t fTotalEntries;
TList *fFailedPackets;
Long_t fStartTime;
Float_t fInitTime;
Float_t fProcTime;
Float_t fTimeUpdt;
TNtupleD *fCircProg;
Long_t fCircN;
EUseEstOpt fUseEstOpt;
TVirtualPacketizer(const TVirtualPacketizer &);
void operator=(const TVirtualPacketizer &);
virtual Bool_t HandleTimer(TTimer *timer);
TDSetElement *CreateNewPacket(TDSetElement* base, Long64_t first, Long64_t num);
protected:
Bool_t fValid;
Bool_t fStop;
TVirtualPacketizer(TList *input, TProofProgressStatus *st = 0);
Long64_t GetEntries(Bool_t tree, TDSetElement *e);
public:
enum EStatusBits { kIsInitializing = BIT(16), kIsDone = BIT(17) };
virtual ~TVirtualPacketizer();
Bool_t IsValid() const { return fValid; }
Long64_t GetEntriesProcessed() const { return (fProgressStatus? fProgressStatus->GetEntries():0); }
virtual Int_t GetEstEntriesProcessed(Float_t, Long64_t &ent, Long64_t &bytes)
{ ent = GetEntriesProcessed(); bytes = GetBytesRead(); return 0; }
Long64_t GetTotalEntries() const { return fTotalEntries; }
virtual TDSetElement *GetNextPacket(TSlave *sl, TMessage *r);
virtual void SetInitTime();
virtual void StopProcess(Bool_t abort);
TList *GetFailedPackets() { return fFailedPackets; }
void SetFailedPackets(TList *list) { fFailedPackets = list; }
Long64_t GetBytesRead() const { return (fProgressStatus? fProgressStatus->GetBytesRead() : 0); }
Double_t GetCumProcTime() const { return fProgressStatus->GetProcTime(); }
Float_t GetInitTime() const { return fInitTime; }
Float_t GetProcTime() const { return fProcTime; }
virtual void MarkBad(TSlave * , TProofProgressStatus * , TList ** ) { return; }
virtual Int_t AddProcessed(TSlave * , TProofProgressStatus * ,
Double_t , TList ** ) { return 0; }
TProofProgressStatus *GetStatus() { return fProgressStatus; }
void SetProgressStatus(TProofProgressStatus *st) { fProgressStatus = st; }
ClassDef(TVirtualPacketizer,0)
};
class TVirtualPacketizer::TVirtualSlaveStat : public TObject {
friend class TPacketizerAdaptive;
friend class TPacketizer;
protected:
TSlave *fSlave;
TProofProgressStatus *fStatus;
public:
const char *GetName() const { return fSlave->GetName(); }
Long64_t GetEntriesProcessed() const { return fStatus?fStatus->GetEntries():-1; }
Double_t GetProcTime() const { return fStatus?fStatus->GetProcTime():-1; }
Float_t GetAvgRate() { return fStatus->GetRate(); }
TProofProgressStatus *GetProgressStatus() { return fStatus; }
virtual TProofProgressStatus *AddProcessed(TProofProgressStatus *st) = 0;
};
#endif
Last change: Thu Oct 23 08:20:33 2008
Last generated: 2008-10-23 08:20
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.