TProof


class description - source file - inheritance tree

class TProof : public TVirtualProof

    private:
TProof TProof() TProof TProof(const TProof&) void ActivateAsyncInput() void AskStatus() Int_t Broadcast(const TMessage& mess, TList* slaves) Int_t Broadcast(const TMessage& mess, TProof::ESlaves list = kActive) Int_t Broadcast(const char* mess, Int_t kind, TList* slaves) Int_t Broadcast(const char* mess, Int_t kind = kMESS_STRING, TProof::ESlaves list = kActive) Int_t Broadcast(Int_t kind, TList* slaves) Int_t Broadcast(Int_t kind, TProof::ESlaves list = kActive) Int_t BroadcastObject(const TObject* obj, Int_t kind, TList* slaves) Int_t BroadcastObject(const TObject* obj, Int_t kind = kMESS_OBJECT, TProof::ESlaves list = kActive) Int_t BroadcastRaw(const void* buffer, Int_t length, TList* slaves) Int_t BroadcastRaw(const void* buffer, Int_t length, TProof::ESlaves list = kActive) Long_t CheckFile(const char* file, TSlave* sl) Int_t Collect(TList* slaves) Int_t Collect(TProof::ESlaves list = kActive) Int_t Collect(const TSlave* sl) Int_t Collect(TMonitor* mon) Int_t ConnectFile(const TFile* file) void ConnectFiles() void DeActivateAsyncInput() Int_t DisConnectFile(const TFile* file) Int_t Exec(const char* cmd, TProof::ESlaves list) TSlave* FindSlave(TSocket* s) const void FindUniqueSlaves() TList* GetListOfActiveSlaves() const TList* GetListOfBadSlaves() const TList* GetListOfSlaves() const TList* GetListOfUniqueSlaves() const Int_t GetNumberOfActiveSlaves() const Int_t GetNumberOfBadSlaves() const Int_t GetNumberOfSlaves() const Int_t GetNumberOfUniqueSlaves() const TProofPlayer* GetPlayer() const Int_t GoParallel(Int_t nodes) void HandleAsyncInput(TSocket* s) Int_t Init(const char* masterurl, const char* conffile, const char* confdir, Int_t loglevel) void Interrupt(TProof::EUrgent type, TProof::ESlaves list = kActive) void Limits(TSocket* s, TMessage& mess) void MarkBad(TSlave* sl) void MarkBad(TSocket* s) void operator=(const TProof&) Int_t Ping(TProof::ESlaves list) void RecvLogFile(TSocket* s, Int_t size) Int_t SendCommand(const char* cmd, TProof::ESlaves list = kActive) Int_t SendCurrentState(TProof::ESlaves list = kActive) Int_t SendFile(const char* file, Bool_t bin = kTRUE) Int_t SendGroupView() Int_t SendInitialState() Int_t SendObject(const TObject* obj, TProof::ESlaves list = kActive) Int_t SendPrint() void SetPlayer(TProofPlayer* player) public:
TProof TProof(const char* masterurl, const char* conffile = "kPROOF_ConfFile", const char* confdir = "kPROOF_ConfDir", Int_t loglevel = 0) virtual void ~TProof() virtual void AddInput(TObject* obj) static TClass* Class() virtual void ClearCache() virtual void ClearInput() virtual void ClearPackage(const char* package) virtual void ClearPackages() virtual void Close(Option_t* option) virtual Int_t EnablePackage(const char* package) virtual Int_t Exec(const char* cmd) virtual Double_t GetBytesRead() const virtual const char* GetConfDir() const virtual const char* GetConfFile() const virtual Float_t GetCpuTime() const virtual const char* GetImage() const virtual Int_t GetLogLevel() const virtual const char* GetMaster() const virtual TObject* GetOutput(const char* name) virtual TList* GetOutputList() virtual Int_t GetParallel() const virtual Int_t GetPort() const virtual Int_t GetProtocol() const virtual Float_t GetRealTime() const virtual Int_t GetStatus() const virtual const char* GetUser() const virtual const char* GetWorkDir() const virtual TClass* IsA() const virtual Bool_t IsMaster() const virtual Bool_t IsParallel() const virtual Bool_t IsValid() const virtual Int_t Ping() virtual void Print(Option_t* option) const virtual Int_t Process(TDSet* set, const char* selector, Long64_t nentries = -1, Long64_t first = 0, TEventList* evl = 0) virtual void SetLogLevel(Int_t level, UInt_t mask = TProofDebug::kAll) virtual Int_t SetParallel(Int_t nodes = 9999) virtual void ShowCache(Bool_t all = kFALSE) virtual void ShowEnabledPackages(Bool_t all = kFALSE) virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void ShowPackages(Bool_t all = kFALSE) virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b) virtual Int_t UploadPackage(const char* par, Int_t parallel = 1)

