74 |
|
my $dataset = shift; |
75 |
|
my $workingDir = shift; |
76 |
|
|
77 |
< |
my ($location, $nFiles, $status, $crossSection) = getLocation ($dataset); |
78 |
< |
if ($status ne "present") |
79 |
< |
{ |
80 |
< |
print "This dataset is not marked as present on the Tier 3!\n"; |
81 |
< |
print "Continue anyway? (y/N): "; |
82 |
< |
my $response = <STDIN>; |
83 |
< |
$response =~ s/\n//g; |
84 |
< |
exit if !$response || lc ($response) ne "y"; |
77 |
> |
my $location; |
78 |
> |
my $nFiles; |
79 |
> |
my $status; |
80 |
> |
my $crossSection; |
81 |
> |
my $isLocation = 0; |
82 |
> |
$isLocation = 1 if -e $dataset; |
83 |
> |
if (!$isLocation) |
84 |
> |
{ |
85 |
> |
($location, $nFiles, $status, $crossSection) = getLocation ($dataset); |
86 |
> |
if ($status ne "present") |
87 |
> |
{ |
88 |
> |
print "This dataset is not marked as present on the Tier 3!\n"; |
89 |
> |
print "Continue anyway? (y/N): "; |
90 |
> |
my $response = <STDIN>; |
91 |
> |
$response =~ s/\n//g; |
92 |
> |
exit if !$response || lc ($response) ne "y"; |
93 |
> |
} |
94 |
> |
if (!(-e $location)) |
95 |
> |
{ |
96 |
> |
print "The database does not know where this dataset is!\n"; |
97 |
> |
exit; |
98 |
> |
} |
99 |
|
} |
100 |
< |
if (!(-e $location)) |
100 |
> |
else |
101 |
|
{ |
102 |
< |
print "The database does not know where this dataset is!\n"; |
89 |
< |
exit; |
102 |
> |
$location = $dataset; |
103 |
|
} |
104 |
|
opendir (LOCATION, $location); |
105 |
|
my @files = readdir (LOCATION); |
106 |
|
closedir (LOCATION); |
107 |
< |
if (@files - 2 != $nFiles) |
107 |
> |
if (!$isLocation && @files - 2 != $nFiles) |
108 |
|
{ |
109 |
|
print "Number of files does not match database entry!\n"; |
110 |
|
print "Continue anyway? (y/N): "; |
112 |
|
$response =~ s/\n//g; |
113 |
|
exit if !$response || lc ($response) ne "y"; |
114 |
|
} |
115 |
+ |
elsif ($isLocation) |
116 |
+ |
{ |
117 |
+ |
$nFiles = @files - 2; |
118 |
+ |
} |
119 |
|
open (RUNLIST, ">$workingDir/runList.py"); |
120 |
|
print RUNLIST "runList = [\n"; |
121 |
|
for (my $i = 0; $i < @files; $i++) |
216 |
|
$exeName =~ s/^.*\/([^\/]*)$/$1/; |
217 |
|
|
218 |
|
print "Usage: $exeName [OPTION]... DATASET CONFIG DIRECTORY NJOBS\n"; |
219 |
+ |
print " or: $exeName [OPTION]... LOCATION CONFIG DIRECTORY NJOBS\n"; |
220 |
|
print "Submits CMSSW jobs to the OSU Tier 3 compute nodes using Condor.\n"; |
221 |
|
print "\n"; |
222 |
|
printf "%-29s%s\n", " -h, --help", "print this help message"; |
223 |
|
print "\n"; |
224 |
< |
print "The DATASET must exist in the Tier 3 ntuple database, and CONFIG must be a valid\n"; |
225 |
< |
print "CMSSW python configuration which can be used with cmsRun. DIRECTORY is a working\n"; |
224 |
> |
print "The first argument must be either a DATASET registered in the Tier 3 ntuple\n"; |
225 |
> |
print "database or a LOCATION which exists on disk. CONFIG must be a valid CMSSW\n"; |
226 |
> |
print "python configuration which can be used with cmsRun. DIRECTORY is a working\n"; |
227 |
|
print "directory that is created and in which all output, both from the CMSSW jobs and\n"; |
228 |
|
print "from Condor, is placed. Finally, NJOBS is the number of Condor jobs that will\n"; |
229 |
|
print "be created.\n"; |