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.1 by ahart, Wed Jun 6 12:14:37 2012 UTC vs.
Revision 1.2 by ahart, Thu Jun 14 17:42:30 2012 UTC

# Line 4 | Line 4 | use strict;
4   use Mysql;
5   use File::Copy;
6   use Getopt::Long;
7 sub printHelp;
7  
8 + sub printHelp;
9   sub outputPset;
10   sub outputRunList;
11   sub getLocation;
# Line 109 | Line 109 | getLocation
109    my $dataset = shift;
110  
111    my $results;
112 +  my $queryDataset = $dataset;
113 +  $queryDataset =~ s/\*/%/g;
114 +  $queryDataset =~ s/(.*)/%$1%/g;
115    $db = Mysql->connect ("cmshead", "ntuple", "osuT3User");
116 <  my $query = "select user,creationTime,location,nFiles,status from ntuple where dataset='$dataset' order by lastUpdateTime";
116 >  my $query = "select dataset,user,creationTime,location,nFiles,status from ntuple where dataset like '$queryDataset' order by lastUpdateTime";
117    $db->selectdb ("ntuple");
118    $results = $db->query ($query);
119    if ($results->numrows () == 1)
120      {
121        my @row = $results->fetchrow ();
122 <      return ($row[2], $row[3], $row[4]);
122 >      return ($row[3], $row[4], $row[5]);
123      }
124    if ($results->numrows () == 0)
125      {
# Line 129 | Line 132 | getLocation
132    for (my $i = 1; $i <= $results->numrows (); $i++)
133      {
134        my @row = $results->fetchrow ();
135 <      $map{"$i"} = [$row[2], $row[3], $row[4]];
136 <      print "($i) created by $row[0] on $row[1]\n";
135 >      $map{"$i"} = [$row[3], $row[4], $row[5]];
136 >      printf "(%2d) $row[0]\n", $i;
137 >      print "     created by $row[1] on $row[2]\n";
138      }
139    print "\nWhich dataset would you like to use?: ";
140    my $response = <STDIN>;
# Line 173 | Line 177 | printHelp
177    my $exeName = $0;
178    $exeName =~ s/^.*\/([^\/]*)$/$1/;
179  
180 <  print "Usage: $exeName [OPTION] DATASET CONFIG DIRECTORY NJOBS\n";
180 >  print "Usage: $exeName [OPTIONS] DATASET CONFIG DIRECTORY NJOBS\n";
181    print "Submits CMSSW jobs to the OSU Tier 3 compute nodes using Condor.\n";
182    print "\n";
183    printf "%-29s%s\n", "  -h, --help", "print this help message";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines