KaliVeda
Toolkit for HIC analysis
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"
7 using namespace std;
8 
10 
11 
12 
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 ls(Option_t *="") const
Definition: KVBatchJob.cpp:40
virtual void UpdateDiskUsedEventsRead()
Definition: KVBatchJob.cpp:53
virtual ~KVBatchJob()
Destructor.
Definition: KVBatchJob.cpp:31
virtual const char * GetValue(const char *name, const char *dflt) const
Bool_t Defined(const char *name) const
ClassImp(TPyArg)