29 fDefJobTime =
gEnv->
GetValue(
"GE.BatchSystem.DefaultJobTime",
"00:05:00");
30 fDefJobMem =
gEnv->
GetValue(
"GE.BatchSystem.DefaultJobMemory",
"3G");
31 fTimeSet = fMemSet =
kFALSE;
33 SetRunsPerJob(
gEnv->
GetValue(
"GE.BatchSystem.RunsPerJob", 1));
46 fTimeSet = fMemSet =
kFALSE;
56 KV_CCIN2P3_Slurm::~KV_CCIN2P3_Slurm()
72 if (tmp ==
"") tmp = fDefJobTime;
76 fParList.SetValue(
"--time ", tmp);
93 if (tmp ==
"") tmp = fDefJobMem;
94 fParList.SetValue(
"--mem ", tmp);
122 if (!fTimeSet) ChooseJobTime();
124 if (!fMemSet) ChooseJobMemory();
136 cout <<
"Enter max CPU time per job (ss/mn:ss/hh:mn:ss) ["
137 << fDefJobTime <<
"] : ";
154 cout <<
"Enter max memory per job (xKB/xMB/xGB) ["
155 << fDefJobMem.
Data() <<
"] : ";
158 SetJobMemory(tmp.
Data());
169 return fParList.GetStringValue(
"--time ");
180 return fParList.GetStringValue(
"--mem ");
195 env->
SetValue(
"BatchSystem.MultiJobs", MultiJobsMode());
196 if (MultiJobsMode()) env->
SetValue(
"BatchSystem.CurrentRunList", fCurrJobRunList.AsString());
197 env->
SetValue(
"BatchSystem.Time", GetJobTime());
198 env->
SetValue(
"BatchSystem.Memory", GetJobMemory());
201 env->
SetValue(
"SimDirAnalyser.CopyFilesToWorkingDirectory",
true);
217 if (MultiJobsMode()) fCurrJobRunList.SetList(env->
GetValue(
"BatchSystem.CurrentRunList",
""));
218 SetJobTime(env->
GetValue(
"BatchSystem.Time",
""));
219 SetJobMemory(env->
GetValue(
"BatchSystem.Memory",
""));
233 if (!strcmp(option,
"log")) {
235 cout <<
"* MEM_REQ: " << GetJobMemory() <<
" *" << endl;
277 KVString oldoptions(GetDefaultJobOptions());
281 if ((NeedToAddSPS || repIsSPS)) {
282 oldoptions +=
" -L sps";
283 SetDefaultJobOptions(oldoptions.
Data());
306 fCurrJobName.ReplaceAll(
":",
"_");
322 if (!CheckJobParameters())
return;
324 if (MultiJobsMode()) {
325 if (fAnalyser->InheritsFrom(
"KVDataSetAnalyser")) {
331 fCurrJobRunList.Clear();
332 while (remaining_runs && !runs.
End()) {
335 fCurrJobRunList.Add(run);
336 if ((fCurrJobRunList.GetNValues() == GetRunsPerJob()) || runs.
End()) {
341 fCurrJobRunList.Clear();
345 }
else if (fAnalyser->InheritsFrom(
"KVSimDirAnalyser")) {
350 fCurrJobRunList.Clear();
355 while ((of = it())) {
356 cur_file_list.
Add(of);
357 fCurrJobRunList.Add(file_no);
360 if ((fCurrJobRunList.GetNValues() == GetRunsPerJob()) || (remaining_runs == 0)) {
364 fCurrJobRunList.Clear();
365 cur_file_list.
Clear();
405 fCurrJobName = fJobName;
408 fCurrJobName = fAnalyser->ExpandAutoBatchName(fJobName.Data());
409 if (MultiJobsMode() && !fAnalyser->BatchMode()) {
411 if (fCurrJobRunList.GetNValues() > 1)
412 tmp.
Form(
"_R%d-%d", fCurrJobRunList.First(), fCurrJobRunList.Last());
414 tmp.
Form(
"_R%d", fCurrJobRunList.First());
419 return fCurrJobName.Data();
452 nl.
SetValue(
"JobTime", fDefJobTime);
453 nl.
SetValue(
"JobMemory", fDefJobMem);
454 nl.
SetValue(
"MultiJobsMode", MultiJobsMode());
455 nl.
SetValue(
"RunsPerJob", fRunsPerJob);
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
R__EXTERN TSystem * gSystem
Base class for interface to a batch job management system.
virtual void WriteBatchEnvFile(TEnv *)
virtual void Print(Option_t *="") const
virtual void ChangeDefJobOpt(KVDataAnalyser *da)
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.
virtual KVString GetRootDirectoryOfDataToAnalyse() const
KVDataAnalysisTask * GetAnalysisTask() const
Pilots user analysis of experimental data.
void SetFullRunList(const KVNumberList &nl)
void SetRuns(const KVNumberList &nl, Bool_t check=kTRUE)
const KVNumberList & GetRunList() const
Extended TList class which owns its objects by default.
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
Int_t GetIntValue(const Char_t *name) const
void SetValue(const Char_t *name, value_type value)
Bool_t GetBoolValue(const Char_t *name) const
const Char_t * GetStringValue(const Char_t *name) const
Strings used to represent a set of ranges of values.
Class piloting analyses of simulated data.
Int_t GetNumberOfFilesToAnalyse() const
TList * GetFileList() const
void SetFileList(TList *l)
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Int_t GetNValues(TString delim) const
Interface to CCIN2P3 Grid Engine batch job management system.
virtual void Print(Option_t *="") const
virtual void ChangeDefJobOpt(KVDataAnalyser *)
const Char_t * GetJobName() const
const Char_t * GetJobTime(void) const
returns the parameter string corresponding to the job CPU time
virtual void Clear(Option_t *opt="")
Clear previously set parameters in order to create a new job submission command.
virtual Bool_t CheckJobParameters()
Checks the job and asks for any missing parameters.
void SetJobMemory(const Char_t *h="")
virtual void GetBatchSystemParameterList(KVNameValueList &)
const Char_t * GetJobMemory(void) const
returns the parameter string corresponding to the job Memory
void ChooseJobMemory(void)
void SetJobTime(const Char_t *h="")
virtual void SetBatchSystemParameters(const KVNameValueList &)
Use the parameters in the list to set all relevant parameters for batch system.
void PrintJobs(Option_t *opt="")
Print list of owner's jobs.
virtual void ReadBatchEnvFile(TEnv *)
virtual void SanitizeJobName() const
virtual void WriteBatchEnvFile(TEnv *)
virtual void ls(Option_t *option="") 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 void Add(TObject *obj)
virtual void Clear(Option_t *option="")
virtual const char * GetName() const
std::istream & ReadToDelim(std::istream &str, char delim='\n')
const char * Data() const
TString & Prepend(char c, Ssiz_t rep=1)
void Form(const char *fmt,...)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual const char * WorkingDirectory()
UInt_t GetListOfJobs(TFile *file, TList &jobdirs)