summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Dreslinski <rdreslin@umich.edu>2005-03-07 18:04:49 -0500
committerRon Dreslinski <rdreslin@umich.edu>2005-03-07 18:04:49 -0500
commita99607863fd80a1a81c29aa3d24553ece2ab8d47 (patch)
treeb25af3861f8fd520c3af5c783a361987cba61578
parentb290ecf1bb0d3d65f4f2ddd72e0273a203d36243 (diff)
parent2b89c38172cafd0abc9b0f0b0e5db0ff3f398232 (diff)
downloadgem5-a99607863fd80a1a81c29aa3d24553ece2ab8d47.tar.xz
Merge zizzer:/z/m5/Bitkeeper/m5
into zizzer.eecs.umich.edu:/.automount/zazzer/z/rdreslin/m5bk/timing_L1 --HG-- extra : convert_revision : 34c73338a0552b59d4264a1cbc091ad3fc9a3a41
-rw-r--r--util/pbs/jobfile.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/util/pbs/jobfile.py b/util/pbs/jobfile.py
index 570faa61b..83eb81358 100644
--- a/util/pbs/jobfile.py
+++ b/util/pbs/jobfile.py
@@ -26,7 +26,9 @@
#
# Authors: Nathan Binkert
-from os.path import expanduser
+from os.path import expanduser, isfile, join as joinpath
+import sys
+
def crossproduct(options):
number = len(options)
indexes = [ 0 ] * number
@@ -49,9 +51,16 @@ def crossproduct(options):
done = next()
class JobFile(object):
- def __init__(self, file):
+ def __init__(self, jfile):
self.data = {}
- execfile(expanduser(file), self.data)
+ jfile = expanduser(jfile)
+ if not isfile(jfile):
+ for p in sys.path:
+ if isfile(joinpath(p, jfile)):
+ jfile = joinpath(p, jfile)
+ break
+
+ execfile(jfile, self.data)
self.options = self.data['options']
self.environment = self.data['environment']
self.jobinfo = {}