send.py (1948:04aebfd9acf3) | send.py (1956:e9447a75c009) |
---|---|
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; --- 65 unchanged lines hidden (view full) --- 74 copy(src, dest) 75 76progpath = nfspath(sys.path[0]) 77progname = basename(sys.argv[0]) 78usage = """\ 79Usage: 80 %(progname)s [-c] [-e] [-f] [-j <jobfile>] [-q queue] [-v] <regexp> 81 -c clean directory if job can be run | 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; --- 65 unchanged lines hidden (view full) --- 74 copy(src, dest) 75 76progpath = nfspath(sys.path[0]) 77progname = basename(sys.argv[0]) 78usage = """\ 79Usage: 80 %(progname)s [-c] [-e] [-f] [-j <jobfile>] [-q queue] [-v] <regexp> 81 -c clean directory if job can be run |
82 -C submit the checkpointing runs 83 -d Make jobs be dependent on the completion of the checkpoint runs |
|
82 -e only echo pbs command info, don't actually send the job 83 -f force the job to run regardless of state 84 -q <queue> submit job to the named queue 85 -j <jobfile> specify the jobfile (default is <rootdir>/Test.py) 86 -v be verbose 87 88 %(progname)s [-j <jobfile>] -l [-v] <regexp> 89 -j <jobfile> specify the jobfile (default is <rootdir>/Test.py) 90 -l list job names, don't submit 91 -v be verbose (list job parameters) 92 93 %(progname)s -h 94 -h display this help 95""" % locals() 96 97try: 98 import getopt | 84 -e only echo pbs command info, don't actually send the job 85 -f force the job to run regardless of state 86 -q <queue> submit job to the named queue 87 -j <jobfile> specify the jobfile (default is <rootdir>/Test.py) 88 -v be verbose 89 90 %(progname)s [-j <jobfile>] -l [-v] <regexp> 91 -j <jobfile> specify the jobfile (default is <rootdir>/Test.py) 92 -l list job names, don't submit 93 -v be verbose (list job parameters) 94 95 %(progname)s -h 96 -h display this help 97""" % locals() 98 99try: 100 import getopt |
99 opts, args = getopt.getopt(sys.argv[1:], '-Ccdefhj:lnq:Rt:v') | 101 opts, args = getopt.getopt(sys.argv[1:], '-Ccdefhj:lq:Rt:v') |
100except getopt.GetoptError: 101 sys.exit(usage) 102 103depend = False 104clean = False 105onlyecho = False 106exprs = [] 107force = False 108listonly = False 109queue = '' 110verbose = False 111jfile = 'Test.py' 112docpts = False 113doruns = True 114runflag = False 115node_type = 'FAST' | 102except getopt.GetoptError: 103 sys.exit(usage) 104 105depend = False 106clean = False 107onlyecho = False 108exprs = [] 109force = False 110listonly = False 111queue = '' 112verbose = False 113jfile = 'Test.py' 114docpts = False 115doruns = True 116runflag = False 117node_type = 'FAST' |
116update = True | |
117 118for opt,arg in opts: 119 if opt == '-C': 120 docpts = True 121 if opt == '-c': 122 clean = True 123 if opt == '-d': 124 depend = True 125 if opt == '-e': 126 onlyecho = True 127 if opt == '-f': 128 force = True 129 if opt == '-h': 130 print usage 131 sys.exit(0) 132 if opt == '-j': 133 jfile = arg 134 if opt == '-l': 135 listonly = True | 118 119for opt,arg in opts: 120 if opt == '-C': 121 docpts = True 122 if opt == '-c': 123 clean = True 124 if opt == '-d': 125 depend = True 126 if opt == '-e': 127 onlyecho = True 128 if opt == '-f': 129 force = True 130 if opt == '-h': 131 print usage 132 sys.exit(0) 133 if opt == '-j': 134 jfile = arg 135 if opt == '-l': 136 listonly = True |
136 if opt == '-n': 137 update = False | |
138 if opt == '-q': 139 queue = arg 140 if opt == '-R': 141 runflag = True 142 if opt == '-t': 143 node_type = arg 144 if opt == '-v': 145 verbose = True --- 4 unchanged lines hidden (view full) --- 150for arg in args: 151 exprs.append(re.compile(arg)) 152 153import jobfile, pbs 154from job import JobDir, date 155 156conf = jobfile.JobFile(jfile) 157 | 137 if opt == '-q': 138 queue = arg 139 if opt == '-R': 140 runflag = True 141 if opt == '-t': 142 node_type = arg 143 if opt == '-v': 144 verbose = True --- 4 unchanged lines hidden (view full) --- 149for arg in args: 150 exprs.append(re.compile(arg)) 151 152import jobfile, pbs 153from job import JobDir, date 154 155conf = jobfile.JobFile(jfile) 156 |
158if update and not listonly and not onlyecho and isdir(conf.linkdir): | 157if not listonly and not onlyecho and isdir(conf.linkdir): |
159 if verbose: 160 print 'Checking for outdated files in Link directory' 161 if not isdir(conf.basedir): 162 os.mkdir(conf.basedir) 163 syncdir(conf.linkdir, conf.basedir) 164 165jobnames = {} 166joblist = [] --- 124 unchanged lines hidden --- | 158 if verbose: 159 print 'Checking for outdated files in Link directory' 160 if not isdir(conf.basedir): 161 os.mkdir(conf.basedir) 162 syncdir(conf.linkdir, conf.basedir) 163 164jobnames = {} 165joblist = [] --- 124 unchanged lines hidden --- |