KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
KVBatchJob.cpp
1//Created by KVClassFactory on Wed Apr 3 14:15:11 2013
2//Author: John Frankland,,,
3
4#include "KVBatchJob.h"
5#include "TEnv.h"
6#include "Riostream.h"
7using namespace std;
8
10
11
12
14
16{
17 // Default constructor
18 cpu_used = 0;
19 mem_used = "-";
20 cpu_max = 0;
21 events_total = 0;
22 events_read = 0;
23}
24
25
26
27
30
32{
33 // Destructor
34}
35
36
37
39
41{
42 cout << GetJobID() << " " << GetName() << " " << GetStatus() << " " << GetSubmitted().AsSQLString();
43 if (!strcmp(GetStatus(), "r")) cout << " " << GetCPUusage() << " " << GetMemUsed();
44 cout << endl;
45}
46
47
48
52
54{
55 // We look for a TEnv file in the user's $HOME directory
56 // with the name [jobname].status
57 TEnv stats(Form("%s.status", GetName()));
58 if (!stats.Defined("TotalEvents")) {
59 // file does not exist: job not running yet
60 return;
61 }
62 SetEventsTotal(stats.GetValue("TotalEvents", 0));
63 SetEventsRead(stats.GetValue("EventsRead", 0));
64 SetDiskUsed(stats.GetValue("DiskUsed", ""));
65}
66
67
const char Option_t
char * Form(const char *fmt,...)
Handles jobs submitted to batch system.
Definition KVBatchJob.h:16
void SetEventsRead(Int_t c)
Definition KVBatchJob.h:112
void ls(Option_t *="") const
const KVDatime & GetSubmitted() const
Definition KVBatchJob.h:40
virtual Int_t GetCPUusage() const
Definition KVBatchJob.h:60
void SetEventsTotal(Int_t c)
Definition KVBatchJob.h:104
virtual void UpdateDiskUsedEventsRead()
Int_t GetJobID() const
Definition KVBatchJob.h:48
virtual ~KVBatchJob()
Destructor.
const Char_t * GetStatus() const
Definition KVBatchJob.h:32
void SetDiskUsed(const Char_t *m)
Definition KVBatchJob.h:96
const Char_t * GetMemUsed() const
Definition KVBatchJob.h:68
const char * AsSQLString() const
virtual const char * GetValue(const char *name, const char *dflt) const
Bool_t Defined(const char *name) const
const char * GetName() const override
ClassImp(TPyArg)