ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/OSUT3Analysis/DBTools/scripts/osusub
(Generate patch)

Comparing UserCode/OSUT3Analysis/DBTools/scripts/osusub (file contents):
Revision 1.15 by ahart, Mon Mar 25 18:26:58 2013 UTC vs.
Revision 1.16 by ahart, Thu Apr 25 18:17:33 2013 UTC

# Line 16 | Line 16 | our $db = Mysql->connect ("cmshead", "nt
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"};
# Line 58 | Line 58 | my $eventsPerJob = -1;
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;
# Line 221 | Line 221 | outputCondor
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";
# Line 252 | Line 259 | outputCondor
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");
# Line 269 | Line 278 | printHelp
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";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines