3 #-----------------------------------------------------------------------
4 # Submit jobs to generate requested samples for the NuINT09 `Confronting
5 # theory, models & data' session organized by S.Dytman and S.Boyd.
6 # Script prepared for the RAL/PPD Tier2 batch farm.
9 # perl submit-nuint09_jobs.pl <options>
12 # --run : Comma separated list of run numbers
13 # --version : GENIE version number
14 # [--nsubruns] : number of subruns per run
15 # [--arch] : <SL4_32bit, SL5_64bit>, default: SL5_64bit
16 # [--production] : production name, default: nuint09_<version>
17 # [--cycle] : cycle in current production, default: 01
18 # [--use-valgrind] : default: off
19 # [--queue] : default: prod
20 # [--softw-topdir] : default: /opt/ppd/t2k/GENIE
23 # perl submit-nuint09_jobs.pl --production nuint09 --cycle 01 --version v2.5.1 --run 1001 --nsubruns 5
24 # perl submit-nuint09_jobs.pl --production nuint09 --cycle 01 --version v2.5.1 --run all --nsubruns 5
26 # Costas Andreopoulos <constantinos.andreopoulos \at cern.ch>
27 # STFC, Rutherford Appleton Lab
28 #----------------------------------------------------------------------
31 #......................................................................
32 # run number | init state | energy | processes
35 #......................................................................
37 # 1001xx | numu + C12 | 0.5 | COH-CC
38 # 1002xx | numu + C12 | 1.0 | COH-CC
39 # 1003xx | numu + C12 | 1.5 | COH-CC
40 # 1011xx | numu + C12 | 0.5 | COH-NC
41 # 1012xx | numu + C12 | 1.0 | COH-NC
42 # 1013xx | numu + C12 | 1.5 | COH-NC
43 # 2001xx | numu + C12 | 0.5 | QEL-CC
44 # 2002xx | numu + C12 | 1.0 | QEL-CC
45 # 3002xx | numu + C12 | 1.0 | RES-CC
46 # 3003xx | numu + C12 | 1.5 | RES-CC
47 # 9001xx | numu + C12 | 0.5 | CC (all)
48 # 9002xx | numu + C12 | 1.0 | CC (all)
49 # 9003xx | numu + C12 | 1.5 | CC (all)
50 # 9099xx | numu + C12 | 0.1-30. | CC (all)
52 # 1101xx | numu + O16 | 0.5 | COH-CC
53 # 1102xx | numu + O16 | 1.0 | COH-CC
54 # 1103xx | numu + O16 | 1.5 | COH-CC
55 # 1111xx | numu + O16 | 0.5 | COH-NC
56 # 1112xx | numu + O16 | 1.0 | COH-NC
57 # 1113xx | numu + O16 | 1.5 | COH-NC
58 # 2101xx | numu + O16 | 0.5 | QEL-CC
59 # 2102xx | numu + O16 | 1.0 | QEL-CC
60 # 3102xx | numu + O16 | 1.0 | RES-CC
61 # 3103xx | numu + O16 | 1.5 | RES-CC
62 # 9101xx | numu + O16 | 0.5 | CC (all)
63 # 9102xx | numu + O16 | 1.0 | CC (all)
64 # 9103xx | numu + O16 | 1.5 | CC (all)
65 # 9199xx | numu + O16 | 0.1-30. | CC (all)
67 # 1201xx | numu + Fe56 | 0.5 | COH-CC
68 # 1202xx | numu + Fe56 | 1.0 | COH-CC
69 # 1203xx | numu + Fe56 | 1.5 | COH-CC
70 # 1211xx | numu + Fe56 | 0.5 | COH-NC
71 # 1212xx | numu + Fe56 | 1.0 | COH-NC
72 # 1213xx | numu + Fe56 | 1.5 | COH-NC
73 # 2201xx | numu + Fe56 | 0.5 | QEL-CC
74 # 2202xx | numu + Fe56 | 1.0 | QEL-CC
75 # 3202xx | numu + Fe56 | 1.0 | RES-CC
76 # 3203xx | numu + Fe56 | 1.5 | RES-CC
77 # 9201xx | numu + Fe56 | 0.5 | CC (all)
78 # 9202xx | numu + Fe56 | 1.0 | CC (all)
79 # 9203xx | numu + Fe56 | 1.5 | CC (all)
80 # 9299xx | numu + Fe56 | 0.1-30 | CC (all)
81 #......................................................................
83 # run number key: IJKKxx, where
85 # I : Enabled processes
98 # 99: 0.1 - 30 GeV with 1/E flux
100 # 01-99, 100k events each
101 #......................................................................
110 if($_ eq '--run') { $runnu = $ARGV[$iarg+1]; }
111 if($_ eq '--nsubruns') { $nsubruns = $ARGV[$iarg+1]; }
112 if($_ eq '--version') { $genie_version = $ARGV[$iarg+1]; }
113 if($_ eq '--arch') { $arch = $ARGV[$iarg+1]; }
114 if($_ eq '--production') { $production = $ARGV[$iarg+1]; }
115 if($_ eq '--cycle') { $cycle = $ARGV[$iarg+1]; }
116 if($_ eq '--use-valgrind') { $use_valgrind = $ARGV[$iarg+1]; }
117 if($_ eq '--queue') { $queue = $ARGV[$iarg+1]; }
118 if($_ eq '--softw-topdir') { $softw_topdir = $ARGV[$iarg+1]; }
121 die("** Aborting [Undefined benchmark runs #. Use the --run option]")
122 unless defined $runnu;
123 die("** Aborting [Undefined GENIE version. Use the --version option]")
124 unless defined $genie_version;
126 $nsubruns = 1 unless defined $nsubruns;
127 $use_valgrind = 0 unless defined $use_valgrind;
128 $arch = "SL5_64bit" unless defined $arch;
129 $production = "nuint09\_$genie_version" unless defined $production;
130 $cycle = "01" unless defined $cycle;
131 $queue = "prod" unless defined $queue;
132 $softw_topdir = "/opt/ppd/t2k/GENIE" unless defined $softw_topdir;
133 $time_limit = "60:00:00";
134 $genie_setup = "$softw_topdir/builds/$arch/$genie_version-setup";
135 $jobs_dir = "$softw_topdir/scratch/$production\_$cycle";
136 $xspl_file = "$softw_topdir/data/job_inputs/xspl/gxspl-t2k-$genie_version.xml";
138 $nev_per_subrun = 100000;
186 '1001' => '1000060120',
187 '1002' => '1000060120',
188 '1003' => '1000060120',
189 '1011' => '1000060120',
190 '1012' => '1000060120',
191 '1013' => '1000060120',
192 '2001' => '1000060120',
193 '2002' => '1000060120',
194 '3002' => '1000060120',
195 '3003' => '1000060120',
196 '9001' => '1000060120',
197 '9002' => '1000060120',
198 '9003' => '1000060120',
199 '9099' => '1000060120',
200 '1101' => '1000080160',
201 '1102' => '1000080160',
202 '1103' => '1000080160',
203 '1111' => '1000080160',
204 '1112' => '1000080160',
205 '1113' => '1000080160',
206 '2101' => '1000080160',
207 '2102' => '1000080160',
208 '3102' => '1000080160',
209 '3103' => '1000080160',
210 '9101' => '1000080160',
211 '9102' => '1000080160',
212 '9103' => '1000080160',
213 '9199' => '1000080160',
214 '1201' => '1000260560',
215 '1202' => '1000260560',
216 '1203' => '1000260560',
217 '1211' => '1000260560',
218 '1212' => '1000260560',
219 '1213' => '1000260560',
220 '2201' => '1000260560',
221 '2202' => '1000260560',
222 '3202' => '1000260560',
223 '3203' => '1000260560',
224 '9201' => '1000260560',
225 '9202' => '1000260560',
226 '9203' => '1000260560',
227 '9299' => '1000260560'
244 '9099' => '0.1,30.0',
258 '9199' => '0.1,30.0',
334 '9099' => '-f "1/x"',
348 '9199' => '-f "1/x"',
365 # make the jobs directory
367 mkpath ($jobs_dir, {verbose => 1, mode=>0777});
369 print "Input runs: $runnu \n";
371 for my $curr_runnu (keys %gevgl_hash) {
372 #print "Checking benchmark run: ...... $curr_runnu \n";
374 if($runnu=~m/$curr_runnu/ || $runnu eq "all") {
375 print "** submitting run: $curr_runnu \n";
378 # get runnu-dependent info
380 $nu = $nupdg_hash {$curr_runnu};
381 $tgt = $tgtpdg_hash {$curr_runnu};
382 $en = $energy_hash {$curr_runnu};
383 $gevgl = $gevgl_hash {$curr_runnu};
384 $fluxopt = $fluxopt_hash {$curr_runnu};
389 for($isubrun = 0; $isubrun < $nsubruns; $isubrun++) {
391 $curr_subrunnu = 100 * $curr_runnu + $isubrun;
393 $batch_script = "$jobs_dir/nuint09job-$curr_subrunnu.pbs";
394 $logfile_evgen = "$jobs_dir/nuint09job-$curr_subrunnu.evgen.log";
395 $logfile_conv = "$jobs_dir/nuint09job-$curr_subrunnu.conv.log";
396 $logfile_pbse = "$jobs_dir/nuint09job-$curr_subrunnu.pbs_e.log";
397 $logfile_pbso = "$jobs_dir/nuint09job-$curr_subrunnu.pbs_o.log";
399 $curr_seed = $mcseed + $isubrun;
400 $grep_pipe = "grep -B 20 -A 30 -i \"warn\\|error\\|fatal\"";
401 $valgrind_cmd = "valgrind --tool=memcheck --error-limit=no --leak-check=yes --show-reachable=yes";
402 $evgen_cmd = "gevgen -n $nev_per_subrun -s -e $en -p $nu -t $tgt -r $curr_subrunnu $fluxopt | grep_pipe &> $logfile_evgen";
403 $conv_cmd = "gntpc -f gst -i gntp.$curr_subrunnu.ghep.root | grep -B 100 -A 30 -i \"warn\\|error\\|fatal\" &> $logfile_conv";
405 # create the PBS script
407 open(PBS, ">$batch_script") or die("Can not create the PBS batch script");
408 print PBS "#!/bin/bash \n";
409 print PBS "#PBS -l cput=$time_limit \n";
410 print PBS "#PBS -o $logfile_pbso \n";
411 print PBS "#PBS -e $logfile_pbse \n";
412 print PBS "source $genie_setup \n";
413 print PBS "cd $jobs_dir \n";
414 print PBS "export GSPLOAD=$xspl_file \n";
415 print PBS "export GEVGL=$gevgl \n";
416 print PBS "export GSEED=$curr_seed \n";
417 print PBS "$evgen_cmd \n";
418 print PBS "$conv_cmd \n";
420 print "EXEC: $evgen_cmd \n";
425 `qsub -q $queue $batch_script`;