Browse Source

Keeping plots up-to-date with current

Stan Gurtler 2 years ago
parent
commit
aa56cdeb13

BIN
prsona/plt/epoch-lambda-bandwidth-all-2.pdf


BIN
prsona/plt/epoch-lambda-cpu-all-2.pdf


BIN
prsona/plt/epoch-servers-bandwidth-half-50.pdf


BIN
prsona/plt/epoch-servers-cpu-half-50.pdf


BIN
prsona/plt/epoch-workloads-bandwidth-2-50.pdf


BIN
prsona/plt/epoch-workloads-bandwidth-25-50.pdf


BIN
prsona/plt/epoch-workloads-cpu-2-50.pdf


BIN
prsona/plt/loglog-epoch-workloads-bandwidth-2-50.pdf


BIN
prsona/plt/loglog-epoch-workloads-cpu-2-50.pdf


+ 62 - 5
prsona/plt/plots.json

@@ -11,6 +11,19 @@
         "fileNameStr": "epoch-workloads-cpu-2-50",
         "legendLoc": "upper left"
     },
+    {
+        "data": "server",
+        "dataParts": ["", "2", "", "50"],
+        "lineVariable": "workload",
+        "xVariable": "numClients",
+        "whichGraph": "overall_epoch_cpu",
+        "xLabel": "Number of clients",
+        "yLabel": "CPU time to calculate an epoch (s)",
+        "loglog": true,
+        "title": "Comparing CPU time for epochs across workloads",
+        "fileNameStr": "loglog-epoch-workloads-cpu-2-50",
+        "legendLoc": "upper left"
+    },
     {
         "data": "server",
         "dataParts": ["", "2", "", "50"],
@@ -19,6 +32,32 @@
         "whichGraph": "overall_epoch_total",
         "xLabel": "Number of clients",
         "yLabel": "Data sent/received to calculate an epoch (B)",
+        "loglog": true,
+        "title": "Comparing bandwidth for epochs across workloads",
+        "fileNameStr": "loglog-epoch-workloads-bandwidth-2-50",
+        "legendLoc": "upper left"
+    },
+    {
+        "data": "server",
+        "dataParts": ["", "", "25", "50"],
+        "lineVariable": "workload",
+        "xVariable": "numServers",
+        "whichGraph": "overall_epoch_total",
+        "xLabel": "Number of servers",
+        "yLabel": "Data sent/received to calculate an epoch (B)",
+        "title": "Comparing bandwidth for epochs across workloads",
+        "fileNameStr": "epoch-workloads-bandwidth-25-50",
+        "legendLoc": "upper left"
+    },
+    {
+        "data": "server",
+        "dataParts": ["", "2", "", "50"],
+        "lineVariable": "workload",
+        "xVariable": "numClients",
+        "whichGraph": "overall_epoch_total",
+        "xLabel": "Number of clients",
+        "yLabel": "Data sent/received to calculate an epoch (MB)",
+        "yUnit": "MB",
         "title": "Comparing bandwidth for epochs across workloads",
         "fileNameStr": "epoch-workloads-bandwidth-2-50",
         "legendLoc": "upper left"
@@ -42,7 +81,8 @@
         "xVariable": "numClients",
         "whichGraph": "overall_epoch_total",
         "xLabel": "Number of clients",
-        "yLabel": "Data sent/received to calculate an epoch (B)",
+        "yLabel": "Data sent/received to calculate an epoch (MB)",
+        "yUnit": "MB",
         "title": "Comparing bandwidth for epochs across numbers of servers",
         "fileNameStr": "epoch-servers-bandwidth-half-50",
         "legendLoc": "upper left"
@@ -67,7 +107,8 @@
         "xVariable": "numClients",
         "whichGraph": "overall_epoch_total",
         "xLabel": "Number of clients",
-        "yLabel": "Data sent/received to calculate an epoch (B)",
+        "yLabel": "Data sent/received to calculate an epoch (MB)",
+        "yUnit": "MB",
         "title": "Comparing bandwidth for epochs\nacross different values of lambda",
         "fileNameStr": "epoch-lambda-bandwidth-all-2",
         "legendLoc": "upper left"
@@ -92,7 +133,8 @@
         "xVariable": "numClients",
         "whichGraph": "vote_total",
         "xLabel": "Number of clients",
-        "yLabel": "Data sent/received to make a new vote row (B)",
+        "yLabel": "Data sent/received to make a new vote row (KB)",
+        "yUnit": "KB", 
         "title": "Comparing bandwidth for making vote rows\nacross different values of lambda",
         "fileNameStr": "vote-lambda-bandwidth-2",
         "legendLoc": "upper left"
@@ -118,7 +160,8 @@
         "xVariable": "numClients",
         "whichGraph": "rep_prove_total",
         "xLabel": "Number of clients",
-        "yLabel": "Data sent/received to make a new reputation proof (B)",
+        "yLabel": "Data sent/received to make a new reputation proof (KB)",
+        "yUnit": "KB", 
         "title": "Comparing bandwidth for making reputation proofs\nacross different values of lambda",
         "fileNameStr": "rep_prove-lambda-bandwidth-2",
         "legendLoc": "lower right",
@@ -145,10 +188,24 @@
         "xVariable": "numClients",
         "whichGraph": "rep_verify_total",
         "xLabel": "Number of clients",
-        "yLabel": "Data sent/received to verify a new reputation proof (B)",
+        "yLabel": "Data sent/received to verify a new reputation proof (KB)",
+        "yUnit": "KB", 
         "title": "Comparing bandwidth for verifying reputation proofs\nacross different values of lambda",
         "fileNameStr": "rep_verify-lambda-bandwidth-2",
         "legendLoc": "lower right",
         "legendBBoxAnchor": [1, 0]
+    },
+    {
+        "data": "server",
+        "dataParts": ["all", "", "", "50"],
+        "lineVariable": "numServers",
+        "xVariable": "numClients",
+        "whichGraph": "vote_update_cpu",
+        "xLabel": "Number of clients",
+        "yLabel": "CPU time to verify a new vote row proof (s)",
+        "title": "Comparing CPU time for verifying vote row proofs\nacross different numbers of servers",
+        "fileNameStr": "vote_update_cpu-numServers-numClients-50",
+        "legendLoc": "lower right",
+        "legendBBoxAnchor": [1, 0]
     }
 ]

