Logo ROOT   6.08/07
Reference Guide
TPacketizerMulti.h
Go to the documentation of this file.
1 // $Id$
2 // Author: G. Ganis Jan 2010
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_TPacketizerMulti
13 #define ROOT_TPacketizerMulti
14 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // TPacketizerMulti //
18 // //
19 // This class allows to do multiple runs in the same query; each run //
20 // can be a, for example, different dataset or the same dataset with //
21 // entry list. //
22 // The multiple packetizer conatins a list of packetizers which are //
23 // processed in turn. //
24 // The bit TSelector::kNewRun is set in the TSelector object when a new //
25 // packetizer is used. //
26 // //
27 //////////////////////////////////////////////////////////////////////////
28 
29 #ifndef ROOT_TVirtualPacketizer
30 #include "TVirtualPacketizer.h"
31 #endif
32 
33 
34 class TIter;
35 class TList;
36 class TMap;
37 class TMessage;
39 class TSlave;
40 
42 
43 private:
44  TList *fPacketizers; // Packetizers to be processed
45  TIter *fPacketizersIter; // Iterator on fPacketizers
46  TVirtualPacketizer *fCurrent; // Packetizer being currently processed
47  TMap *fAssignedPack; // Map {worker,packetizer} of lat assignement
48 
50  TPacketizerMulti(const TPacketizerMulti&); // no implementation, will generate
51  void operator=(const TPacketizerMulti&); // error on accidental usage
52 
54  TList *input, TProofProgressStatus *st);
55 
56 public:
57  TPacketizerMulti(TDSet *dset, TList *slaves, Long64_t first, Long64_t num,
58  TList *input, TProofProgressStatus *st);
59  virtual ~TPacketizerMulti();
60 
62 
64  { if (fCurrent) return fCurrent->GetEstEntriesProcessed(f,ent,bytes,calls);
65  return 1; }
67  return (fCurrent? fCurrent->GetCurrentRate(all) : 0.); }
68  void StopProcess(Bool_t abort, Bool_t stoptimer = kFALSE) {
69  if (fCurrent) fCurrent->StopProcess(abort, stoptimer);
70  TVirtualPacketizer::StopProcess(abort, stoptimer); }
71  void MarkBad(TSlave *wrk, TProofProgressStatus *st, TList **missing)
72  { if (fCurrent) fCurrent->MarkBad(wrk, st, missing); return; }
74  { if (fCurrent) return fCurrent->AddProcessed(wrk, st, lat, missing);
75  return -1; }
76 
77  Int_t GetActiveWorkers() { if (fCurrent) return fCurrent->GetActiveWorkers(); return 0; }
78 
79  ClassDef(TPacketizerMulti,0) //Generate work packets for parallel processing
80 };
81 
82 #endif
virtual Int_t AddProcessed(TSlave *, TProofProgressStatus *, Double_t, TList **)
virtual Float_t GetCurrentRate(Bool_t &all)
long long Long64_t
Definition: RtypesCore.h:69
Float_t GetCurrentRate(Bool_t &all)
virtual void MarkBad(TSlave *, TProofProgressStatus *, TList **)
float Float_t
Definition: RtypesCore.h:53
This class implements a data set to be used for PROOF processing.
Definition: TDSet.h:153
void StopProcess(Bool_t abort, Bool_t stoptimer=kFALSE)
Stop process.
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
virtual void StopProcess(Bool_t abort, Bool_t stoptimer=kFALSE)
Stop process.
Manages an element of a TDSet.
Definition: TDSet.h:68
This class allows to do multiple runs in the same query; each run can be a, for example, different dataset or the same dataset with entry list.
#define ClassDef(name, id)
Definition: Rtypes.h:254
TVirtualPacketizer * CreatePacketizer(TDSet *dset, TList *wrks, Long64_t first, Long64_t num, TList *input, TProofProgressStatus *st)
Create a packetizer for dataset 'dset' Return null on failure.
virtual Int_t GetEstEntriesProcessed(Float_t, Long64_t &ent, Long64_t &bytes, Long64_t &calls)
TDSetElement * GetNextPacket(TSlave *wrk, TMessage *r)
Get next packet from the current packetizer.
A doubly linked list.
Definition: TList.h:47
TRandom2 r(17)
void MarkBad(TSlave *wrk, TProofProgressStatus *st, TList **missing)
The packetizer is a load balancing object created for each query.
double f(double x)
double Double_t
Definition: RtypesCore.h:55
Int_t GetEstEntriesProcessed(Float_t f, Long64_t &ent, Long64_t &bytes, Long64_t &calls)
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
Definition: TMap.h:44
TVirtualPacketizer * fCurrent
void operator=(const TPacketizerMulti &)
virtual ~TPacketizerMulti()
Destructor.
Int_t AddProcessed(TSlave *wrk, TProofProgressStatus *st, Double_t lat, TList **missing)
virtual Int_t GetActiveWorkers()
Definition: first.py:1
Class describing a PROOF worker server.
Definition: TSlave.h:50
Container class for processing statistics.
const Bool_t kTRUE
Definition: Rtypes.h:91