send.py (1393:5c13e11b3df1) send.py (1602:0fad8b5c6d2f)
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;

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

40 elif not dir.startswith('/n/'):
41 dir = '/n/%s%s' % (socket.gethostname().split('.')[0], dir)
42 return dir
43
44progpath = nfspath(sys.path[0])
45progname = basename(sys.argv[0])
46usage = """\
47Usage:
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;

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

40 elif not dir.startswith('/n/'):
41 dir = '/n/%s%s' % (socket.gethostname().split('.')[0], dir)
42 return dir
43
44progpath = nfspath(sys.path[0])
45progname = basename(sys.argv[0])
46usage = """\
47Usage:
48 %(progname)s [-c] [-e] [-f] [-q queue] [-v]
48 %(progname)s [-c] [-e] [-f] [-j <jobfile>] [-q queue] [-v] <regexp>
49 -c clean directory if job can be run
50 -e only echo pbs command info, don't actually send the job
51 -f force the job to run regardless of state
52 -q <queue> submit job to the named queue
49 -c clean directory if job can be run
50 -e only echo pbs command info, don't actually send the job
51 -f force the job to run regardless of state
52 -q <queue> submit job to the named queue
53 -j <jobfile> specify the jobfile (default is <basedir>/test.py)
53 -v be verbose
54
54 -v be verbose
55
55 %(progname)s -l [-v]
56 %(progname)s [-j <jobfile>] -l [-v] <regexp>
57 -j <jobfile> specify the jobfile (default is <basedir>/test.py)
56 -l list job names, don't submit
57 -v be verbose (list job parameters)
58
59 %(progname)s -h
60 -h display this help
61""" % locals()
62
63try:
64 import getopt
58 -l list job names, don't submit
59 -v be verbose (list job parameters)
60
61 %(progname)s -h
62 -h display this help
63""" % locals()
64
65try:
66 import getopt
65 opts, args = getopt.getopt(sys.argv[1:], '-cd:efhlq:v')
67 opts, args = getopt.getopt(sys.argv[1:], '-cd:efhj:lq:v')
66except getopt.GetoptError:
67 sys.exit(usage)
68
69clean = False
70onlyecho = False
71exprs = []
72force = False
73listonly = False
74queue = ''
75verbose = False
76rootdir = nfspath(os.getcwd())
68except getopt.GetoptError:
69 sys.exit(usage)
70
71clean = False
72onlyecho = False
73exprs = []
74force = False
75listonly = False
76queue = ''
77verbose = False
78rootdir = nfspath(os.getcwd())
79jfile = 'test.py'
77for opt,arg in opts:
78 if opt == '-c':
79 clean = True
80 if opt == '-d':
81 rootdir = arg
82 if opt == '-e':
83 onlyecho = True
84 if opt == '-f':
85 force = True
86 if opt == '-h':
87 print usage
88 sys.exit(0)
80for opt,arg in opts:
81 if opt == '-c':
82 clean = True
83 if opt == '-d':
84 rootdir = arg
85 if opt == '-e':
86 onlyecho = True
87 if opt == '-f':
88 force = True
89 if opt == '-h':
90 print usage
91 sys.exit(0)
92 if opt == '-j':
93 jfile = arg
89 if opt == '-l':
90 listonly = True
91 if opt == '-q':
92 queue = arg
93 if opt == '-v':
94 verbose = True
95
96basedir = joinpath(rootdir, 'Base')

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

110
111 base = joinpath(basedir, entry)
112 if not isfile(base) or not filecmp(link, base):
113 print 'Base/%s is different than Link/%s: copying' % (entry, entry)
114 copyfile(link, base)
115
116import job, jobfile, pbs
117
94 if opt == '-l':
95 listonly = True
96 if opt == '-q':
97 queue = arg
98 if opt == '-v':
99 verbose = True
100
101basedir = joinpath(rootdir, 'Base')

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

115
116 base = joinpath(basedir, entry)
117 if not isfile(base) or not filecmp(link, base):
118 print 'Base/%s is different than Link/%s: copying' % (entry, entry)
119 copyfile(link, base)
120
121import job, jobfile, pbs
122
118test = jobfile.JobFile(joinpath(basedir, 'test.py'))
123test = jobfile.JobFile(joinpath(basedir, jfile))
119
120joblist = []
121for jobname in test.jobs:
122 if not exprs:
123 joblist.append(jobname)
124 continue
125
126 for expr in exprs:

--- 64 unchanged lines hidden ---
124
125joblist = []
126for jobname in test.jobs:
127 if not exprs:
128 joblist.append(jobname)
129 continue
130
131 for expr in exprs:

--- 64 unchanged lines hidden ---