10 cout <<
"cwb_condor_mtpe.C : Error - the accounting_group is not defined !!!" << endl;
11 cout <<
"The accounting_group must be defined in the user_parameters.C file" << endl;
12 cout <<
"See the following link:" << endl;
13 cout <<
" https://ldas-gridmon.ligo.caltech.edu/accounting/condor_groups/determine_condor_account_group.html" << endl;
14 cout <<
"Examples : " << endl;
15 cout <<
"strcpy(condor_tag,\"ligo.dev.o2.burst.allsky.cwboffline\");" << endl;
16 cout <<
"strcpy(condor_tag,\"ligo.prod.o2.burst.allsky.cwboffline\");" << endl;
17 cout <<
"If you don't need it set : strcpy(condor_tag,\"disabled\");" << endl << endl;
23 cout << endl <<
"cwb_condor_mtpe Error : allowed only with simulation=0/4 !!!" << endl << endl;
41 if(gSystem->Getenv(
"CWB_CONDOR_MTPE_JOBID")==NULL) {
42 cout << endl <<
"cwb_condor_mtpe Error : environment CWB_CONDOR_MTPE_JOBID is not defined!!!" << endl << endl;
45 if(
TString(gSystem->Getenv(
"CWB_CONDOR_MTPE_JOBID")).IsDigit()) {
46 cwb_condor_mtpe_jobid=
TString(gSystem->Getenv(
"CWB_CONDOR_MTPE_JOBID")).Atoi();
48 cout << endl <<
"cwb_condor_mtpe Error : environment CWB_CONDOR_MTPE_JOBID is not an integer number!!!" << endl << endl;
52 if(cwb_condor_mtpe_jobid<1) {
53 cout << endl <<
"cwb_condor_mtpe Error : environment CWB_CONDOR_MTPE_JOBID is not an integer number >0 !!!" << endl << endl;
58 int cwb_condor_mtpe_trials=-1;
64 cwb_condor_mtpe_offset =
factors[0];
65 if(cwb_condor_mtpe_trials<1) {
66 cout << endl <<
"cwb_condor_mtpe Error : (simulation=4) nfactor is not an integer number >0 !!!" << endl << endl;
69 if(cwb_condor_mtpe_offset<1) {
70 cout << endl <<
"cwb_condor_mtpe Error : (simulation=4) factors[0] is not an integer number >0 !!!" << endl << endl;
79 if(pe_options.CompareTo(
"")!=0) {
80 cout << pe_options << endl;
81 if(!pe_options.Contains(
"--")) {
85 for(
int j=0;
j<token->GetEntries();
j++) {
87 TObjString* tok = (TObjString*)token->At(
j);
88 TString stok = tok->GetString();
90 if(stok.Contains(
"pe_multitask=")) {
92 pe_multitask.Remove(0,pe_multitask.Last(
'=')+1);
93 if(pe_multitask==
"true") multitask=
true;
94 if(pe_multitask==
"false") multitask=
false;
97 if(stok.Contains(
"pe_trials=") || stok.Contains(
"pe_retry=")) {
99 pe_trials.Remove(0,pe_trials.Last(
'=')+1);
100 if(pe_trials.IsDigit()) cwb_condor_mtpe_trials=pe_trials.Atoi();
106 cout << endl <<
"cwb_condor_mtpe Error : (simulation=0) pe_multitask must be enabled !!!" << endl << endl;
109 if(cwb_condor_mtpe_trials<1 || cwb_condor_mtpe_trials>99) {
110 cout << endl <<
"cwb_condor_mtpe Error : (simulation=0) pe_trials in PE parPlugin is not an integer number >0 && <100 !!!" << endl << endl;
124 if((fP = fopen(ofile_condor_sub,
"w")) == NULL) {
125 cout << endl <<
"cwb_condor_mtpe.C : Error - cannot open file " << ofile_condor_sub << endl << endl;
128 cout << endl << ofile_condor_sub << endl;
138 fprintf(fP,
"universe = vanilla\n");
140 fprintf(fP,
"priority = $(PRI)\n");
141 fprintf(fP,
"on_exit_hold = ( ExitCode != 0 )\n");
142 fprintf(fP,
"request_memory = 2000\n");
143 fprintf(fP,
"executable = loudest.sh\n");
144 fprintf(fP,
"job_machine_attrs = Machine\n");
145 fprintf(fP,
"job_machine_attrs_history_length = 5\n");
146 fprintf(fP,
"requirements = target.machine =!= MachineAttrMachine1 && target.machine =!= MachineAttrMachine2 && target.machine =!= MachineAttrMachine3 && target.machine =!= MachineAttrMachine4 && target.machine =!= MachineAttrMachine5\n");
147 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");
148 if(
TString(condor_tag)!=
"")
fprintf(fP,
"accounting_group = %s\n",condor_tag);
149 fprintf(fP,
"output = %s/$(PID)_$(CWB_MDC_FACTOR)_%s.out\n",full_condor_out_dir,condor_label);
150 fprintf(fP,
"error = %s/$(PID)_$(CWB_MDC_FACTOR)_%s.err\n",full_condor_err_dir,condor_label);
152 fprintf(fP,
"notification = never\n");
160 char ofile_condor_dag[1024];
164 out.open(ofile_condor_dag,
ios::out);
165 if (!out.good()) {cout << endl <<
"cwb_condor_mtpe Error Opening File : " << ofile_condor_dag << endl << endl;
exit(1);}
166 cout << ofile_condor_dag << endl << endl;
170 for(
int n=cwb_condor_mtpe_offset;
n<=cwb_condor_mtpe_trials;
n++) {
171 char ostring[1024*16];
172 sprintf(ostring,
"JOB A%i_%d %s/%s.sub",cwb_condor_mtpe_jobid,
n,full_condor_dir,condor_label);
173 out << ostring << endl;
174 sprintf(ostring,
"VARS A%i_%d PID=\"%i\" CWB_UFILE=\"%s\" CWB_STAGE=\"CWB_STAGE_FULL\" CWB_MDC_FACTOR=\"%d\" CWB_CED_DIR=\"output\"",
175 cwb_condor_mtpe_jobid,
n,cwb_condor_mtpe_jobid,cwb_uparameters_file.Data(),
n);
176 out << ostring << endl;
177 sprintf(ostring,
"RETRY A%i_%d 3000",cwb_condor_mtpe_jobid,
n);
178 out << ostring << endl;
183 for(
int n=1;
n<cwb_condor_mtpe_trials;
n++) {
184 sprintf(ostring,
"A%i_%d ",cwb_condor_mtpe_jobid,
n);
187 sprintf(ostring,
"CHILD A%i_%d",cwb_condor_mtpe_jobid,cwb_condor_mtpe_trials);
188 out << ostring << endl;
void Export(TString fname="")
fprintf(stdout,"start=%f duration=%f rate=%f\n", x.start(), x.size()/x.rate(), x.rate())
char ofile_condor_sub[1024]
void Import(TString umacro="")
int cwb_condor_mtpe_jobid
int cwb_condor_mtpe_offset
sprintf(condor_label,"%s.mtpe", data_label)
strcpy(RunLabel, RUN_LABEL)
char full_condor_out_dir[512]
char full_condor_dir[512]
void SetSingleDetectorMode()
char full_condor_err_dir[512]