Logo ROOT  
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 #include "TVirtualPacketizer.h"
30 
31 
32 class TIter;
33 class TList;
34 class TMap;
35 class TMessage;
37 class TSlave;
38 
40 
41 private:
42  TList *fPacketizers; // Packetizers to be processed
43  TIter *fPacketizersIter; // Iterator on fPacketizers
44  TVirtualPacketizer *fCurrent; // Packetizer being currently processed
45  TMap *fAssignedPack; // Map {worker,packetizer} of lat assignement
46 
48  TPacketizerMulti(const TPacketizerMulti&); // no implementation, will generate
49  void operator=(const TPacketizerMulti&); // error on accidental usage
50 
52  TList *input, TProofProgressStatus *st);
53 
54 public:
55  TPacketizerMulti(TDSet *dset, TList *slaves, Long64_t first, Long64_t num,
56  TList *input, TProofProgressStatus *st);
57  virtual ~TPacketizerMulti();
58 
60 
62  { if (fCurrent) return fCurrent->GetEstEntriesProcessed(f,ent,bytes,calls);
63  return 1; }
65  return (fCurrent? fCurrent->GetCurrentRate(all) : 0.); }
66  void StopProcess(Bool_t abort, Bool_t stoptimer = kFALSE) {
67  if (fCurrent) fCurrent->StopProcess(abort, stoptimer);
68  TVirtualPacketizer::StopProcess(abort, stoptimer); }
69  void MarkBad(TSlave *wrk, TProofProgressStatus *st, TList **missing)
70  { if (fCurrent) fCurrent->MarkBad(wrk, st, missing); return; }
72  { if (fCurrent) return fCurrent->AddProcessed(wrk, st, lat, missing);
73  return -1; }
74 
75  Int_t GetActiveWorkers() { if (fCurrent) return fCurrent->GetActiveWorkers(); return 0; }
76 
77  ClassDef(TPacketizerMulti,0) //Generate work packets for parallel processing
78 };
79 
80 #endif
TVirtualPacketizer::GetActiveWorkers
virtual Int_t GetActiveWorkers()
Definition: TVirtualPacketizer.h:150
TSlave
Class describing a PROOF worker server.
Definition: TSlave.h:46
first
Definition: first.py:1
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TPacketizerMulti::GetEstEntriesProcessed
Int_t GetEstEntriesProcessed(Float_t f, Long64_t &ent, Long64_t &bytes, Long64_t &calls)
Definition: TPacketizerMulti.h:61
f
#define f(i)
Definition: RSha256.hxx:104
r
ROOT::R::TRInterface & r
Definition: Object.C:4
TPacketizerMulti::operator=
void operator=(const TPacketizerMulti &)
Long64_t
long long Long64_t
Definition: RtypesCore.h:73
TPacketizerMulti::fAssignedPack
TMap * fAssignedPack
Definition: TPacketizerMulti.h:45
TPacketizerMulti::MarkBad
void MarkBad(TSlave *wrk, TProofProgressStatus *st, TList **missing)
Definition: TPacketizerMulti.h:69
Float_t
float Float_t
Definition: RtypesCore.h:57
TPacketizerMulti::fCurrent
TVirtualPacketizer * fCurrent
Definition: TPacketizerMulti.h:44
TVirtualPacketizer.h
TVirtualPacketizer::MarkBad
virtual void MarkBad(TSlave *, TProofProgressStatus *, TList **)
Definition: TVirtualPacketizer.h:141
TPacketizerMulti::GetActiveWorkers
Int_t GetActiveWorkers()
Definition: TPacketizerMulti.h:75
TDSetElement
Manages an element of a TDSet.
Definition: TDSet.h:66
bool
TPacketizerMulti::~TPacketizerMulti
virtual ~TPacketizerMulti()
Destructor.
Definition: TPacketizerMulti.cxx:137
TVirtualPacketizer::StopProcess
virtual void StopProcess(Bool_t abort, Bool_t stoptimer=kFALSE)
Stop process.
Definition: TVirtualPacketizer.cxx:243
TPacketizerMulti::GetCurrentRate
Float_t GetCurrentRate(Bool_t &all)
Definition: TPacketizerMulti.h:64
TProofProgressStatus
Container class for processing statistics.
Definition: TProofProgressStatus.h:25
TPacketizerMulti::AddProcessed
Int_t AddProcessed(TSlave *wrk, TProofProgressStatus *st, Double_t lat, TList **missing)
Definition: TPacketizerMulti.h:71
TVirtualPacketizer::GetEstEntriesProcessed
virtual Int_t GetEstEntriesProcessed(Float_t, Long64_t &ent, Long64_t &bytes, Long64_t &calls)
Definition: TVirtualPacketizer.h:121
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TPacketizerMulti::TPacketizerMulti
TPacketizerMulti()
TDSet
This class implements a data set to be used for PROOF processing.
Definition: TDSet.h:153
TPacketizerMulti::fPacketizers
TList * fPacketizers
Definition: TPacketizerMulti.h:42
TPacketizerMulti::StopProcess
void StopProcess(Bool_t abort, Bool_t stoptimer=kFALSE)
Stop process.
Definition: TPacketizerMulti.h:66
Double_t
double Double_t
Definition: RtypesCore.h:59
TVirtualPacketizer::AddProcessed
virtual Int_t AddProcessed(TSlave *, TProofProgressStatus *, Double_t, TList **)
Definition: TVirtualPacketizer.h:142
TVirtualPacketizer
The packetizer is a load balancing object created for each query.
Definition: TVirtualPacketizer.h:53
TVirtualPacketizer::GetCurrentRate
virtual Float_t GetCurrentRate(Bool_t &all)
Definition: TVirtualPacketizer.h:123
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TIter
Definition: TCollection.h:233
TMessage
Definition: TMessage.h:33
TPacketizerMulti::fPacketizersIter
TIter * fPacketizersIter
Definition: TPacketizerMulti.h:43
TPacketizerMulti
This class allows to do multiple runs in the same query; each run can be a, for example,...
Definition: TPacketizerMulti.h:39
TPacketizerMulti::TPacketizerMulti
TPacketizerMulti(const TPacketizerMulti &)
TPacketizerMulti::GetNextPacket
TDSetElement * GetNextPacket(TSlave *wrk, TMessage *r)
Get next packet from the current packetizer.
Definition: TPacketizerMulti.cxx:157
TList
A doubly linked list.
Definition: TList.h:44
int
TPacketizerMulti::CreatePacketizer
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.
Definition: TPacketizerMulti.cxx:235
TMap
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
Definition: TMap.h:40