BIN
prsona/plt/rep_prove-lambda-bandwidth-2.pdf


BIN
prsona/plt/rep_prove-lambda-cpu-2.pdf


BIN
prsona/plt/rep_verify-lambda-bandwidth-2.pdf


BIN
prsona/plt/rep_verify-lambda-cpu-2.pdf


BIN
prsona/plt/vote-lambda-bandwidth-2.pdf


BIN
prsona/plt/vote-lambda-cpu-2.pdf


BIN
prsona/plt/vote_update_cpu-numServers-numClients-50.pdf


+ 30 - 23
prsona/scripts/make_graphs.py

@@ -343,11 +343,12 @@ def plotComparison(data, dataParts, xVariable, lineVariable, whichGraph, **kwarg
     title = kwargs['title'] if 'title' in kwargs else ''
     xLabel = kwargs['xLabel'] if 'xLabel' in kwargs else ''
     yLabel = kwargs['yLabel'] if 'yLabel' in kwargs else ''
+    yUnit = kwargs['yUnit'] if 'yUnit' in kwargs else ''
     fileNameStr = kwargs['fileNameStr'] if 'fileNameStr' in kwargs else f"basic-{xVariable}-{lineVariable}-{whichGraph}"
     legendLoc = kwargs['legendLoc'] if 'legendLoc' in kwargs else "best"
     legendBBoxAnchor = kwargs['legendBBoxAnchor'] if 'legendBBoxAnchor' in kwargs else (0, 1)
     extraFit = kwargs['extraFit'] if 'extraFit' in kwargs else False
-    loglog = kwargs['loglog'] if 'loglog' in kwargs else True
+    loglog = kwargs['loglog'] if 'loglog' in kwargs else False
     yLim = kwargs['yLim'] if 'yLim' in kwargs else False
     aspect = kwargs['aspect'] if 'aspect' in kwargs else None
 
@@ -416,32 +417,32 @@ def plotComparison(data, dataParts, xVariable, lineVariable, whichGraph, **kwarg
                 if len(curr_data) == 0:
                     continue
 
-                mean = np.mean(curr_data)
-                std = np.std(curr_data)
-                sqrt_len = sqrt(len(curr_data))
+                dividing_factor = 1
+                if yUnit == 'KB':
+                    dividing_factor = 1024.0
+                if yUnit == 'MB':
+                    dividing_factor = 1024.0 * 1024.0
+
+                if lineVariable == 'numServers':
+                    dividing_factor = dividing_factor * selection
+                else:
+                    dividing_factor = dividing_factor * int(dataParts[1])
+
+                used_data = [x / dividing_factor for x in curr_data]
+
+                mean = np.mean(used_data)
+                std = np.std(used_data)
+                sqrt_len = sqrt(len(used_data))
 
                 xs.append(x)
                 ys.append(mean)
                 yErrs.append(z_star * std / sqrt_len)
-
-                if lineVariable == 'numServers' and selection > 2:
-                    additional_data = [x / selection * 2 for x in curr_data]
-                    additional_mean = np.mean(additional_data)
-                    additional_std = np.std(additional_data)
-
-                    additionalYs.append(additional_mean)
-                    additionalYErrs.append(z_star * additional_std / sqrt_len)
             except KeyError as e:
                 pass
 
         if len(xs) > 1:
             line, _, _ = ax.errorbar(xs, ys, yerr=yErrs, capsize=7.0, label=legend, marker=marker, linestyle='-', color=color)
 
-            if lineVariable == 'numServers' and selection > 2:
-                addlLegend = PLOT_OPTIONS[lineVariable][selection + 0.5]['legend']
-                addlMarker = PLOT_OPTIONS[lineVariable][selection + 0.5]['marker']
-                addlColor = PLOT_OPTIONS[lineVariable][selection + 0.5]['color']
-                line, _, _ = ax.errorbar(xs, additionalYs, yerr=additionalYErrs, capsize=7.0, label=addlLegend, marker=addlMarker, linestyle='-', color=addlColor)
             if extraFit:
                 popt, pcov = curve_fit(genericCube, xs, ys)
                 beyondXs = np.linspace(xs[-1], 100, 50)
@@ -451,12 +452,16 @@ def plotComparison(data, dataParts, xVariable, lineVariable, whichGraph, **kwarg
     ax.set_xlabel(xLabel, fontsize='large')
     ax.set_ylabel(yLabel, fontsize='large')
 
-    bottom, top = ax.get_ylim()
-    bottom = (0 if bottom > 0 else bottom)
-    ax.set_ylim(bottom=bottom)
-    if top > 100000:
-        yTickLabels = ['{:2g}'.format(x) for x in ax.get_yticks().tolist()]
-        ax.set_yticklabels(yTickLabels)
+    if loglog:
+        ax.set_yscale("log")
+        ax.set_xscale("log")
+    else:
+        bottom, top = ax.get_ylim()
+        bottom = (0 if bottom > 0 else bottom)
+        ax.set_ylim(bottom=bottom)
+        if top > 100000:
+            yTickLabels = ['{:2g}'.format(x) for x in ax.get_yticks().tolist()]
+            ax.set_yticklabels(yTickLabels)
 
     if yLim:
         ax.set_ylim(bottom=yLim[0], top=yLim[1])
@@ -496,6 +501,8 @@ def main(dataDirectory, plotOptionsFile):
             kwargs["xLabel"] = option["xLabel"]
         if "yLabel" in option:
             kwargs["yLabel"] = option["yLabel"]
+        if "yUnit" in option:
+            kwargs["yUnit"] = option["yUnit"]
         if "extraFit" in option:
             kwargs["extraFit"] = option["extraFit"]
         if "fileNameStr" in option: