Merge vm1.(none):/home/stever/bk/newmem-head
[gem5.git] / util / qdo
index 9593ed5ed4852a9bdee04ce34ed130c39dae159f..92e4605b128ff73ea37376c946df95e577ce7cd8 100755 (executable)
--- a/util/qdo
+++ b/util/qdo
@@ -25,6 +25,8 @@
 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Authors: Steve Reinhardt
 
 import sys
 import os
@@ -60,8 +62,11 @@ if cmd == []:
     print >>sys.stderr, "%s: missing command" % progname
     sys.exit(1)
 
-if not options.job_name:
-    options.job_name = cmd[0]
+# If we want to do this, need to add check here to make sure cmd[0] is
+# a valid PBS job name, else qsub will die on us.
+#
+#if not options.job_name:
+#    options.job_name = cmd[0]
 
 cwd = os.getcwd()
 
@@ -96,7 +101,7 @@ class Shell(pexpect.spawn):
             self.expect('\$ ', options.qsub_timeout)
         except pexpect.TIMEOUT:
             print >>sys.stderr, "%s: qsub timed out." % progname
-            self.kill(15)
+            self.kill(9)
             self.close(wait=True)
             sys.exit(1)
         self.do_command('unset PROMPT_COMMAND; PS1="qdo$ "')
@@ -144,7 +149,8 @@ if False and len(cmd) > 50:
     print "%s: running %s on poolfs" % (progname, cmd[0])
 else:
     shell_cmd = 'qsub -I -S /bin/sh'
-    shell_cmd += ' -N "%s"' % options.job_name
+    if options.job_name:
+        shell_cmd += ' -N "%s"' % options.job_name
     if options.dest_queue:
         shell_cmd += ' -q ' + options.dest_queue
 
@@ -175,10 +181,10 @@ try:
 
     if output_dir:
         secs_waited = 0
-        while not shell.dir_exists(output_dir) and secs_waited < 45:
+        while not shell.dir_exists(output_dir) and secs_waited < 90:
             time.sleep(5)
             secs_waited += 5
-        if secs_waited > 10:
+        if secs_waited > 30:
             print "waited", secs_waited, "seconds for", output_dir
 
     # run command