Data Members

    private:
TString fMaster name of master server (use "" if this is a master) TString fConfDir directory containing cluster config information TString fConfFile file containing config information TString fWorkDir current work directory on remote servers TString fUser user under which to run TString fPasswd user password TString fImage master's image name Int_t fPort port we are connected to (proofd = 1093) Int_t fSecurity security level used to connect to master server Int_t fProtocol protocol version number Int_t fLogLevel server debug logging level Int_t fStatus remote return status (part of kPROOF_LOGDONE) Int_t fParallel number of active slaves (only set on client, on server use fActiveSlaves) Bool_t fMasterServ true if we are a master server Bool_t fSendGroupView if true send new group view TList* fSlaves list of all slave servers as in config file TList* fActiveSlaves list of active slaves (subset of all slaves) TList* fUniqueSlaves list of all active slaves with unique file systems TList* fBadSlaves dead slaves (subset of all slaves) TMonitor* fAllMonitor monitor activity on all valid slave sockets TMonitor* fActiveMonitor monitor activity on all active slave sockets TMonitor* fUniqueMonitor monitor activity on all unique slave sockets Double_t fBytesRead bytes read by all slaves during the session Float_t fRealTime realtime spent by all slaves during the session Float_t fCpuTime CPU time spent by all slaves during the session Int_t fLimits used by Limits() TSignalHandler* fIntHandler interrupt signal handler (ctrl-c) TProofPlayer* fPlayer current player map<TString,TProof::MD5Mod_t,less<TString>,__malloc_alloc_template<0> > fFileMap map keeping track of a file's md5 and mod time public:
static const TProof::ESlaves kAll static const TProof::ESlaves kActive static const TProof::ESlaves kUnique static const TProof::EUrgent kHardInterrupt static const TProof::EUrgent kSoftInterrupt static const TProof::EUrgent kShutdownInterrupt

Class Description

                                                                      
 TProof                                                               
                                                                      
 This class controls a Parallel ROOT Facility, PROOF, cluster.        
 It fires the slave servers, it keeps track of how many slaves are    
 running, it keeps track of the slaves running status, it broadcasts  
 messages to all slaves, it collects results, etc.                    
                                                                      


TProof(const char *masterurl, const char *conffile, const char *confdir, Int_t loglevel)
 Create a PROOF environment. Starting PROOF involves either connecting
 to a master server, which in turn will start a set of slave servers, or
 directly starting as master server (if master = ""). Masterurl is of
 the form: proof://host[:port] or proofs://host[:port]. Conffile is
 the name of the config file describing the remote PROOF cluster
 (this argument alows you to describe different cluster configurations).
 The default proof.conf. Confdir is the directory where the config
 file and other PROOF related files are (like motd and noproof files).
 Loglevel is the log level (default = 1).

~TProof()
 Clean up PROOF environment.

Int_t Init(const char *masterurl, const char *conffile, const char *confdir, Int_t loglevel)
 Start the PROOF environment. Starting PROOF involves either connecting
 to a master server, which in turn will start a set of slave servers, or
 directly starting as master server (if master = ""). For a description
 of the arguments see the TProof ctor.

