From 6eaa4d3571e340598a2ddd03c8479d0bc993bde2 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Wed, 9 Feb 2005 13:40:02 -0500 Subject: fix indent (so emacs and vi aren't screwed up.) --HG-- extra : convert_revision : 589f37476fec14aa5e3c6e018631e291113d4e69 --- sim/pyconfig/m5config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sim/pyconfig') diff --git a/sim/pyconfig/m5config.py b/sim/pyconfig/m5config.py index 4e3a4103c..c9bfdab54 100644 --- a/sim/pyconfig/m5config.py +++ b/sim/pyconfig/m5config.py @@ -28,9 +28,9 @@ from __future__ import generators import os, re, sys, types noDot = False try: - import pydot + import pydot except: - noDot = True + noDot = True env = {} env.update(os.environ) -- cgit v1.2.3 From 89ba024b9843719bf06a9c3efaaf1b137dee2a12 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Wed, 9 Feb 2005 13:41:53 -0500 Subject: Fix the panic message so that it looks more like M5's panic. Make it so the same path is not added to the system path twice. --HG-- extra : convert_revision : fe18db38cc4e335ad3525a364e9f8faf62b60e52 --- sim/pyconfig/m5config.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sim/pyconfig') diff --git a/sim/pyconfig/m5config.py b/sim/pyconfig/m5config.py index c9bfdab54..bbd437b30 100644 --- a/sim/pyconfig/m5config.py +++ b/sim/pyconfig/m5config.py @@ -36,11 +36,12 @@ env = {} env.update(os.environ) def panic(*args, **kwargs): - sys.exit(*args, **kwargs) + print >>sys.stderr, 'panic:', string + sys.exit(1) def AddToPath(path): path = os.path.realpath(path) - if os.path.isdir(path): + if os.path.isdir(path) and path not in sys.path: sys.path.append(path) def Import(path): -- cgit v1.2.3 From 8efd7d90633520b93c4bfba93d248b9c9bd8fe5a Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Wed, 9 Feb 2005 23:55:21 -0500 Subject: 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 --- sim/pyconfig/SConscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sim/pyconfig') diff --git a/sim/pyconfig/SConscript b/sim/pyconfig/SConscript index 5708ac9a8..9154d3b99 100644 --- a/sim/pyconfig/SConscript +++ b/sim/pyconfig/SConscript @@ -170,7 +170,7 @@ EmbedMap %(name)s("%(fname)s", /* namespace */ } ''' -embedded_py_files = ['m5config.py'] +embedded_py_files = ['m5config.py', '../../util/pbs/jobfile.py'] objpath = os.path.join(env['SRCDIR'], 'objects') for root, dirs, files in os.walk(objpath, topdown=True): for i,dir in enumerate(dirs): -- cgit v1.2.3 From 60b263466e35139ee2c773cac6c96622be990fda Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Fri, 11 Feb 2005 01:40:49 -0500 Subject: Make sure we have all values when trying to generate the ini file sim/pyconfig/m5config.py: When getting all values, make sure we get the ones that are parameter defaults as well. --HG-- extra : convert_revision : 2b1c4b2f27dfab17ef9df18d7e5936e4a00bb12e --- sim/pyconfig/m5config.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sim/pyconfig') diff --git a/sim/pyconfig/m5config.py b/sim/pyconfig/m5config.py index bbd437b30..9a48e2fa4 100644 --- a/sim/pyconfig/m5config.py +++ b/sim/pyconfig/m5config.py @@ -350,6 +350,13 @@ class MetaConfigNode(type): for p,v in c._values.iteritems(): if not values.has_key(p): values[p] = v + for p,v in c._params.iteritems(): + if not values.has_key(p) and hasattr(v, 'default'): + v.valid(v.default) + v = v.default + cls._setvalue(p, v) + values[p] = v + return values def _getvalue(cls, name, default = AttributeError): -- cgit v1.2.3