Logo ROOT   6.10/09
Reference Guide
TPacketizerUnit.h
Go to the documentation of this file.
1 // @(#)root/proofplayer:$Id$
2 // Author: Long Tran-Thanh 22/07/07
3 // Revised: G. Ganis, May 2011
4 
5 /*************************************************************************
6  * Copyright (C) 1995-2002, Rene Brun and Fons Rademakers. *
7  * All rights reserved. *
8  * *
9  * For the licensing terms see $ROOTSYS/LICENSE. *
10  * For the list of contributors see $ROOTSYS/README/CREDITS. *
11  *************************************************************************/
12 
13 #ifndef ROOT_TPacketizerUnit
14 #define ROOT_TPacketizerUnit
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TPacketizerUnit //
19 // //
20 // This packetizer generates packets of generic units, representing the //
21 // number of times an operation cycle has to be repeated by the worker //
22 // node, e.g. the number of Monte carlo events to be generated. //
23 // Packets sizes are generated taking into account the performance of //
24 // worker nodes, based on the time needed to process previous packets, //
25 // with the goal of having all workers ending at the same time. //
26 // //
27 //////////////////////////////////////////////////////////////////////////
28 
29 #include "TVirtualPacketizer.h"
30 #include "TMap.h"
31 
32 
33 class TMessage;
34 class TTimer;
35 class TTree;
36 class TProofStats;
37 class TStopwatch;
38 
39 
41 
42 public: // public because of Sun CC bug
43  class TSlaveStat;
44 
45 private:
46  TList *fPackets; // All processed packets
47  TMap *fWrkStats; // Worker status, keyed by correspondig TSlave
48  TList *fWrkExcluded; // List of nodes excluded from distribution
49  // (submasters with no active workers)
50  TStopwatch *fStopwatch; // For measuring the start time of each packet
51  Long64_t fProcessing; // Event being processed
52  Long64_t fAssigned; // Entries processed or being processed.
53  Double_t fCalibFrac; // Size of the calibrating packet as fraction of Ntot/Nwrk
54  Long64_t fNumPerWorker; // Number of cycles per worker, if this option
55  // is chosen
56  Bool_t fFixedNum; // Whether we must assign a fixed number of cycles per worker
57 
58  Long64_t fPacketSeq; // Sequential number of the last packet assigned
59 
61  TPacketizerUnit(const TPacketizerUnit&); // no implementation, will generate
62  void operator=(const TPacketizerUnit&); // error on accidental usage
63 
64 public:
65  TPacketizerUnit(TList *slaves, Long64_t num, TList *input, TProofProgressStatus *st = 0);
66  virtual ~TPacketizerUnit();
67 
68  Int_t AssignWork(TDSet* /*dset*/, Long64_t /*first*/, Long64_t num);
70 
72 
74  Int_t GetActiveWorkers() { return fWrkStats->GetSize(); }
75 
76  Int_t AddWorkers(TList *workers);
77 
78  ClassDef(TPacketizerUnit,0) //Generate work packets for parallel processing
79 };
80 
81 #endif
long long Long64_t
Definition: RtypesCore.h:69
float Float_t
Definition: RtypesCore.h:53
This class implements a data set to be used for PROOF processing.
Definition: TDSet.h:151
Int_t AddWorkers(TList *workers)
Adds new workers. Returns the number of workers added, or -1 on failure.
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
TDSetElement * GetNextPacket(TSlave *sl, TMessage *r)
Get next packet.
Manages an element of a TDSet.
Definition: TDSet.h:66
Float_t GetCurrentRate(Bool_t &all)
Get Estimation of the current rate; just summing the current rates of the active workers.
Int_t GetActiveWorkers()
#define ClassDef(name, id)
Definition: Rtypes.h:297
Long64_t fProcessing
Int_t AssignWork(TDSet *, Long64_t, Long64_t num)
Assign work to be done to this packetizer.
This packetizer generates packets of generic units, representing the number of times an operation cyc...
A doubly linked list.
Definition: TList.h:43
Long64_t fNumPerWorker
void operator=(const TPacketizerUnit &)
TRandom2 r(17)
virtual ~TPacketizerUnit()
Destructor.
Handles synchronous and a-synchronous timer events.
Definition: TTimer.h:51
The packetizer is a load balancing object created for each query.
TStopwatch * fStopwatch
double Double_t
Definition: RtypesCore.h:55
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
Definition: TMap.h:40
A TTree object has a header with a name and a title.
Definition: TTree.h:78
virtual Int_t GetSize() const
Definition: TCollection.h:89
Class describing a PROOF worker server.
Definition: TSlave.h:46
Container class for processing statistics.
Double_t GetCurrentTime()
Get current time.
Stopwatch class.
Definition: TStopwatch.h:28