diff options
Diffstat (limited to 'util')
-rw-r--r-- | util/pbs/jobfile.py | 15 | ||||
-rwxr-xr-x | util/tracediff | 13 |
2 files changed, 20 insertions, 8 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 = {} diff --git a/util/tracediff b/util/tracediff index 402abbe55..87210f1ed 100755 --- a/util/tracediff +++ b/util/tracediff @@ -51,12 +51,15 @@ $sim2 = shift; # be given to both invocations $simargs = '"' . join('" "', @ARGV) . '"'; -# Redirect config output to cout so that gets diffed too (in case -# that's the source of the problem). -$simargs .= " --root:config_output_file=cout"; +# Run individual invocations in separate dirs so output and intermediate +# files (particularly config.py and config.ini) don't conflict. +$dir1 = "tracediff-$$-1"; +$dir2 = "tracediff-$$-2"; +mkdir($dir1) or die "Can't create dir $dir1\n"; +mkdir($dir2) or die "Can't create dir $dir2\n"; -$cmd1 = "$sim1 $simargs --stats:text_file=tracediff-$$-1.stats 2>&1 |"; -$cmd2 = "$sim2 $simargs --stats:text_file=tracediff-$$-2.stats 2>&1 |"; +$cmd1 = "$sim1 $simargs -d $dir1 2>&1 |"; +$cmd2 = "$sim2 $simargs -d $dir2 2>&1 |"; # This only works if you have rundiff in your path. I just edit it # with an explicit path if necessary. |