37 :
KVBase(name), fAnalyser(
nullptr)
54 Warning(
"KVBatchSystem",
"Batch system %s has unknown job submission command: %s",
55 name, fJobSubCmd.Data());
60 SetDefaultJobOptions(
gEnv->
GetValue(
Form(
"%s.BatchSystem.DefaultJobOptions", name),
""));
68 KVBatchSystem::~KVBatchSystem()
125 command_line.
Form(
"%s %s ", fJobSubCmd.Data(), fDefOpt.Data());
126 if (fParList.GetNpar()) {
127 for (
int i = 0; i < fParList.GetNpar(); i++) {
129 command_line += par->
GetName();
136 command_line += fJobScript;
138 command_line.
ReplaceAll(
"#JobName#", GetJobName());
139 return command_line.
Data();
191 cout << GetJobSubCmdLine() << endl;
193 fAnalyser->WriteBatchEnvFile(GetJobName());
213 if (!CheckJobParameters())
return;
258 Info(
"SubmitTask",
"Task submission for analyser class : %s", da->
ClassName());
299 Info(
"ChangeDefJobOpt",
"Batch job options for this job are : %s", tmp.
Data());
300 SetDefaultJobOptions(tmp.
Data());
303 tmp =
gEnv->
GetValue(
Form(
"%s.BatchSystem.DefaultJobOptions", GetName()),
"");
304 SetDefaultJobOptions(tmp.
Data());
330 fCurrJobName = fJobName;
334 fCurrJobName = fAnalyser->ExpandAutoBatchName(fJobName.Data());
337 return fCurrJobName.Data();
350 while (!jobName.
Length()) {
351 cout <<
"Please enter the job name : ";
355 SetJobName(jobName.
Data());
372 env->
SetValue(
"BatchSystem.JobName", GetJobName());
386 fJobName = env->
GetValue(
"BatchSystem.JobName",
"");
400 if (!strcmp(option,
"log")) {
401 cout <<
"Job " << GetJobName()
402 <<
" executed by batch system " << GetName() << endl;
404 else if (!strcmp(option,
"all")) {
405 cout <<
ClassName() <<
" : Name = " << GetName() << endl <<
" Title = " << GetTitle() << endl;
406 cout <<
" fJobSubCmd = " << fJobSubCmd.Data() << endl;
407 cout <<
" fJobScript = " << fJobScript.Data() << endl;
408 cout <<
" fDefOpt = " << fDefOpt.Data() << endl;
459 nl.
SetValue(
"AutoJobNameFormat",
"$UserClass");
475 Info(
"SetBatchSystemParameters",
"JobName = %s", GetJobName());
KVBatchSystem * gBatchSystem
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
char * Form(const char *fmt,...)
R__EXTERN TSystem * gSystem
Base class for KaliVeda framework.
static Bool_t FindExecutable(TString &exec, const Char_t *path="$(PATH)")
virtual void Print(Option_t *option="") const
static TPluginHandler * LoadPlugin(const Char_t *base, const Char_t *uri="0")
Base class for interface to a batch job management system.
virtual void SubmitTask(KVDataAnalyser *da)
virtual void WriteBatchEnvFile(TEnv *)
virtual const Char_t * GetJobSubCmdLine()
virtual void SetJobName(const Char_t *name)
void cd()
Make this the default batch system.
virtual const Char_t * GetJobName() const
virtual KVList * GetListOfJobs()
virtual void Print(Option_t *="") const
virtual void ChangeDefJobOpt(KVDataAnalyser *da)
static KVBatchSystem * GetBatchSystem(const Char_t *plugin)
virtual void ReadBatchEnvFile(TEnv *)
virtual void SetBatchSystemParameters(const KVNameValueList &)
Use the parameters in the list to set all relevant parameters for batch system.
virtual void GetBatchSystemParameterList(KVNameValueList &)
virtual void Clear(Option_t *opt="")
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.
KVDataAnalysisTask * GetAnalysisTask() const
Extended TList class which owns its objects by default.
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
void SetValue(const Char_t *name, value_type value)
virtual void Clear(Option_t *opt="")
Bool_t GetBoolValue(const Char_t *name) const
const Char_t * GetStringValue(const Char_t *name) const
A generic named parameter storing values of different types.
const Char_t * GetString() const
TString GetTString() const
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
void Print(const char *="") const
virtual const char * GetValue(const char *name, const char *dflt) const
virtual void SetValue(const char *name, const char *value, EEnvLevel level=kEnvChange, const char *type=nullptr)
virtual const char * GetName() const
virtual void SetTitle(const char *title="")
virtual const char * ClassName() const
Longptr_t ExecPlugin(int nargs, const T &... params)
std::istream & ReadToDelim(std::istream &str, char delim='\n')
const char * Data() const
void Form(const char *fmt,...)
TString & ReplaceAll(const char *s1, const char *s2)
virtual Int_t Exec(const char *shellcmd)
virtual const char * WorkingDirectory()
virtual void Setenv(const char *name, const char *value)
RooCmdArg ClassName(const char *name)