16 |
|
|
17 |
|
my %opt; |
18 |
|
Getopt::Long::Configure ("bundling"); |
19 |
< |
GetOptions (\%opt, "maxEvents|m=s", "help|h"); |
19 |
> |
GetOptions (\%opt, "label|l=s", "maxEvents|m=s", "help|h"); |
20 |
|
my $argc = @ARGV; |
21 |
|
|
22 |
|
printHelp () if $opt{"help"}; |
58 |
|
$eventsPerJob = ceil ($opt{"maxEvents"} / $realNJobs) if $opt{"maxEvents"} && $opt{"maxEvents"} >= 0; |
59 |
|
my $realMaxEvents = $eventsPerJob * $realNJobs; |
60 |
|
outputPset ($directory, $dataset, $opt{"maxEvents"}, $eventsPerJob); |
61 |
< |
outputCondor ("$ENV{'CMSSW_BASE'}/src/OSUT3Analysis/DBTools/data/condor.sub", $directory, $realNJobs, $dataset); |
61 |
> |
outputCondor ("$ENV{'CMSSW_BASE'}/src/OSUT3Analysis/DBTools/data/condor.sub", $directory, $realNJobs, $dataset, $opt{"label"}); |
62 |
|
copy ($config, "$directory/userConfig_cfg.py"); |
63 |
|
chdir $directory; |
64 |
|
print "Submitting $realNJobs jobs to run on $realMaxEvents events in $nFiles files.\n" if $realMaxEvents >= 0; |
221 |
|
my $workingDir = shift; |
222 |
|
my $nJobs = shift; |
223 |
|
my $dataset = shift; |
224 |
+ |
my $label = shift; |
225 |
|
|
226 |
|
my $cmsRun = `which cmsRun`; |
227 |
|
my $condorFile = ""; |
228 |
|
|
229 |
|
if (!(-e $condorFileName)) |
230 |
|
{ |
231 |
+ |
my $arguments = "Arguments = config_cfg.py True $nJobs \$(Process)"; |
232 |
+ |
$arguments += " $dataset" if $dataset; |
233 |
+ |
$arguments += " NULL" if !$dataset; |
234 |
+ |
$arguments += " $label" if $label; |
235 |
+ |
$arguments += " NULL" if !$label; |
236 |
+ |
$arguments += "\n"; |
237 |
+ |
|
238 |
|
$condorFile .= "Executable = $cmsRun\n"; |
239 |
|
$condorFile .= "Universe = vanilla\n"; |
240 |
|
$condorFile .= "Getenv = True\n"; |
241 |
< |
$condorFile .= "Arguments = config_cfg.py True $nJobs \$(Process) $dataset\n" if $dataset; |
234 |
< |
$condorFile .= "Arguments = config_cfg.py True $nJobs \$(Process) NULL\n" if !$dataset; |
241 |
> |
$condorFile .= $arguments; |
242 |
|
$condorFile .= "\n"; |
243 |
|
$condorFile .= "Output = condor_\$(Process).out\n"; |
244 |
|
$condorFile .= "Error = condor_\$(Process).err\n"; |
259 |
|
$condorFile =~ s/\$nJobs/$nJobs/g; |
260 |
|
$condorFile =~ s/\$dataset/$dataset/g if $dataset; |
261 |
|
$condorFile =~ s/\$dataset/NULL/g if !$dataset; |
262 |
+ |
$condorFile =~ s/\$label/$label/g if $label; |
263 |
+ |
$condorFile =~ s/\$label/NULL/g if !$label; |
264 |
|
} |
265 |
|
|
266 |
|
open (SUB, ">$workingDir/condor.sub"); |
278 |
|
print "Submits CMSSW jobs to the OSU Tier 3 compute nodes using Condor.\n"; |
279 |
|
print "\n"; |
280 |
|
printf "%-29s%s\n", " -h, --help", "print this help message"; |
281 |
+ |
printf "%-29s%s\n", " -l, --label LABEL", "give the dataset a short label"; |
282 |
|
printf "%-29s%s\n", " -m, --maxEvents N", "only run over N events in the dataset; default is"; |
283 |
|
printf "%-29s%s\n", " ", "to run over all events"; |
284 |
|
print "\n"; |