Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
33class TMessage;
34class TTimer;
35class TTree;
36class TProofStats;
37class TStopwatch;
38
39
41
42public: // public because of Sun CC bug
43 class TSlaveStat;
44
45private:
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
64public:
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
75
76 Int_t AddWorkers(TList *workers);
77
78 ClassDef(TPacketizerUnit,0) //Generate work packets for parallel processing
79};
80
81#endif
ROOT::R::TRInterface & r
Definition Object.C:4
int Int_t
Definition RtypesCore.h:45
double Double_t
Definition RtypesCore.h:59
long long Long64_t
Definition RtypesCore.h:80
float Float_t
Definition RtypesCore.h:57
#define ClassDef(name, id)
Definition Rtypes.h:325
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Manages an element of a TDSet.
Definition TDSet.h:66
This class implements a data set to be used for PROOF processing.
Definition TDSet.h:153
A doubly linked list.
Definition TList.h:38
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
Definition TMap.h:40
This packetizer generates packets of generic units, representing the number of times an operation cyc...
Int_t AddWorkers(TList *workers)
Adds new workers. Returns the number of workers added, or -1 on failure.
virtual ~TPacketizerUnit()
Destructor.
Double_t GetCurrentTime()
Get current time.
void operator=(const TPacketizerUnit &)
Float_t GetCurrentRate(Bool_t &all)
Get Estimation of the current rate; just summing the current rates of the active workers.
TStopwatch * fStopwatch
TDSetElement * GetNextPacket(TSlave *sl, TMessage *r)
Get next packet.
TPacketizerUnit(const TPacketizerUnit &)
Int_t AssignWork(TDSet *, Long64_t, Long64_t num)
Assign work to be done to this packetizer.
Container class for processing statistics.
Class describing a PROOF worker server.
Definition TSlave.h:46
Stopwatch class.
Definition TStopwatch.h:28
Handles synchronous and a-synchronous timer events.
Definition TTimer.h:51
A TTree represents a columnar dataset.
Definition TTree.h:79
The packetizer is a load balancing object created for each query.