Int_t ConnectFile(const TFile *file)
 Send message to all slaves to connect "file". This method is
 called by the TFile ctor (no user method). Message is only send
 if file was opened in READ mode.

void ConnectFiles()
 Tell all servers to open all files currently opened by the client.

void Close(Option_t *)
 Close all open slave servers.

Int_t DisConnectFile(const TFile *file)
 Send message to all slaves to disconnect "file". This method is
 called by the TFile::Close() (no user method).

TSlave* FindSlave(TSocket *s) const
 Find slave that has TSocket s. Returns 0 in case slave is not found.

void FindUniqueSlaves()
 Add to the fUniqueSlave list the active slaves that have a unique
 (user) file system image. This information is used to transfer files
 only once to nodes that share a file system (an image).

Int_t GetNumberOfSlaves() const
 Return number of slaves as described in the config file.

Int_t GetNumberOfActiveSlaves() const
 Return number of active slaves, i.e. slaves that are valid and in
 the current computing group.

Int_t GetNumberOfUniqueSlaves() const
 Return number of unique slaves, i.e. active slaves that have each a
 unique different user files system.

Int_t GetNumberOfBadSlaves() const
 Return number of bad slaves. This are slaves that we in the config
 file, but refused to startup or that died during the PROOF session.

void AskStatus()
 Ask the status of the slaves.

void Interrupt(EUrgent type, ESlaves list)
 Send interrupt OOB byte to master or slave servers.

Int_t GetParallel() const
 Returns number of slave active in parallel mode. Returns 0 in case
 there are no active slaves.

Int_t Broadcast(const TMessage &mess, TList *slaves)
 Broadcast a message to all slaves in the specified list. Returns
 the number of slaves the message was successfully sent to.

Int_t Broadcast(const TMessage &mess, ESlaves list)
 Broadcast a message to all slaves in the specified list (either
 all slaves or only the active slaves). Returns the number of slaves
 the message was successfully sent to.

Int_t Broadcast(const char *str, Int_t kind, TList *slaves)
 Broadcast a character string buffer to all slaves in the specified
 list. Use kind to set the TMessage what field. Returns the number of
 slaves the message was sent to.

Int_t Broadcast(const char *str, Int_t kind, ESlaves list)
 Broadcast a character string buffer to all slaves in the specified
 list (either all slaves or only the active slaves). Use kind to
 set the TMessage what field. Returns the number of slaves the message
 was sent to.

Int_t BroadcastObject(const TObject *obj, Int_t kind, TList *slaves)
 Broadcast an object to all slaves in the specified list. Use kind to
 set the TMEssage what field. Returns the number of slaves the message
 was sent to.

Int_t BroadcastObject(const TObject *obj, Int_t kind, ESlaves list)
 Broadcast an object to all slaves in the specified list. Use kind to
 set the TMEssage what field. Returns the number of slaves the message
 was sent to.

Int_t BroadcastRaw(const void *buffer, Int_t length, TList *slaves)
 Broadcast a raw buffer of specified length to all slaves in the
 specified list. Returns the number of slaves the buffer was sent to.

Int_t BroadcastRaw(const void *buffer, Int_t length, ESlaves list)
 Broadcast a raw buffer of specified length to all slaves in the
 specified list. Returns the number of slaves the buffer was sent to.

Int_t Collect(const TSlave *sl)
 Collect responses from slave sl. Returns the number of slaves that
 responded (=1).

Int_t Collect(TList *slaves)
 Collect responses from the slave servers. Returns the number of slaves
 that responded.

Int_t Collect(ESlaves list)
 Collect responses from the slave servers. Returns the number of slaves
 that responded.

Int_t Collect(TMonitor *mon)
 Collect responses from the slave servers. Returns the number of messages
 received. Can be 0 if there are no active slaves.

void ActivateAsyncInput()
 Activate the a-sync input handler.

void DeActivateAsyncInput()
 De-actiate a-sync input handler.

