Deleted Added
sdiff udiff text old ( 1383:e6881c83438c ) new ( 1385:a80f052561fd )
full compact
1#!/usr/bin/env python
2# Copyright (c) 2005 The Regents of The University of Michigan
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met: redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer;

--- 14 unchanged lines hidden (view full) ---

23# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27#
28# Authors: Ali Saidi
29# Nathan Binkert
30
31import os, os.path, re, sys
32from os import environ as env, listdir
33from os.path import basename, isdir, isfile, islink, join as joinpath
34from filecmp import cmp as filecmp
35from shutil import copyfile
36
37progname = basename(sys.argv[0])
38usage = """\
39Usage:
40 %(progname)s [-c] [-e] [-f] [-q queue] [-v] <regexp>
41 -c clean directory if job can be run
42 -e only echo pbs command info, don't actually send the job
43 -f force the job to run regardless of state
44 -q <queue> submit job to the named queue

--- 15 unchanged lines hidden (view full) ---

60
61clean = False
62onlyecho = False
63exprs = []
64force = False
65listonly = False
66queue = ''
67verbose = False
68rootdir = re.sub(r'^/\.automount/', r'/n/', os.getcwd())
69for opt,arg in opts:
70 if opt == '-c':
71 clean = True
72 if opt == '-d':
73 rootdir = arg
74 if opt == '-e':
75 onlyecho = True
76 if opt == '-f':

--- 10 unchanged lines hidden (view full) ---

87
88basedir = joinpath(rootdir, 'Base')
89linkdir = joinpath(rootdir, 'Link')
90
91for arg in args:
92 exprs.append(re.compile(arg))
93
94if not listonly and not onlyecho and isdir(linkdir):
95 print 'Checking for outdated files in Link directory'
96 entries = listdir(linkdir)
97 for entry in entries:
98 link = joinpath(linkdir, entry)
99 if not islink(link) or not isfile(link):
100 continue
101
102 base = joinpath(basedir, entry)
103 if not isfile(base) or not filecmp(link, base):

--- 47 unchanged lines hidden (view full) ---

151 joblist = jl
152
153for jobname in joblist:
154 jobdir = joinpath(rootdir, jobname)
155
156 if not onlyecho and not os.path.isdir(jobdir):
157 sys.exit('%s is not a directory. Cannot build job' % jobdir)
158
159 print >>sys.stderr, 'Job name: %s' % jobname
160 print >>sys.stderr, 'Job directory: %s' % jobdir
161
162 qsub = pbs.qsub()
163 qsub.pbshost = 'simpool.eecs.umich.edu'
164 qsub.stdout = joinpath(jobdir, 'jobout')
165 qsub.name = jobname
166 qsub.join = True
167 qsub.node_type = 'FAST'
168 qsub.onlyecho = onlyecho
169 qsub.env['ROOTDIR'] = rootdir
170 qsub.verbose = verbose
171 if len(queue):
172 qsub.queue = queue
173
174 qsub.do(joinpath(basedir, 'job.py'))
175 print >>sys.stderr, ''