Improvements to send.py to allow the user to specify the jobfile
util/pbs/send.py: Allow the user to specify the jobfile --HG-- extra : convert_revision : 0e21d2b03355bb7e8938c828bbaa441dc51afd1a
This commit is contained in:
parent
d10412d565
commit
c5b63bc4c1
1 changed files with 9 additions and 4 deletions
|
@ -45,14 +45,16 @@ progpath = nfspath(sys.path[0])
|
||||||
progname = basename(sys.argv[0])
|
progname = basename(sys.argv[0])
|
||||||
usage = """\
|
usage = """\
|
||||||
Usage:
|
Usage:
|
||||||
%(progname)s [-c] [-e] [-f] [-q queue] [-v] <regexp>
|
%(progname)s [-c] [-e] [-f] [-j <jobfile>] [-q queue] [-v] <regexp>
|
||||||
-c clean directory if job can be run
|
-c clean directory if job can be run
|
||||||
-e only echo pbs command info, don't actually send the job
|
-e only echo pbs command info, don't actually send the job
|
||||||
-f force the job to run regardless of state
|
-f force the job to run regardless of state
|
||||||
-q <queue> submit job to the named queue
|
-q <queue> submit job to the named queue
|
||||||
|
-j <jobfile> specify the jobfile (default is <basedir>/test.py)
|
||||||
-v be verbose
|
-v be verbose
|
||||||
|
|
||||||
%(progname)s -l [-v] <regexp>
|
%(progname)s [-j <jobfile>] -l [-v] <regexp>
|
||||||
|
-j <jobfile> specify the jobfile (default is <basedir>/test.py)
|
||||||
-l list job names, don't submit
|
-l list job names, don't submit
|
||||||
-v be verbose (list job parameters)
|
-v be verbose (list job parameters)
|
||||||
|
|
||||||
|
@ -62,7 +64,7 @@ Usage:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import getopt
|
import getopt
|
||||||
opts, args = getopt.getopt(sys.argv[1:], '-cd:efhlq:v')
|
opts, args = getopt.getopt(sys.argv[1:], '-cd:efhj:lq:v')
|
||||||
except getopt.GetoptError:
|
except getopt.GetoptError:
|
||||||
sys.exit(usage)
|
sys.exit(usage)
|
||||||
|
|
||||||
|
@ -74,6 +76,7 @@ listonly = False
|
||||||
queue = ''
|
queue = ''
|
||||||
verbose = False
|
verbose = False
|
||||||
rootdir = nfspath(os.getcwd())
|
rootdir = nfspath(os.getcwd())
|
||||||
|
jfile = 'test.py'
|
||||||
for opt,arg in opts:
|
for opt,arg in opts:
|
||||||
if opt == '-c':
|
if opt == '-c':
|
||||||
clean = True
|
clean = True
|
||||||
|
@ -86,6 +89,8 @@ for opt,arg in opts:
|
||||||
if opt == '-h':
|
if opt == '-h':
|
||||||
print usage
|
print usage
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
if opt == '-j':
|
||||||
|
jfile = arg
|
||||||
if opt == '-l':
|
if opt == '-l':
|
||||||
listonly = True
|
listonly = True
|
||||||
if opt == '-q':
|
if opt == '-q':
|
||||||
|
@ -115,7 +120,7 @@ if not listonly and not onlyecho and isdir(linkdir):
|
||||||
|
|
||||||
import job, jobfile, pbs
|
import job, jobfile, pbs
|
||||||
|
|
||||||
test = jobfile.JobFile(joinpath(basedir, 'test.py'))
|
test = jobfile.JobFile(joinpath(basedir, jfile))
|
||||||
|
|
||||||
joblist = []
|
joblist = []
|
||||||
for jobname in test.jobs:
|
for jobname in test.jobs:
|
||||||
|
|
Loading…
Reference in a new issue