00001 // @(#)root/proof:$Id: TCondor.h 20882 2007-11-19 11:31:26Z rdm $ 00002 // Author: Maarten Ballintijn 06/12/03 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2003, Rene Brun and Fons Rademakers. * 00006 * All rights reserved. * 00007 * * 00008 * For the licensing terms see $ROOTSYS/LICENSE. * 00009 * For the list of contributors see $ROOTSYS/README/CREDITS. * 00010 *************************************************************************/ 00011 00012 #ifndef ROOT_TCondor 00013 #define ROOT_TCondor 00014 00015 ////////////////////////////////////////////////////////////////////////// 00016 // // 00017 // TCondor // 00018 // // 00019 // Interface to the Condor system. TCondor provides a (partial) API for // 00020 // querying and controlling the Condor system, including experimental // 00021 // extensions like COD (computing on demand) // 00022 // // 00023 ////////////////////////////////////////////////////////////////////////// 00024 00025 #ifndef ROOT_TObject 00026 #include "TObject.h" 00027 #endif 00028 #ifndef ROOT_TString 00029 #include "TString.h" 00030 #endif 00031 00032 00033 class TList; 00034 00035 00036 //------------------------------------------------------------------------ 00037 00038 class TCondorSlave : public TObject { 00039 public: 00040 TString fHostname; 00041 Int_t fPort; 00042 Int_t fPerfIdx; 00043 TString fImage; 00044 TString fClaimID; 00045 TString fOrdinal; 00046 TString fWorkDir; 00047 00048 void Print(Option_t *option="") const; 00049 00050 ClassDef(TCondorSlave,0) // Describes a claimed slave 00051 }; 00052 00053 00054 //------------------------------------------------------------------------ 00055 00056 class TCondor : public TObject { 00057 public: 00058 enum EState { kFree, kSuspended, kActive }; 00059 00060 private: 00061 00062 Bool_t fValid; //access to Condor 00063 TString fPool; //the condor pool to be accessed 00064 EState fState; //our claim state 00065 TList *fClaims; //list of claims we manage 00066 00067 protected: 00068 TCondorSlave *ClaimVM(const char *vm, const char *cmd); 00069 00070 public: 00071 TCondor(const char *pool = ""); 00072 virtual ~TCondor(); 00073 00074 00075 void Print(Option_t *option="") const; 00076 Bool_t IsValid() const { return fValid; } 00077 00078 TList *GetVirtualMachines() const; 00079 00080 TList *Claim(Int_t n, const char *cmd); 00081 TCondorSlave *Claim(const char *vmname, const char *cmd); 00082 Bool_t SetState(EState state); 00083 EState GetState() const {return fState;} 00084 Bool_t Suspend(); 00085 Bool_t Resume(); 00086 Bool_t Release(); 00087 00088 Bool_t GetVmInfo(const char *vm, TString &image, Int_t &perfidx) const; 00089 TString GetImage(const char *host) const; 00090 00091 00092 ClassDef(TCondor,0) // Interface to the Condor System 00093 }; 00094 00095 #endif