8 TB.
checkFile(gSystem->Getenv(
"CWB_ROOTLOGON_FILE"));
9 TB.
checkFile(gSystem->Getenv(
"CWB_PARAMETERS_FILE"));
10 TB.
checkFile(gSystem->Getenv(
"CWB_UPARAMETERS_FILE"));
14 cout <<
"cwb_condor_recovery.C : Error - the accounting_group is not defined !!!" << endl;
15 cout <<
"The accounting_group must be defined in the user_parameters.C file" << endl;
16 cout <<
"See the following link:" << endl;
17 cout <<
" https://ldas-gridmon.ligo.caltech.edu/accounting/condor_groups/determine_condor_account_group.html" << endl;
18 cout <<
"Examples : " << endl;
19 cout <<
"strcpy(condor_tag,\"ligo.dev.o2.burst.allsky.cwboffline\");" << endl;
20 cout <<
"strcpy(condor_tag,\"ligo.prod.o2.burst.allsky.cwboffline\");" << endl;
21 cout <<
"If you don't need it set : strcpy(condor_tag,\"disabled\");" << endl << endl;
27 if(gSystem->Getenv(
"CWB_UPARAMETERS_FILE")==NULL) {
28 cout <<
"Error : environment CWB_UPARAMETERS_FILE is not defined!!!" << endl;
exit(1);
30 cwb_uparameters_file=
TString(gSystem->Getenv(
"CWB_UPARAMETERS_FILE"));
35 if(gSystem->Getenv(
"CWB_STAGE_NAME")!=NULL) {
36 cwb_stage_name=
TString(gSystem->Getenv(
"CWB_STAGE_NAME"));
38 if(cwb_stage_name==
"CWB_STAGE_FULL") cwb_stage_name=
"CWB_STAGE_LIKELIHOOD";
42 if(cwb_stage_name==
"CWB_STAGE_FULL") {cwb_stage=
CWB_STAGE_LIKELIHOOD; cwb_resume_label+=
"/supercluster_";}
43 if(cwb_stage_name==
"CWB_STAGE_INIT") {cwb_stage=
CWB_STAGE_INIT; cwb_resume_label+=
"";}
44 if(cwb_stage_name==
"CWB_STAGE_STRAIN") {cwb_stage=
CWB_STAGE_STRAIN; cwb_resume_label+=
"/init_";}
45 if(cwb_stage_name==
"CWB_STAGE_CSTRAIN") {cwb_stage=
CWB_STAGE_CSTRAIN; cwb_resume_label+=
"/strain_";}
46 if(cwb_stage_name==
"CWB_STAGE_COHERENCE") {cwb_stage=
CWB_STAGE_COHERENCE; cwb_resume_label+=
"/cstrain_";}
47 if(cwb_stage_name==
"CWB_STAGE_SUPERCLUSTER") {cwb_stage=
CWB_STAGE_SUPERCLUSTER;cwb_resume_label+=
"/coherence_";}
48 if(cwb_stage_name==
"CWB_STAGE_LIKELIHOOD") {cwb_stage=
CWB_STAGE_LIKELIHOOD; cwb_resume_label+=
"/supercluster_";}
49 if(gSystem->Getenv(
"CWB_STAGE_NAME")!=NULL) {
50 cwb_stage_name=
TString(gSystem->Getenv(
"CWB_STAGE_NAME"));
61 TString exec_cmd = TString::Format(
"%s/cwb_condor.csh create",cwb_scripts.Data());
62 int ret=gSystem->Exec(exec_cmd);
63 if(ret) {cout <<
"Error while executing cwb_condor create !!!" << endl;
exit(1);}
70 for(
int i=0;
i<jobList.size();
i++)
if(jobList[
i]>max_jobs) max_jobs=jobList[
i];
77 for (
int i=0;
i<jobList.size();
i++) jobStage[jobList[
i]-1]=0;
82 for(
int i=0;
i<fileList.size();
i++) {
85 TObjString* srecoveryID = (TObjString*)token->At(token->GetEntries()-1);
86 if(srecoveryID->GetString().IsDigit()) {
87 cout <<
i <<
" " << fileList[
i].Data() << endl;
88 int recoveryID = srecoveryID->GetString().Atoi();
89 if(iversion<recoveryID) iversion=recoveryID;
99 int estat = gSystem->GetPathInfo(dagfile,&
id,&size,&flags,&mt);
104 cout <<
"File \"" << dagfile <<
"\" already exist" << endl;
105 cout <<
"Do you want to overwrite the file ? (y/n) ";
107 cout << endl << endl;
108 }
while ((strcmp(answer,
"y")!=0)&&(strcmp(answer,
"n")!=0));
109 if (strcmp(answer,
"n")==0) {
117 if(gSystem->Getenv(
"CWB_STAGE_RESUME")!=NULL) {
118 cwb_stage_resume=
TString(gSystem->Getenv(
"CWB_STAGE_RESUME"));
123 if(gSystem->Getenv(
"CWB_STAGE_INPUT")!=NULL) {
124 cwb_stage_input=
TString(gSystem->Getenv(
"CWB_STAGE_INPUT"));
139 sprintf(sfactor,
"_%i",ioffset);
144 cout <<
"Starting reading output directory ..." << endl;
148 for(
int n=0;
n<fileList.size();
n++) {
153 if(fileList[n].BeginsWith(cwb_stage_input+
"/init_"))
156 if(fileList[n].BeginsWith(cwb_stage_input+
"/strain_"))
159 if(fileList[n].BeginsWith(cwb_stage_input+
"/cstrain_"))
162 if(fileList[n].BeginsWith(cwb_stage_input+
"/coherence_"))
165 if(fileList[n].BeginsWith(cwb_stage_input+
"/supercluster_"))
168 if(fileList[n].BeginsWith(cwb_stage_input+
"/wave_")&&fileList[n].Contains(job_label))
191 cout <<
"No Jobs to be recovered" << endl;
195 cout <<
"New Recovey File " << endl;
196 cout << dagfile << endl;
205 char full_condor_dir[1024];
212 if (
i%1000==0) cout <<
i <<
"/" << max_jobs << endl;
214 if(cwb_stage_resume==
"TRUE")
if(!
jobFiles[
i].BeginsWith(cwb_resume_label))
continue;
218 sprintf(ostring,
"JOB A%i %s/%s.sub.recovery.%d",jobID,full_condor_dir,
data_label,iversion);
219 out << ostring << endl;
220 sprintf(ostring,
"VARS A%i PID=\"%i\" CWB_UFILE=\"%s\" CWB_STAGE=\"%s\"",
221 jobID,jobID,
jobFiles[
i].Data(),cwb_stage_name.Data());
222 out << ostring << endl;
223 sprintf(ostring,
"RETRY A%i 3000",jobID);
224 out << ostring << endl;
229 sprintf(symlink,
"%s/%d_%s_%s.out",full_condor_out_dir,jobID,
data_label,cwb_stage_name.Data());
232 int estat = gSystem->GetPathInfo(path.Data(),&
id,&
size,&
flags,&
mt);
234 char cmd[1024];
sprintf(cmd,
"rm -f %s",symlink);
238 sprintf(symlink,
"%s/%d_%s_%s.err",full_condor_err_dir,jobID,
data_label,cwb_stage_name.Data());
241 int estat = gSystem->GetPathInfo(symlink,&
id,&size,&flags,&mt);
243 char cmd[1024];
sprintf(cmd,
"rm -f %s",symlink);
251 if(gSystem->Getenv(
"_USE_LSF")!=NULL) {
254 char lsf_label[1024];
255 if(cwb_stage_name==
"CWB_STAGE_FULL") {
262 TString exec_cmd = TString::Format(
"tar -czf %s/%s.tgz %s %s %s %s/*.sh --exclude='*/.svn'",
264 gSystem->Exec(exec_cmd);
265 cout << endl <<
"Created tgz file : " <<
condor_dir<<
"/"<<lsf_label<<
".tgz" << endl;
270 cout << endl <<
"Unfinished Jobs : " << cnt <<
"/" << jobList.size() << endl;
271 cout << endl <<
"Created LSF file : " << lsfFile << endl << endl;
272 cout <<
"To submit LSF recovered jobs, type :" << endl;
273 cout <<
"cwb_lsf submit " << lsfFile << endl << endl;
275 cout << endl <<
"No jobs to be submitted !!!" << endl << endl;
280 if(gSystem->Getenv(
"_USE_PEGASUS")!=NULL) {
287 out <<
"../" <<
input_dir <<
"/" << endl;
288 out <<
"../" <<
macro_dir <<
"/" << endl;
300 TString exec_cmd = TString::Format(
"cd %s;%s/cwb_pegasus_create.sh %s",
302 int ret=gSystem->Exec(exec_cmd);
303 if(ret) {cout <<
"Error while executing cwb_pegasus_create !!!" << endl;
exit(1);}
306 cout <<
"Unfinished Jobs : " << cnt <<
"/" << jobList.size() << endl;
309 cout <<
"To submit pegasus recovered jobs, type :" << endl;
310 cout <<
"cwb_pegasus submit " << dagfile << endl;
313 char extention[1024];
314 sprintf(extention,
"recovery.%d",iversion);
316 full_condor_err_dir,
condor_log, extention, condor_tag);
318 cout <<
"Unfinished Jobs : " << cnt <<
"/" << jobList.size() << endl;
321 cout <<
"To submit condor recovered jobs, type :" << endl;
322 cout <<
"cwb_condor submit " << dagfile << endl;
326 if(gSystem->Getenv(
"_USE_LSF")!=NULL) {
329 if( cwb_stage_input==
"FULL") cwb_stage_label=
"wave_";
330 if( cwb_stage_input==
"INIT") cwb_stage_label=
"init_";
331 if( cwb_stage_input==
"STRAIN") cwb_stage_label=
"strain_";
332 if( cwb_stage_input==
"CSTRAIN") cwb_stage_label=
"cstrain_";
333 if( cwb_stage_input==
"COHERENCE") cwb_stage_label=
"coherence_";
334 if( cwb_stage_input==
"SUPERCLUSTER") cwb_stage_label=
"supercluster_";
335 if( cwb_stage_input==
"LIKELIHOOD") cwb_stage_label=
"wave_";
337 TString exec_cmd =TString::Format(
"export file_n_st=""$(ls %s*_job%i.root)""",cwb_stage_label.Data(),
jobID);
338 gSystem->Exec(exec_cmd);
339 gSystem->Exec(
"echo $file_n_st");
340 if(gSystem->Getenv(
"file_n_st")!=NULL) {
341 char *file_tmp = gSystem->ExpandPathName(
"output/$file_n_st");
343 exec_cmd = TString::Format(
"tar -czf %s/%s.tgz %s %s %s %s %s %s --exclude='*/.svn' --exclude='%s/*' --exclude='%s/*'",
348 exec_cmd = TString::Format(
"tar -czf %s/%s.tgz %s %s %s %s %s --exclude='*/.svn' --exclude='%s/*' --exclude='%s/*'",
351 gSystem->Exec(exec_cmd);
sprintf(full_condor_dir,"%s/%s", work_dir, condor_dir)
char full_condor_dir[1024]
CWB_STAGE jobStage[max_jobs]
cout<< "Starting reading output directory ..."<< endl;vector< TString > fileList
double fabs(const Complex &x)
strcpy(RunLabel, RUN_LABEL)
cout<< "Starting reading output directory ..."<< endl;vector< TString > jobFiles(max_jobs)
char full_condor_out_dir[512]
char full_condor_err_dir[512]