void HandleAsyncInput(TSocket *sl)
 Handle input coming from the master server (when this is a client)
 or from a slave server (when this is a master server). This is mainly
 for a-synchronous communication. Normally when PROOF issues a command
 the (slave) server messages are directly handle by Collect().

void Limits(TSocket *s, TMessage &mess)
 Calculate histogram limits after TTree::fEstimate entries have
 been processed.
 This function is called via Collect() in response to a kPROOF_LIMITS
 message send from a PROOF slave in TTree::TakeEstimate().

void MarkBad(TSlave *sl)
 Add a bad slave server to the bad slave list and remove it from
 the active list and from the two monitor objects.

void MarkBad(TSocket *s)
 Add slave with socket s to the bad slave list and remove if from
 the active list and from the two monitor objects.

Int_t Ping()
 Ping PROOF. Returns 1 if master server responded.

Int_t Ping(ESlaves list)
 Ping PROOF slaves. Returns the number of slaves that responded.

void Print(Option_t *option) const
 Print status of PROOF cluster.

Int_t Process(TDSet *set, const char *selector, Long64_t nentries, Long64_t first, TEventList *evl)
 Process a data set (TDSet) using the specified selector (.C) file.
 Returns -1 in case of error, 0 otherwise.

void AddInput(TObject *obj)
 Add objects that might be needed during the processing of
 the selector (see Process()).

void ClearInput()
 Clear input object list.

TObject* GetOutput(const char *name)
 Get specified object that has been produced during the processing
 (see Process()).

TList* GetOutputList()
 Get list with all object created during processing (see Process()).

void RecvLogFile(TSocket *s, Int_t size)
 Receive the log file of the slave with socket s.

Int_t SendGroupView()
 Send to all active slaves servers the current slave group size
 and their unique id. Returns number of active slaves.

Int_t Exec(const char *cmd)
 Send command to be executed on the PROOF master and/or slaves.
 Command can be any legal command line command. Commands like
 ".x file.C" or ".L file.C" will cause the file file.C to be send
 to the PROOF cluster. Returns -1 in case of error, >=0 in case of
 succes.

Int_t Exec(const char *cmd, ESlaves list)
 Send command to be executed on the PROOF master and/or slaves.
 Command can be any legal command line command. Commands like
 ".x file.C" or ".L file.C" will cause the file file.C to be send
 to the PROOF cluster. Returns -1 in case of error, >=0 in case of
 succes.

Int_t SendCommand(const char *cmd, ESlaves list)
 Send command to be executed on the PROOF master and/or slaves.
 Command can be any legal command line command, however commands
 like ".x file.C" or ".L file.C" will not cause the file.C to be
 transfered to the PROOF cluster. In that case use TProof::Exec().
 Returns the status send by the remote server as part of the
 kPROOF_LOGDONE message. Typically this is the return code of the
 command on the remote side.

Int_t SendCurrentState(ESlaves list)
 Transfer the current state of the master to the active slave servers
 just before starting the TTree loop. The current state includes: the
 current working directory, TChain defintion, MaxVirtualSize, Selector,
 etc.

Int_t SendInitialState()
 Transfer the initial (i.e. current) state of the master to all
 slave servers. The initial state includes: log level, currently open
 files.

Long_t CheckFile(const char *file, TSlave *slave)
 Check if a file needs to be send to the slave. Use the following
 algorithm:
   - check if file appears in file map
     - if yes, get file's modtime and check against time in map,
       if modtime not same get md5 and compare against md5 in map,
       if not same return size
     - if no, get file's md5 and modtime and store in file map, ask
       slave if file exists with specific md5, if yes return 0,
       if no return file's size
 Returns size of file in case file needs to be send, returns 0 in case
 file is already on remote and -1 in case of error.

Int_t SendFile(const char *file, Bool_t bin)
 Send a file to master or slave servers. Returns number of slaves
 the file was sent to, maybe 0 in case master and slaves have the same
 file system image, -1 in case of error. If bin is true binary
 file transfer is used, otherwise ASCII mode.

