summaryrefslogtreecommitdiff
path: root/test/genini.py
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2005-02-09 23:55:21 -0500
committerNathan Binkert <binkertn@umich.edu>2005-02-09 23:55:21 -0500
commit8efd7d90633520b93c4bfba93d248b9c9bd8fe5a (patch)
treed952ee7e4615b1f5cab93fdb9bf68a5fda87b670 /test/genini.py
parent4a3e33fb6d2e13a0febd9696905da05e02f93834 (diff)
downloadgem5-8efd7d90633520b93c4bfba93d248b9c9bd8fe5a.tar.xz
More fixes to the pbs stuff to make it more robust.
sim/pyconfig/SConscript: Embed the jobfile.py script into the binary so that we don't need to copy it into the Base directory every time. test/genini.py: Add the util/pbs directory to the path so we can get to jobfile.py Add a -I argument to set to add to the path. util/pbs/pbs.py: Create a MyPOpen class. This is a lot like the popen2.Popen3 class in the python library except that my version allows redirection of standard in and standard out to a file instead of a pipe. Use this popen class to execute qsub or ssh qsub. This was important for the ssh version of qsub because we need to pipe the script into standard in of ssh so that the script can get to the qsub command. (Otherwise we have a problem discovering the path.) util/pbs/send.py: Tweak the script so it figures out paths in NFS correctly. Use the new system for running qsub. --HG-- extra : convert_revision : 1289915ba99cec6fd464b71215c32d2197ff2824
Diffstat (limited to 'test/genini.py')
-rw-r--r--test/genini.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/test/genini.py b/test/genini.py
index 0dac0d409..73e7012f6 100644
--- a/test/genini.py
+++ b/test/genini.py
@@ -31,23 +31,26 @@ from os.path import join as joinpath, realpath
mypath = sys.path[0]
sys.path.append(joinpath(mypath, '..'))
sys.path.append(joinpath(mypath, '../configs/kernel'))
+sys.path.append(joinpath(mypath, '../util/pbs'))
sys.path.append(joinpath(mypath, '../sim/pyconfig'))
from importer import mpy_exec, mpy_execfile, AddToPath
from m5config import *
try:
- opts, args = getopt.getopt(sys.argv[1:], '-E:')
- for o,a in opts:
- if o == '-E':
- offset = a.find('=')
+ opts, args = getopt.getopt(sys.argv[1:], '-E:I:')
+ for opt,arg in opts:
+ if opt == '-E':
+ offset = arg.find('=')
if offset == -1:
- name = a
+ name = arg
value = True
else:
- name = a[:offset]
- value = a[offset+1:]
+ name = arg[:offset]
+ value = arg[offset+1:]
env[name] = value
+ if opt == '-I':
+ AddToPath(arg)
except getopt.GetoptError:
sys.exit('Improper Usage')