Преглед изворни кода

Added scripts for collecting timing data.

The scripts are currently designed for running cudadl on a single node with multiple workers.
Steven Engler пре 8 година
родитељ
комит
ce3141f7e1
2 измењених фајлова са 67 додато и 0 уклоњено
  1. 25 0
      run_timing_multiprocess.sh
  2. 42 0
      summarize_data_multiprocess.py

+ 25 - 0
run_timing_multiprocess.sh

@@ -0,0 +1,25 @@
+#!/bin/bash
+#
+DATA_PATH="/home/sengler/data-multiprocess"
+PORT=42000
+#
+for i in 44 46 48 50 52 54 56 58 60 62 64 66 68 70 74 78 82 84 72 76 80 86 88 ; do
+    echo "Starting ${i}..."
+    ./gen_N 1536 $i > "${DATA_PATH}/N_${i}" 2> /dev/null
+    #
+    ./controller -p $PORT -n 1 -m 240 "${DATA_PATH}/N_${i}" 1 > "${DATA_PATH}/controller_${i}" 2>&1 &
+    CONTROLLER_PID=$!
+    trap "kill $CONTROLLER_PID ; exit" SIGINT
+    echo "Started Controller"
+    #
+    sleep 5
+    #
+    ./dpnode 127.0.1.1 $PORT > "${DATA_PATH}/dpnode_${i}" 2>&1 &
+    echo "Started DPNode"
+    #
+    for j in 0 1 2 3 4 5 6 7; do
+        ./worker 127.0.1.1 $PORT $j > "${DATA_PATH}/worker_${i}_${j}" 2>&1 &
+    done
+    #
+    wait $CONTROLLER_PID
+done

+ 42 - 0
summarize_data_multiprocess.py

@@ -0,0 +1,42 @@
+#!/usr/bin/env python3
+#
+import statistics
+import numpy as np
+import matplotlib.pylab as plt
+#
+sizes = [44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 74, 78, 82, 84]
+files = ['/home/steve/documents/cudadl-data/multiprocess/controller_{}'.format(x) for x in sizes]
+#
+avg_launch_count = []
+#
+for fname in files:
+	launch_counts = []
+	#
+	with open(fname, 'r') as f:
+		for line in f:
+			if line.startswith('Timing'):
+				data = line.split(':', 1)[-1]
+				launch_counts.append(int(data.split(',')[3].strip()))
+			#
+		#
+	#
+	launch_counts.pop(int(len(launch_counts)/2)-1)
+	launch_counts.pop()
+	# remove the middle and last subproblems
+	# (they correspond to the final subproblems for p and q)
+	#
+	avg_launch_count.append(statistics.mean(launch_counts))
+#
+B = 2**np.array(sizes, dtype='object')
+#
+plt.semilogx(B, avg_launch_count, '.-', basex=2)
+plt.xticks(B)
+plt.xlabel('B')
+plt.ylabel('Avg Number of Kernel Launches')
+plt.show()
+#
+plt.loglog(B, avg_launch_count, '.-', basey=2, basex=2)
+plt.xticks(B)
+plt.xlabel('B')
+plt.ylabel('Avg Number of Kernel Launches')
+plt.show()