Int_t SendObject(const TObject *obj, ESlaves list)
 Send object to master or slave servers. Returns number slaves object
 was sent to, 0 in case of error.

Int_t SendPrint()
 Send print command to master server.

void SetLogLevel(Int_t level, UInt_t mask)
 Set server logging level.

Int_t SetParallel(Int_t nodes)
 Tell RPOOF how many slaves to use in parallel. Returns the number of
 parallel slaves.

Int_t GoParallel(Int_t nodes)
 Go in parallel mode with at most "nodes" slaves. Since the fSlaves
 list is sorted by slave performace the active list will contain first
 the most performant nodes.

void ShowCache(Bool_t all)
 List contents of file cache. If all is true show all caches also on
 slaves. If everything is ok all caches are to be the same.

void ClearCache()
 Remove files from all file caches.

void ShowPackages(Bool_t all)
 List contents of package directory. If all is true show all package
 directries also on slaves. If everything is ok all package directories
 should be the same.

void ShowEnabledPackages(Bool_t all)
 List which packages are enabled. If all is true show enabled packages
 for all slaves. If everything is ok all slaves should have the same
 packages enabled.

void ClearPackages()
 Remove all packages.

void ClearPackage(const char *package)
 Remove a specific package.

Int_t EnablePackage(const char *package)
 Enable specified package. Executes the PROOF-INF/BUILD.C (or BUILD.sh)
 if exists followed by the PROOF-INF/setup.C script.
 Returns 0 in case of success and -1 in case of error.

Int_t UploadPackage(const char *par, Int_t parallel)
 Upload a PROOF archive (PAR file). A PAR file is a compressed
 tar file with one special additional directory, PROOF-INF
 (blatantly copied from Java's jar format). It must have the extension
 .par. A PAR file can be directly a binary or a source with a build
 procedure. In the PROOF-INF directory there can be a build script:
 BUILD.C or BUILD.sh to be called to build the package (.C is tried
 before .sh), in case of a binary PAR file don't specify a BUILD
 script or make it a no-op. Then there is SETUP.C which sets the
 right environment variables to use the package, like LD_LIBRARY_PATH,
 etc. Parallel is the number of parallel streams that can be used to
 upload the package to the master server. Returns 0 in case of success
 and -1 in case of error.



Inline Functions


               TProof TProof(const TProof&)
                 void operator=(const TProof&)
                Int_t Broadcast(Int_t kind, TList* slaves)
                Int_t Broadcast(Int_t kind, TProof::ESlaves list = kActive)
               TList* GetListOfSlaves() const
               TList* GetListOfActiveSlaves() const
               TList* GetListOfUniqueSlaves() const
               TList* GetListOfBadSlaves() const
                 void SetPlayer(TProofPlayer* player)
        TProofPlayer* GetPlayer() const
               TProof TProof(const char* masterurl, const char* conffile = "kPROOF_ConfFile", const char* confdir = "kPROOF_ConfDir", Int_t loglevel = 0)
          const char* GetMaster() const
          const char* GetConfDir() const
          const char* GetConfFile() const
          const char* GetUser() const
          const char* GetWorkDir() const
          const char* GetImage() const
                Int_t GetPort() const
                Int_t GetProtocol() const
                Int_t GetStatus() const
                Int_t GetLogLevel() const
             Double_t GetBytesRead() const
              Float_t GetRealTime() const
              Float_t GetCpuTime() const
               Bool_t IsMaster() const
               Bool_t IsValid() const
               Bool_t IsParallel() const
              TClass* Class()
              TClass* IsA() const
                 void ShowMembers(TMemberInspector& insp, char* parent)
                 void Streamer(TBuffer& b)
                 void StreamerNVirtual(TBuffer& b)


Author: Fons Rademakers 13/02/97
Last update: root/proof:$Name: $:$Id: TProof.cxx,v 1.28 2002/09/19 13:59:48 rdm Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *


ROOT page - Class index - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.