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:
66 ~TPacketizerUnit() override;
67
68 Int_t AssignWork(TDSet* /*dset*/, Long64_t /*first*/, Long64_t num) override;
70
72
73 Float_t GetCurrentRate(Bool_t &all) override;
74 Int_t GetActiveWorkers() override { return fWrkStats->GetSize(); }
75
76 Int_t AddWorkers(TList *workers) override;
77
78 ClassDefOverride(TPacketizerUnit,0) //Generate work packets for parallel processing
79};
80
81#endif
int Int_t
Definition RtypesCore.h:45
float Float_t
Definition RtypesCore.h:57
long long Long64_t
Definition RtypesCore.h:69
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void input
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
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...
Float_t GetCurrentRate(Bool_t &all) override
Get Estimation of the current rate; just summing the current rates of the active workers.
Double_t GetCurrentTime()
Get current time.
Int_t GetActiveWorkers() override
void operator=(const TPacketizerUnit &)
Int_t AddWorkers(TList *workers) override
Adds new workers. Returns the number of workers added, or -1 on failure.
TStopwatch * fStopwatch
~TPacketizerUnit() override
Destructor.
TPacketizerUnit(const TPacketizerUnit &)
Int_t AssignWork(TDSet *, Long64_t, Long64_t num) override
Assign work to be done to this packetizer.
TDSetElement * GetNextPacket(TSlave *sl, TMessage *r) override
Get next packet.
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.