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()
137 command_line.
Form(
"%s %s ", fJobSubCmd.Data(), fDefOpt.Data());
138 if (fParList.GetNpar()) {
139 for (
int i = 0; i < fParList.GetNpar(); i++) {
141 command_line += par->
GetName();
148 command_line += fJobScript;
150 command_line.
ReplaceAll(
"#JobName#", GetJobName());
155 return command_line.
Data();
207 cout << GetJobSubCmdLine() << endl;
209 fAnalyser->WriteBatchEnvFile(GetJobName());
229 if (!CheckJobParameters())
return;
274 Info(
"SubmitTask",
"Task submission for analyser class : %s", da->
ClassName());
315 Info(
"ChangeDefJobOpt",
"Batch job options for this job are : %s", tmp.
Data());
316 SetDefaultJobOptions(tmp.
Data());
319 tmp =
gEnv->
GetValue(
Form(
"%s.BatchSystem.DefaultJobOptions", GetName()),
"");
320 SetDefaultJobOptions(tmp.
Data());
354 fCurrJobName = fJobName;
358 fCurrJobName = fAnalyser->ExpandAutoBatchName(fJobName.Data());
359 if (MultiJobsMode() && !fAnalyser->BatchMode()) {
361 if (fCurrJobRunList.GetNValues() > 1)
362 tmp.
Form(
"_R%d-%d", fCurrJobRunList.First(), fCurrJobRunList.Last());
364 tmp.
Form(
"_R%d", fCurrJobRunList.First());
369 return fCurrJobName.Data();
382 while (!jobName.
Length()) {
383 cout <<
"Please enter the job name : ";
387 SetJobName(jobName.
Data());
404 env->
SetValue(
"BatchSystem.JobName", GetJobName());
418 fJobName = env->
GetValue(
"BatchSystem.JobName",
"");
432 if (!strcmp(option,
"log")) {
433 cout <<
"Job " << GetJobName()
434 <<
" executed by batch system " << GetName() << endl;
436 else if (!strcmp(option,
"all")) {
437 cout <<
ClassName() <<
" : Name = " << GetName() << endl <<
" Title = " << GetTitle() << endl;
438 cout <<
" fJobSubCmd = " << fJobSubCmd.Data() << endl;
439 cout <<
" fJobScript = " << fJobScript.Data() << endl;
440 cout <<
" fDefOpt = " << fDefOpt.Data() << endl;
491 nl.
SetValue(
"AutoJobNameFormat",
"$UserClass");
507 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)
virtual const char * TempDirectory() const
RooCmdArg ClassName(const char *name)