Logo ROOT  
Reference Guide
No Matches
Go to the documentation of this file.
1// @(#)root/proofplayer:$Id$
2// Author: Maarten Ballintijn 18/03/02
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 *************************************************************************/
12#ifndef ROOT_TPacketizer
13#define ROOT_TPacketizer
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// //
29#include "TVirtualPacketizer.h"
32class TMessage;
33class TTimer;
34class TTree;
35class TMap;
37class TProofStats;
41public: // public because of Sun CC bug
42 class TFileNode;
43 class TFileStat;
44 class TSlaveStat;
47 TList *fPackets; // all processed packets
49 TList *fFileNodes; // nodes with files
50 TList *fUnAllocated; // nodes with unallocated files
51 TList *fActive; // nodes with unfinished files
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
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.
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
72 TPacketizer(const TPacketizer&); // no implementation, will generate
73 void operator=(const TPacketizer&); // error on accidental usage
83 void RemoveActive(TFileStat *file);
85 void Reset();
86 void ValidateFiles(TDSet *dset, TList *slaves, Long64_t maxent = -1, Bool_t byfile = kFALSE);
89 TPacketizer(TDSet *dset, TList *slaves, Long64_t first, Long64_t num,
91 ~TPacketizer() override;
93 Int_t AddWorkers(TList *workers) override;
97 Float_t GetCurrentRate(Bool_t &all) override;
98 Int_t GetActiveWorkers() override;
100 ClassDefOverride(TPacketizer,0) //Generate work packets for parallel processing
long Long_t
Definition RtypesCore.h:54
float Float_t
Definition RtypesCore.h:57
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
long long Long64_t
Definition RtypesCore.h:80
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
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
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 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.
void RemoveUnAllocNode(TFileNode *)
Remove unallocated node.
Float_t GetCurrentRate(Bool_t &all) override
Get Estimation of the current rate; just summing the current rates of the active workers.
Bool_t fDefMaxWrkNode
Definition TPacketizer.h:69
void operator=(const TPacketizer &)
~TPacketizer() override
Int_t fMaxPerfIdx
Definition TPacketizer.h:56
TFileNode * NextUnAllocNode()
Get next unallocated node.
TList * fPackets
Definition TPacketizer.h:47
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
Int_t GetActiveWorkers() override
Return the number of workers still processing.
TDSetElement * GetNextPacket(TSlave *sl, TMessage *r) override
Get next packet.
TFileStat * GetNextUnAlloc(TFileNode *node=0)
Get next unallocated file.
void RemoveActiveNode(TFileNode *)
Remove node from the list of actives.
Int_t AddWorkers(TList *workers) override
Adds new workers. Returns the number of workers added, or -1 on failure.
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:79
The packetizer is a load balancing object created for each query.
Long64_t GetEntriesProcessed() const