Logo coherent WaveBurst  
Library Reference Guide
Logo
cwb_report_loudest.C
Go to the documentation of this file.
1 /*
2 # Copyright (C) 2019 Gabriele Vedovato
3 #
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17 
18 
19 // produce condor dag file of loudest event list : used by the cwb_condor command
20 
21 {
22  #include <vector>
23 
25 
26  TB.checkFile(gSystem->Getenv("CWB_ROOTLOGON_FILE"));
27  TB.checkFile(gSystem->Getenv("CWB_PARAMETERS_FILE"));
28  TB.checkFile(gSystem->Getenv("CWB_UPARAMETERS_FILE"));
29  TB.checkFile(gSystem->Getenv("CWB_PPARAMETERS_FILE"));
30  TB.checkFile(gSystem->Getenv("CWB_UPPARAMETERS_FILE"));
31  TB.checkFile(gSystem->Getenv("CWB_EPPARAMETERS_FILE"));
32 
33  if(simulation) {
34  cout << endl << "cwb_report_loudest.C : Error - "
35  << "this command can not be used in simulation mode !!!" << endl << endl;
36  exit(1);
37  }
38 
39  if(TString(condor_tag)=="") {
40  cout << endl;
41  cout << "cwb_condor_loudest.C : Error - the accounting_group is not defined !!!" << endl;
42  cout << "The accounting_group must be defined in the user_parameters.C file" << endl;
43  cout << "See the following link:" << endl;
44  cout <<" https://ldas-gridmon.ligo.caltech.edu/accounting/condor_groups/determine_condor_account_group.html" << endl;
45  cout << "Examples : " << endl;
46  cout << "strcpy(condor_tag,\"ligo.dev.o2.burst.allsky.cwboffline\");" << endl;
47  cout << "strcpy(condor_tag,\"ligo.prod.o2.burst.allsky.cwboffline\");" << endl;
48  cout << "If you don't need it set : strcpy(condor_tag,\"disabled\");" << endl << endl;
49  exit(1);
50  }
51  if(TString(condor_tag)=="disabled") strcpy(condor_tag,"");
52 
54  if(gSystem->Getenv("CWB_UPARAMETERS_FILE")==NULL) {
55  cout << "Error : environment CWB_UPARAMETERS_FILE is not defined!!!" << endl;exit(1);
56  } else {
57  cwb_uparameters_file=TString(gSystem->Getenv("CWB_UPARAMETERS_FILE"));
58  }
59 
60  TString cwb_stage_name="CWB_STAGE_LIKELIHOOD";
62 
63  // extract options
64  float cwb_loudest_rho = 0;
73  TString cwb_report_options = TString(gSystem->Getenv("CWB_REPORT_OPTIONS"));
74  if(cwb_report_options!="") {
75  TString option="";
76  // get the stage
77  option = TB.getParameter(cwb_report_options,"--stage");
78  if(option!="") {
79  option.ToUpper();
80  if(option=="FULL") cwb_loudest_stage = option;
81  }
82  // get the loudest output dir
83  option = TB.getParameter(cwb_report_options,"--odir");
84  if(option!="") cwb_loudest_odir = option;
85  // get the min id number of the loudest events to be processed
86  option = TB.getParameter(cwb_report_options,"--idmin");
87  if(option!="") {
88  if(option.IsDigit()) cwb_loudest_idmin = option.Atoi();
89  else { cout << endl << "cwb_report_loudest.C : Error - "
90  << "the option --idmin value is not a number !!!"
91  << endl << endl; exit(1);}
92  }
93  // get the max id number of the loudest events to be processed
94  // if not defined then idmax=idmin
95  option = TB.getParameter(cwb_report_options,"--idmax");
96  if(option!="") {
97  if(option.IsDigit()) cwb_loudest_idmax = option.Atoi();
98  else { cout << endl << "cwb_report_loudest.C : Error - "
99  << "the option --idmax value is not a number !!!"
100  << endl << endl; exit(1);}
101  } else cwb_loudest_idmax=cwb_loudest_idmin;
102  if(cwb_loudest_idmax<cwb_loudest_idmin) {
103  cout << endl << "cwb_report_loudest.C : Error - "
104  << "the option --idmax value is < of --idmin value !!!" << endl << endl;
105  exit(1);
106  }
107  // get number of loudest events to be processed
108  option = TB.getParameter(cwb_report_options,"--nevt");
109  if(option!="") {
110  if(option.IsDigit()) cwb_loudest_nevt = option.Atoi();
111  else { cout << endl << "cwb_report_loudest.C : Error - "
112  << "the option --nevt value is not a number !!!"
113  << endl << endl; exit(1);}
114  }
115  if(cwb_loudest_nevt==0) cwb_loudest_nevt=100000;
116  // get the user parameters file option
117  option = TB.getParameter(cwb_report_options,"--ufile");
118  if(option!="") cwb_loudest_ufile = option;
119  // get the veto option
120  option = TB.getParameter(cwb_report_options,"--veto");
121  if(option!="") cwb_loudest_veto = option;
122  cwb_loudest_veto.ToUpper();
123  // get the ced option
124  option = TB.getParameter(cwb_report_options,"--ced");
125  if(option!="") cwb_loudest_ced = option;
126  cwb_loudest_ced.ToUpper();
127  // get the rho threshold option
128  option = TB.getParameter(cwb_report_options,"--rho");
129  if(option!="") {
130  if(option.IsFloat()) cwb_loudest_rho = option.Atof();
131  else { cout << endl << "cwb_report_loudest.C : Error - "
132  << "the option --rho value is not a number !!!"
133  << endl << endl; exit(1);}
134  }
135  }
136 
137  // creates dir for loudest events
139  CWB::Toolbox::mkDir(pp_loudest_dir,!pp_batch);
140 
141  // read condor job list
142  char full_condor_dir[1024];
143  sprintf(full_condor_dir,"%s/%s",work_dir,condor_dir);
144  vector<int> jobList=TB.getCondorJobList(full_condor_dir, data_label);
145  int max_jobs = 0;
146  for(int i=0;i<jobList.size();i++) if(jobList[i]>max_jobs) max_jobs=jobList[i];
147 
148  // read loudest event list
149  TB.checkFile(netdir);
150  char events_sorted[1024];
151  sprintf(events_sorted,"%s/events_sorted.txt",netdir);
152  CWB::Toolbox::checkFile(events_sorted);
153 
154  char pm[8];
155  char c3[8];
156  float icc, icc2, icc3, irho, iacor, ilag, islag, ilik, ipen, icHH, ivHH, ivED;
157  int ifreq, ilow, ihigh;
158  float idur;
159  int isize, irate, irun;
160  float phi, theta, psi;
161 
162  double* itime = new double[NIFO_MAX];
163  double* iSNR = new double[NIFO_MAX];
164  double* ihrss = new double[NIFO_MAX];
165 
166  vector<int>* lagLoudest = new vector<int>[max_jobs]; // contains the lag list of the loudest events for each job
167 
168  int iline=0; // line counter
169  int ievt=0; // event select counter
170  vector<TString> JTAG;
171  ifstream f_ev(events_sorted);
172  while(ievt<cwb_loudest_nevt) {
173  f_ev>>pm>>c3>>irho>>icc>>icc2>>icc3>>iacor>>ilag>>islag>>ilik;
174  f_ev>>ipen>>icHH>>ifreq>>ilow>>ihigh>>idur>>isize>>irate>>irun;
175  for(int i=0;i<nIFO;i++) f_ev>>itime[i];
176  for(int i=0;i<nIFO;i++) f_ev>>iSNR[i];
177  for(int i=0;i<nIFO;i++) f_ev>>ihrss[i];
178  f_ev>>phi>>theta>>psi;
179  if (!f_ev.good()) break;
180  iline++;
181  if (!TString(pm).Contains("+")) continue;
182  if ((cwb_loudest_veto=="TRUE")&&(strcmp(pm,"+")||strcmp(c3,"-"))) continue;
183  if (cwb_loudest_idmin&&(iline<cwb_loudest_idmin)) continue;
184  if (cwb_loudest_idmax&&(iline>cwb_loudest_idmax)) continue;
185  if (irho<cwb_loudest_rho) continue;
186  ievt++;
187  //cout << irun << " " << 0 << " " << "true" << " " << 0 << " " << ilag << " " << ced_dir << endl;
188  //out << irun << " " << 0 << " " << "true" << " " << 0 << " " << ilag << " " << ced_dir << endl;
189  char jtag[1024];sprintf(jtag,"%i_%i_%i",irun,(int)islag,(int)ilag);
190  bool bjtag=false;for(int j=0;j<JTAG.size();j++) if(JTAG[j]==jtag) bjtag=true;
191  if(!bjtag) JTAG.push_back(jtag); else continue; // skip job if already created
192  if(irun>max_jobs) {
193  cout << endl << "cwb_report_loudest.C : Error - "
194  << "job number is greater than max allowed jobs, check your yours dag and user_parameter.C files" << endl << endl;
195  exit(1);
196  }
197  lagLoudest[irun-1].push_back(ilag);
198  }
199  f_ev.close();
200 
201  delete [] itime;
202  delete [] iSNR;
203  delete [] ihrss;
204 
205  if(ievt==0) {
206  cout << endl << "cwb_report_loudest.C : Warning - "
207  << "no events has been selected !!!" << endl << endl;
208  exit(1);
209  }
210 
211  // check stages of output root files
212  int* jobStart = new int[max_jobs];
213  int* jobStop = new int[max_jobs];
214 
216  for (int i=0;i<max_jobs;i++) jobStage[i]=(CWB_STAGE)-1; // excluded jobs
217  for (int i=0;i<jobList.size();i++) jobStage[jobList[i]-1]=(CWB_STAGE)0; // jobs in the dag file
218 
219  char tag[1024];sprintf(tag,"%s.dag.loudest.",data_label);
220  vector<TString> fileList = TB.getFileListFromDir(condor_dir, "", tag);
221  int iversion=0;
222  for(int i=0;i<fileList.size();i++) {
223  //cout << i << " " << fileList[i].Data() << endl;
224  TObjArray* token = TString(fileList[i]).Tokenize(TString("."));
225  TObjString* sloudestID = (TObjString*)token->At(token->GetEntries()-1);
226  if(sloudestID->GetString().IsDigit()) {
227  cout << i << " " << fileList[i].Data() << endl;
228  int loudestID = sloudestID->GetString().Atoi();
229  if(iversion<loudestID) iversion=loudestID;
230  }
231  }
232  iversion++;
233 
234  char ofile[1024];
235  sprintf(ofile,"%s/%s.dag.loudest.%d",condor_dir,data_label,iversion);
236 
237  // Check if file exist
238  Long_t id,size,flags,mt;
239  int estat = gSystem->GetPathInfo(ofile,&id,&size,&flags,&mt);
240  if (estat==0) {
241  char answer[1024];
242  strcpy(answer,"");
243  do {
244  cout << "File \"" << ofile << "\" already exist" << endl;
245  cout << "Do you want to overwrite the file ? (y/n) ";
246  cin >> answer;
247  cout << endl << endl;
248  } while ((strcmp(answer,"y")!=0)&&(strcmp(answer,"n")!=0));
249  if (strcmp(answer,"n")==0) {
250  exit(0);
251  }
252  }
253 
254  // get cwb stage input dir (input files produced by the previous stage)
256  if(gSystem->Getenv("CWB_STAGE_INPUT")!=NULL) {
257  cwb_stage_input=TString(gSystem->Getenv("CWB_STAGE_INPUT"));
258  }
259  if(cwb_stage_input=="") cwb_stage_input=output_dir;
260  TB.checkFile(cwb_stage_input);
261 
262  char job_label[1024];sprintf(job_label,"%s",data_label);
263 
264  cout << "Starting reading output directory ..." << endl;
265  vector<TString> jobFiles(max_jobs);
266  for(int i=0;i<max_jobs;i++) jobFiles[i]=cwb_uparameters_file;
267  vector<TString> fileList2 = TB.getFileListFromDir(cwb_stage_input,".root","",data_label,true);
268  if(cwb_loudest_stage=="AUTO") for(int n=0;n<fileList2.size();n++) {
269 
270  int jobId = TB.getJobId(fileList2[n]); // Get JOB ID
271  jobId-=1;
272 
273  if(fileList2[n].BeginsWith(cwb_stage_input+"/init_"))
274  if(CWB_STAGE_INIT>jobStage[jobId])
275  {jobStage[jobId]=CWB_STAGE_INIT;jobFiles[jobId]=fileList2[n];continue;}
276  if(fileList2[n].BeginsWith(cwb_stage_input+"/strain_"))
277  if(CWB_STAGE_STRAIN>jobStage[jobId])
278  {jobStage[jobId]=CWB_STAGE_STRAIN;jobFiles[jobId]=fileList2[n];continue;}
279  if(fileList2[n].BeginsWith(cwb_stage_input+"/cstrain_"))
280  if(CWB_STAGE_CSTRAIN>jobStage[jobId])
281  {jobStage[jobId]=CWB_STAGE_CSTRAIN;jobFiles[jobId]=fileList2[n];continue;}
282  if(fileList2[n].BeginsWith(cwb_stage_input+"/coherence_"))
283  if(CWB_STAGE_COHERENCE>jobStage[jobId])
284  {jobStage[jobId]=CWB_STAGE_COHERENCE;jobFiles[jobId]=fileList2[n];continue;}
285  if(fileList2[n].BeginsWith(cwb_stage_input+"/supercluster_"))
286  if(CWB_STAGE_SUPERCLUSTER>jobStage[jobId])
287  {jobStage[jobId]=CWB_STAGE_SUPERCLUSTER;jobFiles[jobId]=fileList2[n];continue;}
288  }
289  //for (int i=0;i<max_jobs;i++) cout << i << " " << jobStage[i] << " " << jobFiles[i].Data() << " " << cwb_stage << endl;
290 
291  // if jobFile is a configuration file and user has provided an auxiliary config file
292  // then jobFile is initialized with the auxiliary config file
293  for(int i=0;i<max_jobs;i++) {
294  if(jobFiles[i]==cwb_uparameters_file) {
295  if(cwb_loudest_ufile!=cwb_uparameters_file) {
297  }
298  }
299  }
300 
301  int nloudest=0;
302  for (int i=0;i<max_jobs;i++) nloudest+=lagLoudest[i].size();
303  if(nloudest==0) {
304  cout << "No loudest events to be processed !!!" << endl;
305  gSystem->Exit(0);
306  }
307  cout << endl;
308  cout << "New Loudest File " << endl;
309  cout << ofile << endl;
310 
311  // condor log dirs
312  char full_condor_out_dir[1024];
313  char full_condor_err_dir[1024];
314  sprintf(full_condor_out_dir,"%s/%s",work_dir,log_dir);
315  sprintf(full_condor_err_dir,"%s/%s",work_dir,log_dir);
316 
317  // create dag condor file
318  char full_condor_dir2[1024];
319  sprintf(full_condor_dir2,"%s/%s",work_dir,condor_dir);
320 
321  ofstream out;
322  out.open(ofile,ios::out);
323  int jID = 0;
324  for (int i=0;i<max_jobs;i++) {
325  for (int j=0;j<lagLoudest[i].size();j++) {
326  jID++;
327  char ostring[1024];
328  int jobID=i+1;
329  char jtag[1024];sprintf(jtag,"%i_%i",jobID,lagLoudest[i][j]);
330  sprintf(ostring,"JOB A%i_%s %s/%s.sub.loudest.%d",jID,jtag,full_condor_dir2,data_label,iversion);
331  out << ostring << endl;
332  sprintf(ostring,"VARS A%i_%s PID=\"%i\" CWB_UFILE=\"%s\" CWB_STAGE=\"%s\" ",
333  jID,jtag,jobID,jobFiles[i].Data(),cwb_stage_name.Data());
334  out << ostring;
335  sprintf(ostring,"CWB_MDC_FACTOR=\"0\" CWB_JOB_LAG=\"%i\" CWB_CED_DIR=\"%s\" ",
336  lagLoudest[i][j],pp_loudest_dir.Data());
337  out << ostring;
338  sprintf(ostring,"CWB_INET_OPTIONS=\"%s\" CWB_UPARAMETERS_FILE=\"%s\" CWB_BATCH=\"true\"",
339  cwb_loudest_ced.Data(),cwb_loudest_ufile.Data());
340  out << ostring << endl;
341  sprintf(ostring,"RETRY A%i_%s 3000",jID,jtag);
342  out << ostring << endl;
343  // remove broken symbolic links of condor log files (avoid init condor failure)
344 /* COMMENTED BECAUSE TAKES TIME
345  TString path;
346  char symlink[1024];
347  Long_t id,size,flags,mt;
348  sprintf(symlink,"%s/%d_%s_%s.out",full_condor_out_dir,jobID,data_label,cwb_stage_name.Data());
349  path = CWB::Toolbox::getFileName(symlink);
350  if(path!="") {
351  int estat = gSystem->GetPathInfo(path.Data(),&id,&size,&flags,&mt);
352  if(estat!=0) { // condor log out symbolic link is broken
353  char cmd[1024]; sprintf(cmd,"rm -f %s",symlink);
354  gSystem->Exec(cmd);
355  }
356  }
357  sprintf(symlink,"%s/%d_%s_%s.err",full_condor_err_dir,jobID,data_label,cwb_stage_name.Data());
358  path = CWB::Toolbox::getFileName(symlink);
359  if(path!="") {
360  int estat = gSystem->GetPathInfo(symlink,&id,&size,&flags,&mt);
361  if(estat!=0) { // condor log err symbolic link is broken
362  char cmd[1024]; sprintf(cmd,"rm -f %s",symlink);
363  gSystem->Exec(cmd);
364  }
365  }
366 */
367  }
368  }
369  out.close();
370 
371  // check if loudest.sh script is present in the condor directory
372  // if not the condor_dir/loudest.sh is linked to $CWB_SCRIPTS/cwb_loudest.sh
373  TString cwb_scripts = TString(gSystem->Getenv("CWB_SCRIPTS"));
374  estat = gSystem->GetPathInfo(TString(condor_dir)+"/loudest.sh",&id,&size,&flags,&mt);
375  if (estat!=0) { // file not found
376  char cmd[1024];
377  sprintf(cmd,"ln -sf %s/cwb_loudest.sh %s/loudest.sh",cwb_scripts.Data(),condor_dir);
378  cout << cmd << endl;
379  gSystem->Exec(cmd);
380  }
381 
382  // create sub condor file
383  char ofile_condor_sub[1024];
384  sprintf(ofile_condor_sub,"%s/%s.sub.loudest.%d",full_condor_dir2,data_label,iversion);
385 
386  FILE *fP=NULL;
387  if((fP = fopen(ofile_condor_sub, "w")) == NULL) {
388  cout << "cwb_report_loudest.C : Error - cannot open file " << ofile_condor_sub << endl;
389  exit(1);
390  }
391  cout << ofile_condor_sub << endl;
392 
393  fprintf(fP,"universe = vanilla\n");
394  fprintf(fP,"getenv = true\n");
395  fprintf(fP,"priority = $(PRI)\n");
396  fprintf(fP,"on_exit_hold = ( ExitCode != 0 )\n");
397  fprintf(fP,"request_memory = 2000\n");
398  fprintf(fP,"executable = loudest.sh\n");
399  fprintf(fP,"job_machine_attrs = Machine\n");
400  fprintf(fP,"job_machine_attrs_history_length = 5\n");
401  fprintf(fP,"requirements = target.machine =!= MachineAttrMachine1 && target.machine =!= MachineAttrMachine2 && target.machine =!= MachineAttrMachine3 && target.machine =!= MachineAttrMachine4 && target.machine =!= MachineAttrMachine5\n");
402  fprintf(fP,"environment = CWB_JOBID=$(PID);CWB_UFILE=$(CWB_UFILE);CWB_STAGE=$(CWB_STAGE);CWB_MDC_FACTOR=$(CWB_MDC_FACTOR);CWB_JOB_LAG=$(CWB_JOB_LAG);CWB_CED_DIR=$(CWB_CED_DIR);CWB_INET_OPTIONS=$(CWB_INET_OPTIONS);CWB_UPARAMETERS_FILE=$(CWB_UPARAMETERS_FILE);CWB_BATCH=$(CWB_BATCH)\n");
403  if(TString(condor_tag)!="") fprintf(fP,"accounting_group = %s\n",condor_tag);
404  fprintf(fP,"output = %s/$(PID)_$(CWB_JOB_LAG)_%s_%s.out\n",full_condor_out_dir,data_label,cwb_loudest_odir.Data());
405  fprintf(fP,"error = %s/$(PID)_$(CWB_JOB_LAG)_%s_%s.err\n",full_condor_err_dir,data_label,cwb_loudest_odir.Data());
406  fprintf(fP,"log = %s/%s_%s.log\n",condor_log,data_label,cwb_loudest_odir.Data());
407  fprintf(fP,"notification = never\n");
408  fprintf(fP,"rank=memory\n");
409  fprintf(fP,"queue\n");
410  fclose(fP);
411 
412 
413  cout << "Number of Jobs : " << jID << "/" << jobList.size() << endl;
414  cout << endl;
415  cout << "To submit condor recovered jobs type :" << endl;
416  sprintf(ofile,"%s/%s.dag.loudest.%d",condor_dir,data_label,iversion);
417  cout << "cwb_condor submit " << ofile << endl;
418  cout << endl;
419 
420  delete [] lagLoudest;
421  delete [] jobStart;
422  delete [] jobStop;
423  delete [] jobStage;
424 
425  gSystem->Exit(0);
426 }
TString cwb_scripts
static vector< TString > getFileListFromDir(TString dir_name, TString endString="", TString beginString="", TString containString="", bool fast=false)
Definition: Toolbox.cc:5108
Long_t id
int estat
int ihigh
int cwb_loudest_idmax
int irate
TString pp_loudest_dir
cout<< "slagList size : "<< slagList.size()<< endl;cout<< endl<< "Start segments selection from dq cat1 list ..."<< endl<< endl;rslagList=TB.getSlagList(slagList, ifos, segLen, segMLS, segEdge, nDQF, DQF, CWB_CAT1);cout<< "Number of selected jobs after cat1 : "<< rslagList.size()<< endl;cout<< endl<< "Start segments selection from dq cat2 list ..."<< endl<< endl;rslagList=TB.getSlagList(rslagList, ifos, segLen, segTHR, segEdge, nDQF, DQF, CWB_CAT2);cout<< "Number of selected jobs after cat2 : "<< rslagList.size()<< endl;vector< TString > jobFiles
int n
Definition: cwb_net.C:28
TString("c")
TString cwb_loudest_veto
ofstream out
Definition: cwb_merge.C:214
delete [] ihrss
float icc3
Long_t mt
float theta
TString cwb_loudest_ced
char full_condor_dir[1024]
CWB::Toolbox TB
delete [] itime
TString cwb_loudest_stage
sprintf(full_condor_dir,"%s/%s", work_dir, condor_dir)
float icc
Long_t size
char ofile[1024]
int j
Definition: cwb_net.C:28
i drho i
delete [] iSNR
static bool checkFile(TString fName, bool question=false, TString message="")
Definition: Toolbox.cc:4670
int isize
int jobID
Definition: cwb_net.C:195
TString cwb_stage_input
float ipen
fprintf(stdout,"start=%f duration=%f rate=%f\, x.start(), x.size()/x.rate(), x.rate())
Long_t flags
int * jobStop
char full_condor_out_dir[1024]
char data_label[512]
Definition: test_config1.C:160
TString cwb_report_options
float phi
float psi
int cwb_loudest_idmin
float islag
char netdir[1024]
const int NIFO_MAX
Definition: wat.hh:22
float ivED
TString cwb_stage_name
char job_label[512]
char events_sorted[256]
CWB_STAGE * jobStage
float cwb_loudest_rho
int ilow
ifstream f_ev(events_sorted)
float ivHH
TObjArray * token
char log_dir[512]
Definition: test_config1.C:151
static int getJobId(TString file, TString fext="root")
Definition: Toolbox.cc:6697
int ifreq
char tag[256]
Definition: cwb_merge.C:92
char full_condor_err_dir[1024]
char ofile_condor_sub[1024]
float icHH
FILE * fP
float irho
TString cwb_loudest_odir
char answer[256]
static vector< int > getCondorJobList(TString condor_dir, TString label)
Definition: Toolbox.cc:1398
static TString getParameter(TString options, TString param="")
Definition: Toolbox.cc:6727
vector< int > jobList
cout<< ofile_condor_sub<< endl;char full_condor_dir[1024];char full_condor_out_dir[1024];char full_condor_err_dir[1024];sprintf(full_condor_dir,"%s/%s", work_dir, condor_dir);sprintf(full_condor_out_dir,"%s/%s", work_dir, log_dir);sprintf(full_condor_err_dir,"%s/%s", work_dir, log_dir);fprintf(fP,"universe = vanilla\");fprintf(fP,"getenv = true\");fprintf(fP,"priority = $(PRI)\");fprintf(fP,"on_exit_hold = ( ExitCode != 0 )\");fprintf(fP,"request_memory = 2000\");fprintf(fP,"executable = ced.sh\");fprintf(fP,"job_machine_attrs = Machine\");fprintf(fP,"job_machine_attrs_history_length = 5\");fprintf(fP,"requirements = target.machine =!= MachineAttrMachine1 && target.machine =!= MachineAttrMachine2 && target.machine =!= MachineAttrMachine3 && target.machine =!= MachineAttrMachine4 && target.machine =!= MachineAttrMachine5\");fprintf(fP,"environment = CWB_JOBID=$(PID);CWB_GPS_EVENT=$(CWB_GPS_EVENT);CWB_INET_OPTIONS=$(CWB_INET_OPTIONS);CWB_MDC_FACTOR=$(CWB_MDC_FACTOR);CWB_JOB_LAG=$(CWB_JOB_LAG);CWB_CED_DIR=$(CWB_CED_DIR);CWB_BATCH=$(CWB_BATCH)\");if(TString(condor_tag)!="") fprintf(fP,"accounting_group = %s\", condor_tag);fprintf(fP,"output = %s/$(PID)_$(CWB_JOB_LAG)_%s.out\", full_condor_out_dir, condor_label);fprintf(fP,"error = %s/$(PID)_$(CWB_JOB_LAG)_%s.err\", full_condor_err_dir, condor_label);fprintf(fP,"log = %s/%s.log\", condor_log, condor_label);fprintf(fP,"notification = never\");fprintf(fP,"rank=memory\");fprintf(fP,"queue\");fclose(fP);char ofile_condor_dag[1024];sprintf(ofile_condor_dag,"%s/%s.dag", condor_dir, condor_label);ofstream out;out.open(ofile_condor_dag, ios::out);if(!out.good()) {cout<< "Error Opening File : "<< ofile_condor_dag<< endl;exit(1);} cout<< ofile_condor_dag<< endl;int ievt=0;vector< TString > JTAG
cout<< "Starting reading output directory ..."<< endl;vector< TString > fileList
float iacor
int irun
char pp_dir[512]
Definition: test_config1.C:155
static void mkDir(TString dir, bool question=false, bool remove=true)
Definition: Toolbox.cc:4714
float idur
char cmd[1024]
strcpy(RunLabel, RUN_LABEL)
float icc2
char condor_log[512]
Definition: test_config1.C:163
int nloudest
int pp_max_nloudest_list
int max_jobs
TString cwb_uparameters_file
int jobId
char condor_dir[512]
Definition: test_config1.C:148
char work_dir[512]
Definition: test_config1.C:143
float ilik
CWB_STAGE cwb_stage
simulation
Definition: cwb_eced.C:26
fclose(ftrig)
char output_dir[512]
Definition: test_config1.C:146
char pm[8]
char c3[8]
int * jobStart
TString cwb_loudest_ufile
float ilag
int cwb_loudest_nevt
CWB_STAGE
Definition: cwb.hh:122
exit(0)