KaliVeda  1.12/06
Heavy-Ion Analysis Toolkit
KVBatchSystem.h
Go to the documentation of this file.
1 /*
2 $Id: KVBatchSystem.h,v 1.11 2008/04/03 07:35:45 franklan Exp $
3 $Revision: 1.11 $
4 $Date: 2008/04/03 07:35:45 $
5 */
6 
9 
10 #ifndef __KVBATCHSYSTEM_H
11 #define __KVBATCHSYSTEM_H
12 
13 #include "KVNameValueList.h"
14 #include "KVNumberList.h"
15 #include "KVString.h"
16 #include "KVBase.h"
17 
18 class KVDataAnalyser;
19 class TEnv;
20 class TGWindow;
21 class KVList;
22 
68 
72 
77 class KVBatchSystem : public KVBase {
78 
79 protected:
80 
88 
89  virtual void ChangeDefJobOpt(KVDataAnalyser* da);
90 
91 public:
92 
93  KVBatchSystem(const Char_t* name);
94  virtual ~ KVBatchSystem();
95 
97  {
98  return fParList;
99  };
100 
101  virtual const Char_t* GetJobSubCmd() const
102  {
103  return fJobSubCmd.Data();
104  };
105  virtual void SubmitTask(KVDataAnalyser* da);
106  virtual void SubmitJob();
107  virtual void PrintJobs(Option_t* /* opt */ = "")
108  {
109  ;
110  }
111  virtual Bool_t CheckJobParameters();
112 
113  virtual void Run();
114 
115  virtual void SetJobScript(const Char_t* path)
116  {
117  fJobScript = path;
118  };
119 
120  virtual void SetDefaultJobOptions(const Char_t* opt)
121  {
123  fDefOpt = opt;
124  };
125  virtual const Char_t* GetDefaultJobOptions() const
126  {
127  return fDefOpt.Data();
128  };
129 
130  virtual void SetJobName(const Char_t* name);
131  virtual const Char_t* GetJobName() const;
132 
133  virtual const Char_t* GetJobSubCmdLine();
134 
135  virtual void Clear(Option_t* opt = "");
136 
137  static KVBatchSystem* GetBatchSystem(const Char_t* plugin);
138 
139  void cd();
140 
141 
142  virtual void WriteBatchEnvFile(TEnv*);
143  virtual void ReadBatchEnvFile(TEnv*);
144  virtual void Print(Option_t* /*option*/ = "") const;
145 
146  virtual void SetAnalyser(KVDataAnalyser* da)
147  {
148  fAnalyser = da;
149  }
150 
151 
152  virtual void SanitizeJobName() const {}
153 
154  virtual KVList* GetListOfJobs();
155 
156  virtual void AlterJobs(TGWindow*, TList*)
157  {
158  ;
159  }
160 
162  virtual void SetBatchSystemParameters(const KVNameValueList&);
163 
164  ClassDef(KVBatchSystem, 2) //Base class for interface to batch job management system
165 };
166 
169 
170 #endif
#define R__EXTERN
R__EXTERN KVBatchSystem * gBatchSystem
................ global variable
char Char_t
bool Bool_t
const char Option_t
#define ClassDef(name, id)
Base class for KaliVeda framework.
Definition: KVBase.h:135
Base class for interface to a batch job management system.
Definition: KVBatchSystem.h:77
virtual void SubmitTask(KVDataAnalyser *da)
KVString fJobSubCmd
shell command for submitting job
Definition: KVBatchSystem.h:84
virtual void WriteBatchEnvFile(TEnv *)
KVString fJobName
base job name
Definition: KVBatchSystem.h:83
virtual const Char_t * GetJobSubCmdLine()
virtual ~ KVBatchSystem()
virtual void SetJobName(const Char_t *name)
virtual void SetDefaultJobOptions(const Char_t *opt)
void cd()
Make this the default batch system.
virtual void SubmitJob()
KVString fJobScript
full path of shell script to be executed by batch system
Definition: KVBatchSystem.h:85
KVBatchSystem(const Char_t *name)
virtual const Char_t * GetDefaultJobOptions() const
virtual const Char_t * GetJobName() const
virtual void Run()
virtual void SanitizeJobName() const
virtual void PrintJobs(Option_t *="")
KVNameValueList fParList
list of parameters/switches to be passed on job submission command line
Definition: KVBatchSystem.h:82
virtual KVList * GetListOfJobs()
virtual void Print(Option_t *="") const
virtual void ChangeDefJobOpt(KVDataAnalyser *da)
virtual void SetAnalyser(KVDataAnalyser *da)
static KVBatchSystem * GetBatchSystem(const Char_t *plugin)
virtual const Char_t * GetJobSubCmd() const
virtual void AlterJobs(TGWindow *, TList *)
virtual void ReadBatchEnvFile(TEnv *)
KVString fDefOpt
default options for job submission command
Definition: KVBatchSystem.h:86
virtual void SetBatchSystemParameters(const KVNameValueList &)
Use the parameters in the list to set all relevant parameters for batch system.
KVDataAnalyser * fAnalyser
the analyser object which requests job submission, it has all details on the job
Definition: KVBatchSystem.h:81
virtual void SetJobScript(const Char_t *path)
KVString fCurrJobName
name of current job being submitted
Definition: KVBatchSystem.h:87
virtual void GetBatchSystemParameterList(KVNameValueList &)
virtual void Clear(Option_t *opt="")
KVNameValueList & GetParameters()
Definition: KVBatchSystem.h:96
virtual Bool_t CheckJobParameters()
Checks the job and ask for the job name if needed.
Manager class which sets up and runs data analysis tasks.
Extended TList class which owns its objects by default.
Definition: KVList.h:27
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition: KVString.h:72
const char * Data() const