29 fDefJobTime =
gEnv->
GetValue(
"GE.BatchSystem.DefaultJobTime",
"5:00");
30 fDefJobMem =
gEnv->
GetValue(
"GE.BatchSystem.DefaultJobMemory",
"2G");
31 fDefJobDisk =
gEnv->
GetValue(
"GE.BatchSystem.DefaultJobDisk",
"50M");
32 fTimeSet = fDiskSet = fMemSet =
kFALSE;
34 SetRunsPerJob(
gEnv->
GetValue(
"GE.BatchSystem.RunsPerJob", 1));
47 fTimeSet = fDiskSet = fMemSet =
kFALSE;
57 KV_CCIN2P3_GE::~KV_CCIN2P3_GE()
73 if (tmp ==
"") tmp = fDefJobTime;
76 fParList.SetValue(
"-l ct=", tmp);
93 if (tmp ==
"") tmp = fDefJobMem;
94 fParList.SetValue(
"-l vmem=", tmp);
111 if (tmp ==
"") tmp = fDefJobDisk;
112 fParList.SetValue(
"-l fsize=", tmp);
140 if (!fTimeSet) ChooseJobTime();
142 if (!fDiskSet) ChooseJobDisk();
144 if (!fMemSet) ChooseJobMemory();
156 cout <<
"Enter max CPU time per job (ss/mn:ss/hh:mn:ss) ["
157 << fDefJobTime <<
"] : ";
175 cout <<
"Enter max memory per job (xKB/xMB/xGB) ["
176 << fDefJobMem.
Data() <<
"] : ";
179 SetJobMemory(tmp.
Data());
189 cout <<
"Enter max scratch disk per job (xKB/xMB/xGB) ["
190 << fDefJobDisk.
Data() <<
"] : ";
193 SetJobDisk(tmp.
Data());
204 return fParList.GetStringValue(
"-l ct=");
215 return fParList.GetStringValue(
"-l vmem=");
226 return fParList.GetStringValue(
"-l fsize=");
241 env->
SetValue(
"BatchSystem.MultiJobs", MultiJobsMode());
242 if (MultiJobsMode()) env->
SetValue(
"BatchSystem.CurrentRunList", fCurrJobRunList.AsString());
243 env->
SetValue(
"BatchSystem.Time", GetJobTime());
244 env->
SetValue(
"BatchSystem.Memory", GetJobMemory());
245 env->
SetValue(
"BatchSystem.Disk", GetJobDisk());
248 env->
SetValue(
"SimDirAnalyser.CopyFilesToWorkingDirectory",
true);
264 if (MultiJobsMode()) fCurrJobRunList.SetList(env->
GetValue(
"BatchSystem.CurrentRunList",
""));
265 SetJobTime(env->
GetValue(
"BatchSystem.Time",
""));
266 SetJobMemory(env->
GetValue(
"BatchSystem.Memory",
""));
267 SetJobDisk(env->
GetValue(
"BatchSystem.Disk",
""));
281 if (!strcmp(option,
"log")) {
283 cout <<
"* DISK_REQ: " << GetJobDisk() <<
" *" << endl;
284 cout <<
"* MEM_REQ: " << GetJobMemory() <<
" *" << endl;
327 KVString oldoptions(GetDefaultJobOptions());
331 if ((NeedToAddSPS || repIsSPS)) {
332 oldoptions +=
" -l sps=1";
333 SetDefaultJobOptions(oldoptions.
Data());
334 Info(
"ChangeDefJobOpt",
335 "Your job is being launched from /sps/... zone.\nTherefore the ressource 'sps' has been declared and the number of jobs which can be treated concurrently will be limited.");
358 fCurrJobName.ReplaceAll(
":",
"_");
379 for (
Int_t line_number = 0; line_number < nlines; line_number++) {
381 if (thisLine.
Contains(
"Full jobname:")) {
390 Int_t dd, MM, yyyy, hh,
mm, ss;
391 sscanf(sdate.
Data(),
"%d/%d/%d", &MM, &dd, &yyyy);
392 sscanf(stime.
Data(),
"%d:%d:%d", &hh, &
mm, &ss);
404 list_of_jobs->
Add(job);
409 if (!list_of_jobs->
GetEntries())
return list_of_jobs;
412 TIter next_job(list_of_jobs);
423 for (
Int_t line_number = 0; line_number < nlines; line_number++) {
431 if (tmp->
GetEntries() == 4) sscanf(stime.
Data(),
"%d:%2d:%2d:%2d", &dd, &hh, &
mm, &ss);
432 else sscanf(stime.
Data(),
"%2d:%2d:%2d", &hh, &
mm, &ss);
439 else if (thisLine.
BeginsWith(
"hard resource_list:")) {
447 TIter next_res(bbits);
451 if (
g.BeginsWith(
"ct=")) {
455 else if (
g.BeginsWith(
"vmem=")) {
459 else if (
g.BeginsWith(
"fsize=")) {
483 fParList.SetValue(
"-m b",
"");
494 fParList.SetValue(
"-m e",
"");
505 fParList.SetValue(
"-M ", email);
521 if (!CheckJobParameters())
return;
523 if (MultiJobsMode()) {
524 if (fAnalyser->InheritsFrom(
"KVDataSetAnalyser")) {
530 fCurrJobRunList.Clear();
531 while (remaining_runs && !runs.
End()) {
534 fCurrJobRunList.Add(run);
535 if ((fCurrJobRunList.GetNValues() == GetRunsPerJob()) || runs.
End()) {
540 fCurrJobRunList.Clear();
545 else if (fAnalyser->InheritsFrom(
"KVSimDirAnalyser")) {
550 fCurrJobRunList.Clear();
555 while ((of = it())) {
556 cur_file_list.
Add(of);
557 fCurrJobRunList.Add(file_no);
560 if ((fCurrJobRunList.GetNValues() == GetRunsPerJob()) || (remaining_runs == 0)) {
564 fCurrJobRunList.Clear();
565 cur_file_list.
Clear();
609 nl.
SetValue(
"JobTime", fDefJobTime);
610 nl.
SetValue(
"JobMemory", fDefJobMem);
611 nl.
SetValue(
"JobDisk", fDefJobDisk);
612 nl.
SetValue(
"MultiJobsMode", MultiJobsMode());
613 nl.
SetValue(
"RunsPerJob", fRunsPerJob);
635 if (nl.
GetBoolValue(
"EMailOnStart")) SetSendMailOnJobStart();
636 if (nl.
GetBoolValue(
"EMailOnEnd")) SetSendMailOnJobEnd();
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
char * Form(const char *fmt,...)
R__EXTERN TSystem * gSystem
void SetSubmitted(KVDatime &m)
virtual void UpdateDiskUsedEventsRead()
const Char_t * GetStatus() const
void SetMemUsed(const Char_t *m)
void SetMemMax(const Char_t *m)
void SetCPUusage(Int_t m)
void SetDiskMax(const Char_t *m)
void SetStatus(const Char_t *s)
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
Extension of TDatime to handle various useful date formats.
Job handled by Grid Engine batch system at CC-IN2P3.
void SetResources(TString r)
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
TString GetTStringValue(const Char_t *name) const
Strings used to represent a set of ranges of values.
virtual void Add(TObject *obj)
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 KVList * GetListOfJobs()
virtual void GetBatchSystemParameterList(KVNameValueList &)
void SetSendMailOnJobEnd()
add option to send mail when job ends
const Char_t * GetJobTime(void) const
returns the parameter string corresponding to the job CPU time
void PrintJobs(Option_t *opt="")
Print list of owner's jobs.
void SetJobMemory(const Char_t *h="")
void SetJobDisk(const Char_t *h="")
virtual void WriteBatchEnvFile(TEnv *)
virtual void SanitizeJobName() const
virtual void Print(Option_t *="") const
virtual Bool_t CheckJobParameters()
Checks the job and asks for any missing parameters.
void SetSendMailAddress(const char *)
set email address for notifications
const Char_t * GetJobDisk(void) const
returns the parameter string corresponding to the job Disk
virtual void Clear(Option_t *opt="")
Clear previously set parameters in order to create a new job submission command.
void ChooseJobMemory(void)
void SetJobTime(const Char_t *h="")
const Char_t * GetJobMemory(void) const
returns the parameter string corresponding to the job Memory
virtual void ChangeDefJobOpt(KVDataAnalyser *)
void SetSendMailOnJobStart()
add option to send mail when job starts
virtual void SetBatchSystemParameters(const KVNameValueList &)
Use the parameters in the list to set all relevant parameters for batch system.
virtual void ReadBatchEnvFile(TEnv *)
virtual void ls(Option_t *option="") const
virtual Int_t GetEntries() 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
virtual void SetName(const char *name)
std::istream & ReadToDelim(std::istream &str, char delim='\n')
TObjArray * Tokenize(const TString &delim) const
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
const char * Data() const
TString & Prepend(char c, Ssiz_t rep=1)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
TString & ReplaceAll(const char *s1, const char *s2)
virtual TString GetFromPipe(const char *command)
virtual const char * WorkingDirectory()
const long double g
masses
UInt_t GetListOfJobs(TFile *file, TList &jobdirs)