qdo (1891:6d62abcc7456) | qdo (1930:d7836f59a02c) |
---|---|
1#! /usr/bin/env python 2 3# Copyright (c) 2004-2005 The Regents of The University of Michigan 4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions are 8# met: redistributions of source code must retain the above copyright --- 31 unchanged lines hidden (view full) --- 40optparser = optparse.OptionParser(usage=usage) 41optparser.allow_interspersed_args=False 42optparser.add_option('-e', dest='stderr_file', 43 help='command stderr output file') 44optparser.add_option('-o', dest='stdout_file', 45 help='command stdout output file') 46optparser.add_option('-l', dest='save_log', action='store_true', 47 help='save qsub output log file') | 1#! /usr/bin/env python 2 3# Copyright (c) 2004-2005 The Regents of The University of Michigan 4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions are 8# met: redistributions of source code must retain the above copyright --- 31 unchanged lines hidden (view full) --- 40optparser = optparse.OptionParser(usage=usage) 41optparser.allow_interspersed_args=False 42optparser.add_option('-e', dest='stderr_file', 43 help='command stderr output file') 44optparser.add_option('-o', dest='stdout_file', 45 help='command stdout output file') 46optparser.add_option('-l', dest='save_log', action='store_true', 47 help='save qsub output log file') |
48optparser.add_option('-q', dest='qsub_timeout', type='int', | 48optparser.add_option('-N', dest='job_name', 49 help='qsub job name') 50optparser.add_option('-q', dest='dest_queue', 51 help='qsub destination queue') 52optparser.add_option('--qwait', dest='qsub_timeout', type='int', |
49 help='qsub queue wait timeout', default=30*60) 50optparser.add_option('-t', dest='cmd_timeout', type='int', 51 help='command execution timeout', default=600*60) 52 53(options, cmd) = optparser.parse_args() 54 55if cmd == []: 56 print >>sys.stderr, "%s: missing command" % progname 57 sys.exit(1) 58 | 53 help='qsub queue wait timeout', default=30*60) 54optparser.add_option('-t', dest='cmd_timeout', type='int', 55 help='command execution timeout', default=600*60) 56 57(options, cmd) = optparser.parse_args() 58 59if cmd == []: 60 print >>sys.stderr, "%s: missing command" % progname 61 sys.exit(1) 62 |
63if not options.job_name: 64 options.job_name = cmd[0] 65 |
|
59cwd = os.getcwd() 60 61# Deal with systems where /n is a symlink to /.automount 62if cwd.startswith('/.automount/'): 63 cwd = cwd.replace('/.automount/', '/n/', 1) 64 65if not cwd.startswith('/n/poolfs/'): 66 print >>sys.stderr, "Error: current directory must be under /n/poolfs." --- 65 unchanged lines hidden (view full) --- 132# Hack to do link on poolfs... disabled for now since 133# compiler/linker/library versioning problems between poolfs and 134# nodes. May never work since poolfs is x86-64 and nodes are 32-bit. 135if False and len(cmd) > 50: 136 shell_cmd = 'ssh -t poolfs /bin/sh -l' 137 print "%s: running %s on poolfs" % (progname, cmd[0]) 138else: 139 shell_cmd = 'qsub -I -S /bin/sh' | 66cwd = os.getcwd() 67 68# Deal with systems where /n is a symlink to /.automount 69if cwd.startswith('/.automount/'): 70 cwd = cwd.replace('/.automount/', '/n/', 1) 71 72if not cwd.startswith('/n/poolfs/'): 73 print >>sys.stderr, "Error: current directory must be under /n/poolfs." --- 65 unchanged lines hidden (view full) --- 139# Hack to do link on poolfs... disabled for now since 140# compiler/linker/library versioning problems between poolfs and 141# nodes. May never work since poolfs is x86-64 and nodes are 32-bit. 142if False and len(cmd) > 50: 143 shell_cmd = 'ssh -t poolfs /bin/sh -l' 144 print "%s: running %s on poolfs" % (progname, cmd[0]) 145else: 146 shell_cmd = 'qsub -I -S /bin/sh' |
147 shell_cmd += ' -N "%s"' % options.job_name 148 if options.dest_queue: 149 shell_cmd += ' -q ' + options.dest_queue |
|
140 141shell = Shell(shell_cmd) 142 143try: 144 # chdir to cwd 145 (output, status) = shell.do_command('cd ' + cwd) 146 147 if status != 0: --- 58 unchanged lines hidden --- | 150 151shell = Shell(shell_cmd) 152 153try: 154 # chdir to cwd 155 (output, status) = shell.do_command('cd ' + cwd) 156 157 if status != 0: --- 58 unchanged lines hidden --- |