config: enable setting SE-mode environment variables from file
authorbpotter <brandon.potter@amd.com>
Thu, 23 Apr 2015 20:40:18 +0000 (13:40 -0700)
committerbpotter <brandon.potter@amd.com>
Thu, 23 Apr 2015 20:40:18 +0000 (13:40 -0700)
configs/common/Options.py
configs/example/se.py

index 45292b24909d3f4d9a14b4e6be74354a10861035..35d453d24d379484f219aaac41f33833d2eae0cc 100644 (file)
@@ -234,6 +234,8 @@ def addSEOptions(parser):
     parser.add_option("-o", "--options", default="",
                       help="""The options to pass to the binary, use " "
                               around the entire string""")
+    parser.add_option("-e", "--env", default="",
+                      help="Initialize workload environment from text file.")
     parser.add_option("-i", "--input", default="",
                       help="Read stdin from a file.")
     parser.add_option("--output", default="",
index a582d29762de571c5ed2a3a464e57c05dda12595..5357ed7a200f4a312853453e2d30f87db7afb83c 100644 (file)
@@ -94,6 +94,10 @@ def get_processes(options):
         process.executable = wrkld
         process.cwd = os.getcwd()
 
+        if options.env:
+            with open(options.env, 'r') as f:
+                process.env = [line.rstrip() for line in f]
+
         if len(pargs) > idx:
             process.cmd = [wrkld] + pargs[idx].split()
         else: