#ifndef ROOT_TPacketGenerator #define ROOT_TPacketGenerator //+SEQ,CopyRight,T=NOINCLUDE. ////////////////////////////////////////////////////////////////////////// // // // TPacketGenerator // // // // This class generates packets to be processed on PROOF slave servers. // // A packet is an event range (begin event and number of events). // // Packets are generated taking into account the performance of the // // remote machine, the time it took to process a previous packet on // // the remote machine, the locality of the database files, etc. // // // ////////////////////////////////////////////////////////////////////////// #ifndef ROOT_TObject //*KEEP,TObject. #include "TObject.h" //*KEND. #endif #ifndef ROOT_TTime //*KEEP,TTime,T=C++. #include "TTime.h" //*KEND. #endif #ifndef ROOT_Htypes //*KEEP,Htypes. #include "Htypes.h" //*KEND. #endif class TObjArray; class TList; class TSlave; class TTree; class TPacketGenerator : public TObject { private: Stat_t fNextEvent; //next event to be processed Stat_t fLastEvent; //last event to be processed Stat_t fEventsProcessed; //number of events processed Int_t fInitialPacketSize; //initial packet size Int_t fMinPacketSize; //minimum packet size Int_t fSmallestPacket; //smallest packet generated TTime fMinTimeDiff; //time difference between last two packets for fastest slave Int_t fMaxOrd; //highest ordinal slave number TTree *fTree; //tree or chain being processed TList *fSlaves; //list of slaves Stat_t *fEventsPerSlave; //array containing number of events processed per slave TObjArray *fLastPackets; //pointer to the last packet for each slave TList *fPackets; //list of packets that have been processed TPacketGenerator(); TPacketGenerator(const TPacketGenerator &) { } void operator=(const TPacketGenerator &) { } void Init(); public: TPacketGenerator(Stat_t firstEvent, Stat_t lastEvent, TTree *tree, TList *slaves); TPacketGenerator(Stat_t firstEvent, Stat_t lastEvent, Int_t packetSize, TList *slaves); virtual ~TPacketGenerator(); Stat_t GetEventsProcessed() const { return fEventsProcessed; } Stat_t GetEventsProcessed(TSlave *sl) const; Int_t GetInitialPacketSize() const { return fInitialPacketSize; } Stat_t GetNextEvent() const { return fNextEvent; } Bool_t GetNextPacket(TSlave *sl, Int_t &nevent, Stat_t &first); Int_t GetNoPackets() const; TList *GetPackets() const { return fPackets; } Stat_t GetLastEvent() const { return fLastEvent; } void SetMinPacketSize(Int_t minps); void Print(Option_t *option=""); void Reset(Stat_t firstEvent, Stat_t lastEvent, TList *slaves); ClassDef(TPacketGenerator,0) //Generate packets of events for parallel processing }; #endif