Commits

Alex Turcu committed 878c307

Scripts (core count, etc)

  • Participants
  • Parent commits 322b109
  • Branches checkpoints

Comments (0)

Files changed (3)

File bin/analyze.py

+#!/usr/bin/python
 from tables import *
 import numpy
 import os.path
     def __init__(self, h5name = "tests.h5", reset=False):
         if os.path.exists(h5name) and not reset:
             self.h5 = openFile(h5name, mode="a")
-            self.group = self.h5.root.main1
+            self.group = self.h5.root.main2
             self.table = self.group.tests
         else:
             self.h5 = openFile(h5name, mode="w", title="Hyflow2 tests file")
-            self.group = self.h5.createGroup("/", 'main1', 'Main Group 1')
+            self.group = self.h5.createGroup("/", 'main2', 'Main Group 2')
             self.table = self.h5.createTable(self.group, "tests", HyTest, "First table")
         self.row = self.table.row
     
     plot_dict(mean, line, label)
 
 def main():
-    plot_series('(tag == "netty local")', "b-", "local 0ms")
-    plot_series('(tag == "netty distrib")', "c-", "3pc 0ms")
+    #plot_series('(tag == "netty local")', "b-", "local 0ms")
+    #plot_series('(tag == "netty distrib")', "c-", "3pc 0ms")
     
-    plot_series('(tag == "hynetty local")', "k-", "local 1ms")
-    plot_series('(tag == "hynetty distrib")', "r-", "3pc 1ms")
+    #plot_series('(tag == "hynetty local")', "k-", "local 1ms")
+    #plot_series('(tag == "hynetty distrib")', "r-", "3pc 1ms")
+    
+    plot_series('(hyflow_logging_testId == "\\\"sweep-bench inc-cttn\\\"") & (bench == "bank")', "k-", "flat")
+    plot_series('(hyflow_logging_testId == "\\\"sweep-check inc-cttn\\\"") & (bench == "cp-bank")', "b-", "cp")
     
     pylab.legend(loc="best")
     pylab.show()
 
 if __name__ == "__main__":
-    hy = HyTests(reset=True)
-    gather_results("result-lost.txt", hy.row)
-    gather_results("result-yoshi.txt", hy.row)
-    gather_results("result-luigi.txt", hy.row)
-    hy.h5.flush()
+    hy = HyTests(reset=False)
+    #gather_results("result-lost.txt", hy.row)
+    #gather_results("result-rosella.txt", hy.row)
+    #hy.h5.flush()
     
     main()
     #print set(hy.table.cols.tag[:])

File bin/distrib.py

         if "-/+ buffers/cache:" in ln:
             return ln.split()[3]
 
+# Return the number of cores
+__num_cores = None
+def num_cores():
+	global __num_cores
+	if __num_cores == None:
+		f = open("/proc/cpuinfo", "rt")
+		for line in f:
+			if line.startswith("processor"):
+				res = int(line.split(":")[1].strip())
+		__num_cores = res + 1
+	return __num_cores
+
 
 
 
         cmd = line.split(">")
         if cmd[0] == "run-get-mem":
             self.sendLine("run-mem>%s" % getFreeMem())
+        elif cmd[0] == "run-get-cores":
+            self.sendLine("run-cores>%d" % num_cores()) 
         elif cmd[0] == "run-cmd":
             # start thread to run process
             runner = ProgramRunner(cmd[1], self)
     elif args.terminate:
         p.sendLine("term")
     elif args.run:
-        p.sendLine("run-get-mem")
+        # TODO: Change here to determine distribution based on avi mem or cpu cores
+        if False:
+            p.sendLine("run-get-mem")
+        else:
+            p.sendLine("run-get-cores")
     else:
         raise Exception("Unknown command")
 

File bin/hytest.py

 	startup.add_argument("-s", "--spawn", type=int, default=num_cores(), help="Number of nodes to spawn on this machine.")
 	startup.add_argument("-f", "--offset", type=int, default=0, help="Number of nodes previously started on other machines.")
 	startup.add_argument("--no-taskset", default=False, action="store_true", help="Disable CPU affinity setting.")
+	startup.add_argument("--cores", default=1, type=int, help="Number of cores for each spawned node.")
 	startup.add_argument("--no-run", default=False, action="store_true", help="Do not actually run benchmark, just print commands.")
 	startup.add_argument("--time-out", type=int, default=200, help="Seconds after which the test is forcefully stopped.")
 	startup.add_argument("--presets", type=str, default="", help="Common configuration shorcuts. Choose from: %s" % PRESETS)
 		args.spawn = args.nodes - args.offset
 	
 	# Check number of nodes to launch
-	if args.spawn > num_cores():
-		print("Warning: Spawning more nodes than available cores.")
+	if args.spawn * args.cores > num_cores():
+		print("Warning: More cores required than available.")
 		args.no_taskset = True
 	
 	# Spawn nodes
 		else:
 			cmd = JAVA_CMD + ["-jar", find_jar() ] + make_args(args, node)
 		if not args.no_taskset:
-			cmd = ["taskset", "-c", str(crt_core)] + cmd
-			crt_core += 1
+			cmd = ["taskset", "-c", "%d-%d" % (crt_core, crt_core + arg.cores - 1)] + cmd
+			crt_core += arg.cores
 		if args.no_run:
 			print cmd
 			print(" ".join(cmd))