Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TPacketizerFile.h
Go to the documentation of this file.
1 // @(#)root/proofplayer:$Id$
2 // Author: G. Ganis 2009
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_TPacketizerFile
13 #define ROOT_TPacketizerFile
14 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // TPacketizerFile //
18 // //
19 // This packetizer generates packets which conatin a single file path //
20 // to be used in process. Used for tasks generating files, like in //
21 // PROOF bench. //
22 // //
23 //////////////////////////////////////////////////////////////////////////
24 
25 #include "TVirtualPacketizer.h"
26 #include "TMap.h"
27 
28 
29 class TMessage;
30 class TList;
31 class TStopwatch;
32 
33 class TPacketizerFile : public TVirtualPacketizer {
34 
35 public: // This is always needed
36  class TSlaveStat;
37  class TIterObj;
38 
39 private:
40  TMap *fFiles; // Files to be produced/processed per node
41  TList *fNotAssigned; // List of files not assigned to a specific node
42  TList *fIters; // Iterators on the file lists per node
43  Long64_t fAssigned; // No.files processed or being processed.
44  Bool_t fProcNotAssigned; // Whether to process files not asdigned to a worker
45  Bool_t fAddFileInfo; // Whether to add the TFileInfo object in the packet
46 
47  TStopwatch *fStopwatch; // For measuring the start time of each packet
48 
49  TPacketizerFile();
50  // : fFiles(0), fNotAssigned(0), fIters(0), fAssigned(0),
51  // fProcNotAssigned(kTRUE), fAddFileInfo(kFALSE), fStopwatch(0) { }
52  TPacketizerFile(const TPacketizerFile&); // no implementation, will generate
53  void operator=(const TPacketizerFile&); // error on accidental usage
54 
55 public:
56  TPacketizerFile(TList *workers, Long64_t, TList *input, TProofProgressStatus *st = 0);
57  virtual ~TPacketizerFile();
58 
59  TDSetElement *GetNextPacket(TSlave *wrk, TMessage *r);
60 
61  Double_t GetCurrentTime();
62 
63  Float_t GetCurrentRate(Bool_t &all);
64  Int_t GetActiveWorkers() { return -1; }
65 
66  ClassDef(TPacketizerFile,0) //Generate work packets for parallel processing
67 };
68 
69 //-------------------------------------------------------------------------------
70 
71 #endif