Logo Coherent WaveBurst  
Reference Guide
Logo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
my_condor_benchmark.C
Go to the documentation of this file.
1 #include <vector>
2 
3 #define NSTAGE 7
4 
5 void my_condor_benchmark(int start = 6) {
6 
7  TString STAGE[NSTAGE] = {"FULL","INIT","STRAIN","CSTRAIN","COHERENCE","SUPERCLUSTER","LIKELIHOOD"};
8 
10 
11  // TB.checkFile(gSystem->Getenv("CWB_ROOTLOGON_FILE"));
12 // TB.checkFile(gSystem->Getenv("CWB_PARAMETERS_FILE"));
13  // TB.checkFile(gSystem->Getenv("CWB_UPARAMETERS_FILE"));
14  //TB.checkFile(gSystem->Getenv("OUTPUT_DIR"));
16  //TString OUTPUT_DIR=TString(gSystem->Getenv("OUTPUT_DIR"));
18  // char job_label[512];sprintf(job_label,"%s%s",data_label,sfactor);
19 
20  cout << "Starting reading output directory ..." << endl;
21  vector<TString> fileList = TB.getFileListFromDir(OUTPUT_DIR,".root","wave_","",true);
22  int nfile = fileList.size();
23  float* jobId = new float[nfile];
24  float* istat = new float[nfile];
25  float* istatc = new float[nfile];
26  float* sstat = new float[nfile];
27  float* sstatc = new float[nfile];
28  float* tstat = new float[nfile];
29  float* prev = new float[nfile];
30  for(int n=0;n<nfile;n++) {jobId[n]=n;istat[n]=0.0;istatc[n]=0.0;sstat[n]=0.0;sstatc[n]=0.0;tstat[n]=0.0;prev[n]=0.0;}
31  /* for(int n=0;n<nfile;n++) {
32  //cout << n << " " << fileList[n].Data()<< endl;
33 
34  if (n%10==0) cout << "cwb_condor benchmark - " << n << "/" << fileList.size() << " files" << endl;
35 
36  vector<float> bench = CWB::Toolbox::getJobBenchmark(fileList[n],jstage,
37  cwb_bench_res,cwb_bench_factor,cwb_bench_name);
38  jobId[n]=bench[0];
39  istat[n]=bench[1];
40  }*/
41  // float b[nfile];
42  // TChain live("liveTime");
43  double liveTot = 0.;
44  double liveZero = 0.;
45 
46  wavearray<double> Trun(500000); Trun = 0.;
51 
52  for(int j=start;j<8;j++){
53  for(int n=0;n<nfile;n++) {
54  TChain live("liveTime");
55  live.Add(fileList[n]);
56  liveTot = TB.getLiveTime(nIFO,live,Trun,Wlag,Wslag,Tlag,Tdlag,-1,-1);
57  liveTot += TB.getLiveTime(nIFO,live,Trun,Wlag,Wslag,Tlag,Tdlag,0,0);
58  vector<float> bench = CWB::Toolbox::getJobBenchmark(fileList[n],j,"JET");
59  jobId[n]=bench[0];
60  istat[n]=bench[1]-prev[n];
61  istatc[n]=bench[1];
62  tstat[n]=liveTot;
63  sstat[n]=liveTot/(bench[1]-prev[n]);
64  sstatc[n]=liveTot/bench[1];
65  // b[n]=bench[1];
66  if ((n<200)||(n%1000==0)) {cout<<n<<" : Jobid: "<<bench[0] <<" Stageid: "<<j<< " JET = "<<istat[n]/3600. <<" (Cumulative: "<<bench[1]/3600.<<") Live: "<<liveTot/3600. << " Speed: "<<sstat[n]<<" (Cumulative: "<<sstatc[n]<<")"<< endl;}
67  liveTot = 0.0;
68  Trun = 0.;
69  prev[n] = bench[1];
70  live.Clear();
71  }
72 
73  cout<<"Njobs: "<< n <<" Average JET @stageid"<<j<< " = "<<TMath::Mean(nfile,istat)/3600.<<" +/- "<<TMath::RMS(nfile,istat)/3600.<< " [hr] Average Livetime = "<<TMath::Mean(nfile,tstat)/3600<<" +/- "<<TMath::RMS(nfile,tstat)/3600<<" [hr] Average Throughput = "<<TMath::Mean(nfile,sstat)<<" +/- "<<TMath::RMS(nfile,sstat)<<endl;
74  }
75  cout<<"Njobs: "<< n <<" Average Cumulative JET @stageid"<<j<< " = "<<TMath::Mean(nfile,istatc)/3600.<<" +/- "<<TMath::RMS(nfile,istatc)/3600.<< " [hr] Average Livetime = "<<TMath::Mean(nfile,tstat)/3600<<" +/- "<<TMath::RMS(nfile,tstat)/3600<<" [hr] Average Cumulative Throughput = "<<TMath::Mean(nfile,sstatc)<<" +/- "<<TMath::RMS(nfile,sstatc)<<endl;
76 
77 
78 
79 }
static vector< TString > getFileListFromDir(TString dir_name, TString endString="", TString beginString="", TString containString="", bool fast=false)
Definition: Toolbox.cc:4333
TString live
wavearray< double > Trun(500000)
int n
Definition: cwb_net.C:10
TString("c")
#define OUTPUT_DIR
static double getLiveTime(vector< waveSegment > &jobList, vector< waveSegment > &dqList)
Definition: Toolbox.cc:2074
int j
Definition: cwb_net.C:10
static bool checkFile(TString fName, bool question=false, TString message="")
Definition: Toolbox.cc:3956
CWB::Toolbox TB
Definition: ComputeSNR.C:5
static vector< float > getJobBenchmark(TString ifName, int stageID, TString bench)
Definition: Toolbox.cc:1425
#define nIFO
wavearray< double > Tlag
double liveTot
wavearray< double > Tdlag
double liveZero
cout<< "Starting reading output directory ..."<< endl;vector< TString > fileList
#define NSTAGE
wavearray< double > Wlag[NIFO_MAX+1]
int jobId
void my_condor_benchmark(int start=6)
char output_dir[512]
Definition: test_config1.C:146
wavearray< double > Wslag[NIFO_MAX+1]