28 cout <<
"cwb_condor_mtpe.C : Error - the accounting_group is not defined !!!" << endl;
29 cout <<
"The accounting_group must be defined in the user_parameters.C file" << endl;
30 cout <<
"See the following link:" << endl;
31 cout <<
" https://ldas-gridmon.ligo.caltech.edu/accounting/condor_groups/determine_condor_account_group.html" << endl;
32 cout <<
"Examples : " << endl;
33 cout <<
"strcpy(condor_tag,\"ligo.dev.o2.burst.allsky.cwboffline\");" << endl;
34 cout <<
"strcpy(condor_tag,\"ligo.prod.o2.burst.allsky.cwboffline\");" << endl;
35 cout <<
"If you don't need it set : strcpy(condor_tag,\"disabled\");" << endl << endl;
41 cout << endl <<
"cwb_condor_mtpe Error : allowed only with simulation=0/4 !!!" << endl << endl;
59 if(gSystem->Getenv(
"CWB_CONDOR_MTPE_JOBID")==NULL) {
60 cout << endl <<
"cwb_condor_mtpe Error : environment CWB_CONDOR_MTPE_JOBID is not defined!!!" << endl << endl;
63 if(
TString(gSystem->Getenv(
"CWB_CONDOR_MTPE_JOBID")).IsDigit()) {
64 cwb_condor_mtpe_jobid=
TString(gSystem->Getenv(
"CWB_CONDOR_MTPE_JOBID")).Atoi();
66 cout << endl <<
"cwb_condor_mtpe Error : environment CWB_CONDOR_MTPE_JOBID is not an integer number!!!" << endl << endl;
70 if(cwb_condor_mtpe_jobid<1) {
71 cout << endl <<
"cwb_condor_mtpe Error : environment CWB_CONDOR_MTPE_JOBID is not an integer number >0 !!!" << endl << endl;
76 int cwb_condor_mtpe_trials=-1;
82 cwb_condor_mtpe_offset =
factors[0];
83 if(cwb_condor_mtpe_trials<1) {
84 cout << endl <<
"cwb_condor_mtpe Error : (simulation=4) nfactor is not an integer number >0 !!!" << endl << endl;
87 if(cwb_condor_mtpe_offset<1) {
88 cout << endl <<
"cwb_condor_mtpe Error : (simulation=4) factors[0] is not an integer number >0 !!!" << endl << endl;
97 if(pe_options.CompareTo(
"")!=0) {
98 cout << pe_options << endl;
99 if(!pe_options.Contains(
"--")) {
103 for(
int j=0;
j<token->GetEntries();
j++) {
105 TObjString* tok = (TObjString*)token->At(
j);
106 TString stok = tok->GetString();
108 if(stok.Contains(
"pe_multitask=")) {
110 pe_multitask.Remove(0,pe_multitask.Last(
'=')+1);
111 if(pe_multitask==
"true") multitask=
true;
112 if(pe_multitask==
"false") multitask=
false;
115 if(stok.Contains(
"pe_trials=") || stok.Contains(
"pe_retry=")) {
117 pe_trials.Remove(0,pe_trials.Last(
'=')+1);
118 if(pe_trials.IsDigit()) cwb_condor_mtpe_trials=pe_trials.Atoi();
124 cout << endl <<
"cwb_condor_mtpe Error : (simulation=0) pe_multitask must be enabled !!!" << endl << endl;
127 if(cwb_condor_mtpe_trials<1 || cwb_condor_mtpe_trials>99) {
128 cout << endl <<
"cwb_condor_mtpe Error : (simulation=0) pe_trials in PE parPlugin is not an integer number >0 && <100 !!!" << endl << endl;
142 if((fP = fopen(ofile_condor_sub,
"w")) == NULL) {
143 cout << endl <<
"cwb_condor_mtpe.C : Error - cannot open file " << ofile_condor_sub << endl << endl;
146 cout << endl << ofile_condor_sub << endl;
156 fprintf(fP,
"universe = vanilla\n");
158 fprintf(fP,
"priority = $(PRI)\n");
159 fprintf(fP,
"on_exit_hold = ( ExitCode != 0 )\n");
160 fprintf(fP,
"request_memory = 2000\n");
161 fprintf(fP,
"executable = loudest.sh\n");
162 fprintf(fP,
"job_machine_attrs = Machine\n");
163 fprintf(fP,
"job_machine_attrs_history_length = 5\n");
164 fprintf(fP,
"requirements = target.machine =!= MachineAttrMachine1 && target.machine =!= MachineAttrMachine2 && target.machine =!= MachineAttrMachine3 && target.machine =!= MachineAttrMachine4 && target.machine =!= MachineAttrMachine5\n");
165 fprintf(fP,
"environment = CWB_JOBID=$(PID);CWB_UFILE=$(CWB_UFILE);CWB_STAGE=$(CWB_STAGE);CWB_MDC_FACTOR=$(CWB_MDC_FACTOR);CWB_CED_DIR=$(CWB_CED_DIR)\n");
166 if(
TString(condor_tag)!=
"")
fprintf(fP,
"accounting_group = %s\n",condor_tag);
167 fprintf(fP,
"output = %s/$(PID)_$(CWB_MDC_FACTOR)_%s.out\n",full_condor_out_dir,condor_label);
168 fprintf(fP,
"error = %s/$(PID)_$(CWB_MDC_FACTOR)_%s.err\n",full_condor_err_dir,condor_label);
170 fprintf(fP,
"notification = never\n");
178 char ofile_condor_dag[1024];
182 out.open(ofile_condor_dag,
ios::out);
183 if (!out.good()) {cout << endl <<
"cwb_condor_mtpe Error Opening File : " << ofile_condor_dag << endl << endl;
exit(1);}
184 cout << ofile_condor_dag << endl << endl;
188 for(
int n=cwb_condor_mtpe_offset;
n<=cwb_condor_mtpe_trials;
n++) {
189 char ostring[1024*16];
190 sprintf(ostring,
"JOB A%i_%d %s/%s.sub",cwb_condor_mtpe_jobid,
n,full_condor_dir,condor_label);
191 out << ostring << endl;
192 sprintf(ostring,
"VARS A%i_%d PID=\"%i\" CWB_UFILE=\"%s\" CWB_STAGE=\"CWB_STAGE_FULL\" CWB_MDC_FACTOR=\"%d\" CWB_CED_DIR=\"output\"",
193 cwb_condor_mtpe_jobid,
n,cwb_condor_mtpe_jobid,cwb_uparameters_file.Data(),
n);
194 out << ostring << endl;
195 sprintf(ostring,
"RETRY A%i_%d 3000",cwb_condor_mtpe_jobid,
n);
196 out << ostring << endl;
200 char ostring[1024*16];
202 for(
int n=1;
n<cwb_condor_mtpe_trials;
n++) {
203 sprintf(ostring,
"A%i_%d ",cwb_condor_mtpe_jobid,
n);
206 sprintf(ostring,
"CHILD A%i_%d",cwb_condor_mtpe_jobid,cwb_condor_mtpe_trials);
207 out << ostring << endl;
void Export(TString fname="")
char ofile_condor_sub[1024]
char full_condor_dir[1024]
void Import(TString umacro="")
int cwb_condor_mtpe_jobid
fprintf(stdout,"start=%f duration=%f rate=%f\, x.start(), x.size()/x.rate(), x.rate())
char full_condor_out_dir[1024]
char full_condor_err_dir[1024]
int cwb_condor_mtpe_offset
sprintf(condor_label,"%s.mtpe", data_label)
strcpy(RunLabel, RUN_LABEL)
void SetSingleDetectorMode()