4#include "KV_CCIN2P3_GE.h"
8#include "KVDataAnalyser.h"
9#include "KVDataAnalysisTask.h"
10#include "KVGEBatchJob.h"
11#include "KVDataRepository.h"
12#include "KVDataSetAnalyser.h"
13#include "KVSimDirAnalyser.h"
30 fDefJobTime =
gEnv->
GetValue(
"GE.BatchSystem.DefaultJobTime",
"5:00");
31 fDefJobMem =
gEnv->
GetValue(
"GE.BatchSystem.DefaultJobMemory",
"2G");
32 fDefJobDisk =
gEnv->
GetValue(
"GE.BatchSystem.DefaultJobDisk",
"50M");
33 fTimeSet = fDiskSet = fMemSet =
kFALSE;
35 SetRunsPerJob(
gEnv->
GetValue(
"GE.BatchSystem.RunsPerJob", 1));
157 cout <<
"Enter max CPU time per job (ss/mn:ss/hh:mn:ss) ["
176 cout <<
"Enter max memory per job (xKB/xMB/xGB) ["
190 cout <<
"Enter max scratch disk per job (xKB/xMB/xGB) ["
249 env->
SetValue(
"SimDirAnalyser.CopyFilesToWorkingDirectory",
true);
282 if (!strcmp(
option,
"log")) {
284 cout <<
"* DISK_REQ: " <<
GetJobDisk() <<
" *" << endl;
285 cout <<
"* MEM_REQ: " <<
GetJobMemory() <<
" *" << endl;
332 if ((NeedToAddSPS || repIsSPS)) {
333 oldoptions +=
" -l sps=1";
335 Info(
"ChangeDefJobOpt",
336 "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.");
380 for (
Int_t line_number = 0; line_number < nlines; line_number++) {
382 if (thisLine.
Contains(
"Full jobname:")) {
391 Int_t dd, MM, yyyy, hh, mm, ss;
392 sscanf(sdate.
Data(),
"%d/%d/%d", &MM, &dd, &yyyy);
393 sscanf(stime.
Data(),
"%d:%d:%d", &hh, &mm, &ss);
394 KVDatime submitted(yyyy, MM, dd, hh, mm, ss);
405 list_of_jobs->
Add(job);
410 if (!list_of_jobs->
GetEntries())
return list_of_jobs;
413 TIter next_job(list_of_jobs);
424 for (
Int_t line_number = 0; line_number < nlines; line_number++) {
429 Int_t dd, hh, mm, ss;
432 if (tmp->
GetEntries() == 4) sscanf(stime.
Data(),
"%d:%2d:%2d:%2d", &dd, &hh, &mm, &ss);
433 else sscanf(stime.
Data(),
"%2d:%2d:%2d", &hh, &mm, &ss);
435 job->
SetCPUusage((dd * 24 + hh) * 3600 + mm * 60 + ss);
440 else if (thisLine.
BeginsWith(
"hard resource_list:")) {
448 TIter next_res(bbits);
452 if (
g.BeginsWith(
"ct=")) {
456 else if (
g.BeginsWith(
"vmem=")) {
460 else if (
g.BeginsWith(
"fsize=")) {
532 while (remaining_runs && !runs.
End()) {
556 while ((of = it())) {
557 cur_file_list.
Add(of);
566 cur_file_list.
Clear();
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t g
char * Form(const char *fmt,...)
R__EXTERN TSystem * gSystem
void SetSubmitted(KVDatime &m)
virtual void UpdateDiskUsedEventsRead()
void SetMemUsed(const Char_t *m)
void SetMemMax(const Char_t *m)
const Char_t * GetStatus() const
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 const Char_t * GetDefaultJobOptions() const
virtual void SetDefaultJobOptions(const Char_t *opt)
KVNameValueList fParList
list of parameters/switches to be passed on job submission command line
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.
KVDataAnalyser * fAnalyser
the analyser object which requests job submission, it has all details on the job
KVString fCurrJobName
name of current job being submitted
virtual void GetBatchSystemParameterList(KVNameValueList &)
virtual void Clear(Option_t *opt="")
KVNumberList fCurrJobRunList
runlist for (multi job mode) job being submitted
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
virtual KVString GetRootDirectoryOfDataToAnalyse() const
Pilots user analysis of experimental data.
void SetFullRunList(const KVNumberList &nl)
const KVNumberList & GetRunList() const
void SetRuns(const KVNumberList &nl, Bool_t check=kTRUE)
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.
const Char_t * AsString(Int_t maxchars=0) const
void SetList(const TString &)
void Add(Int_t)
Add value 'n' to the list.
void Clear(Option_t *="")
Empty number list, reset it to initial state.
virtual void Add(TObject *obj)
Class piloting analyses of simulated data.
void SetFileList(TList *l) override
TList * GetFileList() const
Int_t GetNumberOfFilesToAnalyse() const override
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()
Bool_t fMultiJobs
set to kTRUE if several jobs are to be submitted for the runlist set in fAnalyser
virtual void GetBatchSystemParameterList(KVNameValueList &)
void SetSendMailOnJobEnd()
add option to send mail when job ends
Bool_t MultiJobsMode() const
const Char_t * GetJobTime(void) const
returns the parameter string corresponding to the job CPU time
Int_t fRunsPerJob
number of runs per job submitted in multi job mode (default=1)
void PrintJobs(Option_t *opt="")
Print list of owner's jobs.
void SetJobMemory(const Char_t *h="")
virtual ~KV_CCIN2P3_GE()
Destructor.
KVString fDefJobTime
default job length
void SetJobDisk(const Char_t *h="")
virtual void WriteBatchEnvFile(TEnv *)
virtual void SanitizeJobName() const
virtual void Print(Option_t *="") const
KVString fDefJobDisk
default job disk space (with units, e.g. "1G")
KVString fDefJobMem
default job memory allocation (with units, e.g. "512M")
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="")
Int_t GetRunsPerJob() const
const Char_t * GetJobMemory(void) const
returns the parameter string corresponding to the job Memory
virtual void ChangeDefJobOpt(KVDataAnalyser *)
void SetRunsPerJob(Int_t n)
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 *)
void SetMultiJobsMode(Bool_t on=kTRUE)
void ls(Option_t *option="") const override
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)
void Clear(Option_t *option="") override
void Add(TObject *obj) override
const char * GetName() const override
virtual void SetName(const char *name)
Int_t GetEntries() const override
virtual Bool_t InheritsFrom(const char *classname) const
virtual void Info(const char *method, const char *msgfmt,...) const
std::istream & ReadToDelim(std::istream &str, char delim='\n')
const char * Data() const
TObjArray * Tokenize(const TString &delim) const
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) 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()