resources: (parsec) explicitly specifying number of threads

Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Change-Id: I141c01d4e5b17a344e852c8f4aa5b5e0c5f62161
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5-resources/+/42281
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: Bobby R. Bruce <bbruce@ucdavis.edu>
diff --git a/src/parsec/configs-mesi-two-level/run_parsec_mesi_two_level.py b/src/parsec/configs-mesi-two-level/run_parsec_mesi_two_level.py
index e58c014..ebee1b0 100755
--- a/src/parsec/configs-mesi-two-level/run_parsec_mesi_two_level.py
+++ b/src/parsec/configs-mesi-two-level/run_parsec_mesi_two_level.py
@@ -50,7 +50,7 @@
 
 from system import *
 
-def writeBenchScript(dir, bench, size):
+def writeBenchScript(dir, bench, size, num_cpus):
     """
     This method creates a script in dir which will be eventually
     passed to the simulated system (to run a specific benchmark
@@ -61,7 +61,7 @@
     bench_file.write('cd /home/gem5/parsec-benchmark\n')
     bench_file.write('source env.sh\n')
     bench_file.write('parsecmgmt -a run -p \
-            {} -c gcc-hooks -i {}\n'.format(bench, size))
+            {} -c gcc-hooks -i {} -n {}\n'.format(bench, size, num_cpus))
 
     # sleeping for sometime makes sure
     # that the benchmark's output has been
@@ -86,7 +86,7 @@
 
     # Create and pass a script to the simulated system to run the reuired
     # benchmark
-    system.readfile = writeBenchScript(m5.options.outdir, benchmark, size)
+    system.readfile = writeBenchScript(m5.options.outdir, benchmark, size, num_cpus)
 
     # set up the root SimObject and start the simulation
     root = Root(full_system = True, system = system)
diff --git a/src/parsec/configs/run_parsec.py b/src/parsec/configs/run_parsec.py
index e654f3d..65ccb63 100644
--- a/src/parsec/configs/run_parsec.py
+++ b/src/parsec/configs/run_parsec.py
@@ -47,7 +47,7 @@
 
 from system import *
 
-def writeBenchScript(dir, bench, size):
+def writeBenchScript(dir, bench, size, num_cpus):
     """
     This method creates a script in dir which will be eventually
     passed to the simulated system (to run a specific benchmark
@@ -58,7 +58,7 @@
     bench_file.write('cd /home/gem5/parsec-benchmark\n')
     bench_file.write('source env.sh\n')
     bench_file.write('parsecmgmt -a run -p \
-            {} -c gcc-hooks -i {}\n'.format(bench, size))
+            {} -c gcc-hooks -i {} -n {}\n'.format(bench, size, num_cpus))
 
     # sleeping for sometime makes sure
     # that the benchmark's output has been
@@ -83,7 +83,8 @@
 
     # Create and pass a script to the simulated system to run the reuired
     # benchmark
-    system.readfile = writeBenchScript(m5.options.outdir, benchmark, size)
+    system.readfile = writeBenchScript(m5.options.outdir, benchmark, size,
+                                       num_cpus)
 
     # set up the root SimObject and start the simulation
     root = Root(full_system = True, system = system)