#include <vector>
Functions | |
TB | checkFile (gSystem->Getenv("CWB_ROOTLOGON_FILE")) |
TB | checkFile (gSystem->Getenv("CWB_PARAMETERS_FILE")) |
TB | checkFile (gSystem->Getenv("CWB_UPARAMETERS_FILE")) |
out | close () |
TB | createSubFile (data_label, full_condor_dir, full_condor_out_dir, full_condor_err_dir, condor_log, extention, condor_tag) |
gSystem | Exec ("echo $file_n_st") |
gSystem | Exec (exec_cmd) |
cout<< endl<< "Created tgz file : "<< condor_dir<<"/"<< data_label<<".tgz"<< endl;} } delete [] jobStage;delete [] jobStart;delete [] jobStop;gSystem-> | Exit (0) |
for () | |
cout<< endl;cout<< "New Recovey File "<< endl;cout<< dagfile<< endl;char full_condor_out_dir[1024];char full_condor_err_dir[1024];sprintf(full_condor_out_dir,"%s/%s", work_dir, log_dir);sprintf(full_condor_err_dir,"%s/%s", work_dir, log_dir);sprintf(full_condor_dir,"%s/%s", work_dir, condor_dir);ofstream out;out.open(dagfile, ios::out);int cnt=0;for(int i=0;i< max_jobs;i++) { if(i%1000==0) cout<< i<< "/"<< max_jobs<< endl;if((jobStage[i]!=(CWB_STAGE) -1)&&(jobStage[i]< cwb_stage)&&(jobStage[i]< CWB_STAGE_LIKELIHOOD)) { if(cwb_stage_resume=="TRUE") if(!jobFiles[i].BeginsWith(cwb_resume_label)) continue;cnt++;char ostring[256];int jobID=i+1;sprintf(ostring,"JOB A%i %s/%s.sub.recovery.%d", jobID, full_condor_dir, data_label, iversion);out<< ostring<< endl;sprintf(ostring,"VARS A%i PID=\%i\ CWB_UFILE=\%s\ CWB_STAGE=\%s\", jobID, jobID, jobFiles[i].Data(), cwb_stage_name.Data());out<< ostring<< endl;sprintf(ostring,"RETRY A%i 3000", jobID);out<< ostring<< endl;TString path;char symlink[1024];Long_t id, size, flags, mt;sprintf(symlink,"%s/%d_%s_%s.out", full_condor_out_dir, jobID, data_label, cwb_stage_name.Data());path=CWB::Toolbox::getFileName(symlink);if(path!="") { int estat=gSystem-> | GetPathInfo (path.Data(),&id,&size,&flags,&mt) |
if (TString(condor_tag)=="") | |
if (gSystem->Getenv("CWB_STAGE_NAME")!=NULL) | |
if (cwb_stage_name=="CWB_STAGE_FULL") | |
if (!exists) | |
if (estat==0) | |
if (gSystem->Getenv("CWB_STAGE_RESUME")!=NULL) | |
if (gSystem->Getenv("CWB_STAGE_INPUT")!=NULL) | |
if (cwb_stage_input=="") | |
if (estat!=0) | |
if (path!="") | |
if (gSystem->Getenv("_USE_LSF")!=NULL) | |
if (gSystem->Getenv("_USE_PEGASUS")!=NULL) | |
if (gSystem->Getenv("file_n_st")!=NULL) | |
cout<< "Starting reading output directory ..."<< endl;vector< TString > | jobFiles (max_jobs) |
sprintf (full_condor_dir,"%s/%s", work_dir, condor_dir) | |
sprintf (dagfile,"%s/%s.dag.recovery.%d", condor_dir, data_label, iversion) | |
sprintf (job_label,"%s%s", data_label, sfactor) | |
sprintf (symlink,"%s/%d_%s_%s.err", full_condor_err_dir, jobID, data_label, cwb_stage_name.Data()) | |
sprintf (extention,"recovery.%d", iversion) | |
Variables | |
TString | cwb_stage_input =output_dir |
TString | cwb_stage_name ="CWB_STAGE_FULL" |
TString | cwb_stage_resume ="FALSE" |
char | dagfile [1024] |
else | |
int | estat = gSystem->GetPathInfo(dagfile,&id,&size,&flags,&mt) |
cout<< endl;cout<< "Unfinished Jobs : "<< cnt<< "/"<< jobList.size()<< endl;cout<< endl;sprintf(dagfile,"%s/%s.dag.recovery.%d", condor_dir, data_label, iversion);cout<< "To submit condor recovered jobs, type :"<< endl;cout<< "cwb_condor submit "<< dagfile<< endl;} cout<< endl;if(gSystem->Getenv("_USE_LSF")!=NULL) { TString cwb_stage_label="supercluster_";if(cwb_stage_input=="FULL") cwb_stage_label="wave_";if(cwb_stage_input=="INIT") cwb_stage_label="init_";if(cwb_stage_input=="STRAIN") cwb_stage_label="strain_";if(cwb_stage_input=="CSTRAIN") cwb_stage_label="cstrain_";if(cwb_stage_input=="COHERENCE") cwb_stage_label="coherence_";if(cwb_stage_input=="SUPERCLUSTER") cwb_stage_label="supercluster_";if(cwb_stage_input=="LIKELIHOOD") cwb_stage_label="wave_";int jobID=1;TString exec_cmd=TString::Format("export file_n_st=""$(ls %s*_job%i.root)""", cwb_stage_label.Data(), jobID);gSystem-> | Exec (exec_cmd) |
bool | exists = TB.isFileExisting(TString::Format("%s/%s.dag",full_condor_dir,data_label)) |
Long_t | flags |
char | full_condor_dir [1024] |
Long_t | id |
iversion | |
char | job_label [512] |
vector< int > | jobList =TB.getCondorJobList(full_condor_dir, data_label) |
int | max_jobs = 0 |
Long_t | mt |
int | nrecovery =0 |
path = CWB::Toolbox::getFileName(symlink) | |
Long_t | size |
TB checkFile | ( | gSystem-> | Getenv"CWB_ROOTLOGON_FILE" | ) |
TB checkFile | ( | gSystem-> | Getenv"CWB_PARAMETERS_FILE" | ) |
TB checkFile | ( | gSystem-> | Getenv"CWB_UPARAMETERS_FILE" | ) |
out close | ( | ) |
TB createSubFile | ( | data_label | , |
full_condor_dir | , | ||
full_condor_out_dir | , | ||
full_condor_err_dir | , | ||
condor_log | , | ||
extention | , | ||
condor_tag | |||
) |
gSystem Exec | ( | "echo $file_n_st" | ) |
gSystem Exec | ( | exec_cmd | ) |
cout<< endl << "Created tgz file : " << condor_dir<<"/"<<data_label<<".tgz" << endl; } } delete [] jobStage; delete [] jobStart; delete [] jobStop; gSystem-> Exit | ( | 0 | ) |
for | ( | ) |
Definition at line 88 of file cwb_condor_recovery.C.
cout<< endl; cout << "New Recovey File " << endl; cout << dagfile << endl; char full_condor_out_dir[1024]; char full_condor_err_dir[1024]; sprintf(full_condor_out_dir,"%s/%s",work_dir,log_dir); sprintf(full_condor_err_dir,"%s/%s",work_dir,log_dir); sprintf(full_condor_dir,"%s/%s",work_dir,condor_dir); ofstream out; out.open(dagfile,ios::out); int cnt = 0; for (int i=0;i<max_jobs;i++) { if (i%1000==0) cout << i << "/" << max_jobs << endl; if ((jobStage[i]!=(CWB_STAGE)-1)&&(jobStage[i]<cwb_stage)&&(jobStage[i]<CWB_STAGE_LIKELIHOOD)) { if(cwb_stage_resume=="TRUE") if(!jobFiles[i].BeginsWith(cwb_resume_label)) continue; cnt++; char ostring[256]; int jobID=i+1; sprintf(ostring,"JOB A%i %s/%s.sub.recovery.%d",jobID,full_condor_dir,data_label,iversion); out << ostring << endl; sprintf(ostring,"VARS A%i PID=\"%i\" CWB_UFILE=\"%s\" CWB_STAGE=\"%s\"", jobID,jobID,jobFiles[i].Data(),cwb_stage_name.Data()); out << ostring << endl; sprintf(ostring,"RETRY A%i 3000",jobID); out << ostring << endl; TString path; char symlink[1024]; Long_t id,size,flags,mt; sprintf(symlink,"%s/%d_%s_%s.out",full_condor_out_dir,jobID,data_label,cwb_stage_name.Data()); path = CWB::Toolbox::getFileName(symlink); if(path!="") { int estat = gSystem-> GetPathInfo | ( | path. | Data(), |
& | id, | ||
& | size, | ||
& | flags, | ||
& | mt | ||
) |
if | ( | TString(condor_tag) | = ="" | ) |
Definition at line 30 of file cwb_condor_recovery.C.
if | ( | gSystem->Getenv("CWB_STAGE_NAME")! | = NULL | ) |
Definition at line 53 of file cwb_condor_recovery.C.
if | ( | cwb_stage_name | = ="CWB_STAGE_FULL" | ) |
Definition at line 56 of file cwb_condor_recovery.C.
if | ( | ! | exists | ) |
Definition at line 77 of file cwb_condor_recovery.C.
if | ( | estat | = =0 | ) |
Definition at line 118 of file cwb_condor_recovery.C.
if | ( | gSystem->Getenv("CWB_STAGE_RESUME")! | = NULL | ) |
Definition at line 135 of file cwb_condor_recovery.C.
if | ( | gSystem->Getenv("CWB_STAGE_INPUT")! | = NULL | ) |
Definition at line 141 of file cwb_condor_recovery.C.
if | ( | cwb_stage_input | = ="" | ) |
Definition at line 144 of file cwb_condor_recovery.C.
if | ( | estat! | = 0 | ) |
Definition at line 250 of file cwb_condor_recovery.C.
if | ( | path! | = "" | ) |
Definition at line 257 of file cwb_condor_recovery.C.
if | ( | gSystem->Getenv("_USE_LSF")! | = NULL | ) |
Definition at line 268 of file cwb_condor_recovery.C.
if | ( | gSystem->Getenv("_USE_PEGASUS")! | = NULL | ) |
Definition at line 297 of file cwb_condor_recovery.C.
if | ( | gSystem->Getenv("file_n_st")! | = NULL | ) |
Definition at line 358 of file cwb_condor_recovery.C.
sprintf | ( | full_condor_dir | , |
"%s/%s" | , | ||
work_dir | , | ||
condor_dir | |||
) |
sprintf | ( | dagfile | , |
"%s/%s.dag.recovery.%d" | , | ||
condor_dir | , | ||
data_label | , | ||
iversion | |||
) |
sprintf | ( | job_label | , |
"%s%s" | , | ||
data_label | , | ||
sfactor | |||
) |
sprintf | ( | symlink | , |
"%s/%d_%s_%s.err" | , | ||
full_condor_err_dir | , | ||
jobID | , | ||
data_label | , | ||
cwb_stage_name. | Data() | ||
) |
sprintf | ( | extention | , |
"recovery.%d" | , | ||
iversion | |||
) |
TString cwb_stage_input =output_dir |
Definition at line 140 of file cwb_condor_recovery.C.
TString cwb_stage_name ="CWB_STAGE_FULL" |
Definition at line 52 of file cwb_condor_recovery.C.
TString cwb_stage_resume ="FALSE" |
Definition at line 134 of file cwb_condor_recovery.C.
char dagfile[1024] |
Definition at line 112 of file cwb_condor_recovery.C.
else |
Definition at line 47 of file cwb_condor_recovery.C.
Definition at line 117 of file cwb_condor_recovery.C.
gSystem Exec | ( | exec_cmd | ) |
Definition at line 356 of file cwb_condor_recovery.C.
bool exists = TB.isFileExisting(TString::Format("%s/%s.dag",full_condor_dir,data_label)) |
Definition at line 76 of file cwb_condor_recovery.C.
Long_t flags |
Definition at line 116 of file cwb_condor_recovery.C.
char full_condor_dir[1024] |
Definition at line 71 of file cwb_condor_recovery.C.
Long_t id |
Definition at line 116 of file cwb_condor_recovery.C.
iversion |
Definition at line 110 of file cwb_condor_recovery.C.
char job_label[512] |
Definition at line 160 of file cwb_condor_recovery.C.
vector<int> jobList =TB.getCondorJobList(full_condor_dir, data_label) |
Definition at line 85 of file cwb_condor_recovery.C.
int max_jobs = 0 |
Definition at line 87 of file cwb_condor_recovery.C.
Long_t mt |
Definition at line 116 of file cwb_condor_recovery.C.
int nrecovery =0 |
Definition at line 204 of file cwb_condor_recovery.C.
path = CWB::Toolbox::getFileName(symlink) |
Definition at line 256 of file cwb_condor_recovery.C.
Long_t size |
Definition at line 116 of file cwb_condor_recovery.C.