Logo ROOT   6.18/05
Reference Guide
TPacketizer.h
Go to the documentation of this file.
1// @(#)root/proofplayer:$Id$
2// Author: Maarten Ballintijn 18/03/02
3
4/*************************************************************************
5 * Copyright (C) 1995-2002, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TPacketizer
13#define ROOT_TPacketizer
14
15//////////////////////////////////////////////////////////////////////////
16// //
17// TPacketizer //
18// //
19// This class generates packets to be processed on PROOF slave servers. //
20// A packet is an event range (begin entry and number of entries) or //
21// object range (first object and number of objects) in a TTree //
22// (entries) or a directory (objects) in a file. //
23// Packets are generated taking into account the performance of the //
24// remote machine, the time it took to process a previous packet on //
25// the remote machine, the locality of the database files, etc. //
26// //
27//////////////////////////////////////////////////////////////////////////
28
29#include "TVirtualPacketizer.h"
30
31
32class TMessage;
33class TTimer;
34class TTree;
35class TMap;
37class TProofStats;
38
40
41public: // public because of Sun CC bug
42 class TFileNode;
43 class TFileStat;
44 class TSlaveStat;
45
46private:
47 TList *fPackets; // all processed packets
48
49 TList *fFileNodes; // nodes with files
50 TList *fUnAllocated; // nodes with unallocated files
51 TList *fActive; // nodes with unfinished files
52
53 Long64_t fPacketSize; // global base packet size
54 // It can be set with PROOF_PacketSize
55 // parameter, in the input list.
56 Int_t fMaxPerfIdx; // maximum of our slaves' performance index
57
58 Long_t fMaxSlaveCnt; // maximum number of workers per filenode (Long_t to avoid
59 // warnings from backward compatibility support)
60 Int_t fPacketAsAFraction; // used to calculate the packet size
61 // fPacketSize = fTotalEntries / (fPacketAsAFraction * nslaves)
62 // fPacketAsAFraction can be interpreted as follows:
63 // assuming all slaves have equal processing rate, packet size
64 // is (#events processed by 1 slave) / fPacketSizeAsAFraction.
65 // It can be set with PROOF_PacketAsAFraction in input list.
66
67 // Add workers controls
68 Bool_t fHeuristicPSiz; // Whether the packet size is calculated heuristically
69 Bool_t fDefMaxWrkNode; // Whether the default is used for the max workers per node
70
72 TPacketizer(const TPacketizer&); // no implementation, will generate
73 void operator=(const TPacketizer&); // error on accidental usage
74
75 TFileNode *NextUnAllocNode();
76 void RemoveUnAllocNode(TFileNode *);
77
78 TFileNode *NextActiveNode();
79 void RemoveActiveNode(TFileNode *);
80
81 TFileStat *GetNextUnAlloc(TFileNode *node = 0);
82 TFileStat *GetNextActive();
83 void RemoveActive(TFileStat *file);
84
85 void Reset();
86 void ValidateFiles(TDSet *dset, TList *slaves, Long64_t maxent = -1, Bool_t byfile = kFALSE);
87
88public:
89 TPacketizer(TDSet *dset, TList *slaves, Long64_t first, Long64_t num,
90 TList *input, TProofProgressStatus *st);
91 virtual ~TPacketizer();
92
93 Int_t AddWorkers(TList *workers);
96
99
100 ClassDef(TPacketizer,0) //Generate work packets for parallel processing
101};
102
103#endif
ROOT::R::TRInterface & r
Definition: Object.C:4
int Int_t
Definition: RtypesCore.h:41
const Bool_t kFALSE
Definition: RtypesCore.h:88
long Long_t
Definition: RtypesCore.h:50
bool Bool_t
Definition: RtypesCore.h:59
long long Long64_t
Definition: RtypesCore.h:69
float Float_t
Definition: RtypesCore.h:53
#define ClassDef(name, id)
Definition: Rtypes.h:326
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:44
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
Definition: TMap.h:40
This class generates packets to be processed on PROOF worker servers.
Definition: TPacketizer.h:39
TFileStat * GetNextActive()
Get next active file.
Long_t fMaxSlaveCnt
Definition: TPacketizer.h:58
TFileNode * NextActiveNode()
Get next active node.
virtual ~TPacketizer()
Destructor.
void RemoveUnAllocNode(TFileNode *)
Remove unallocated node.
Bool_t fDefMaxWrkNode
Definition: TPacketizer.h:69
void operator=(const TPacketizer &)
Int_t fMaxPerfIdx
Definition: TPacketizer.h:56
Int_t AddWorkers(TList *workers)
Adds new workers. Returns the number of workers added, or -1 on failure.
TFileNode * NextUnAllocNode()
Get next unallocated node.
TList * fPackets
Definition: TPacketizer.h:44
Int_t GetActiveWorkers()
Return the number of workers still processing.
TList * fUnAllocated
Definition: TPacketizer.h:50
Bool_t fHeuristicPSiz
Definition: TPacketizer.h:68
void Reset()
Reset the internal datastructure for packet distribution.
TPacketizer(const TPacketizer &)
Int_t fPacketAsAFraction
Definition: TPacketizer.h:60
TList * fActive
Definition: TPacketizer.h:51
TFileStat * GetNextUnAlloc(TFileNode *node=0)
Get next unallocated file.
void RemoveActiveNode(TFileNode *)
Remove node from the list of actives.
TDSetElement * GetNextPacket(TSlave *sl, TMessage *r)
Get next packet.
Float_t GetCurrentRate(Bool_t &all)
Get Estimation of the current rate; just summing the current rates of the active workers.
TList * fFileNodes
Definition: TPacketizer.h:49
Long64_t fPacketSize
Definition: TPacketizer.h:53
void ValidateFiles(TDSet *dset, TList *slaves, Long64_t maxent=-1, Bool_t byfile=kFALSE)
Check existence of file/dir/tree an get number of entries.
void RemoveActive(TFileStat *file)
Remove file from the list of actives.
Container class for processing statistics.
Class describing a PROOF worker server.
Definition: TSlave.h:46
Handles synchronous and a-synchronous timer events.
Definition: TTimer.h:51
A TTree represents a columnar dataset.
Definition: TTree.h:71
The packetizer is a load balancing object created for each query.
Long64_t GetEntriesProcessed() const
Definition: file.py:1
Definition: first.py:1