summaryrefslogtreecommitdiffstats
path: root/testsuites/smptests/smpopenmp01/smpopenmp01.py
diff options
context:
space:
mode:
Diffstat (limited to 'testsuites/smptests/smpopenmp01/smpopenmp01.py')
-rw-r--r--testsuites/smptests/smpopenmp01/smpopenmp01.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/testsuites/smptests/smpopenmp01/smpopenmp01.py b/testsuites/smptests/smpopenmp01/smpopenmp01.py
new file mode 100644
index 0000000000..139aedd4af
--- /dev/null
+++ b/testsuites/smptests/smpopenmp01/smpopenmp01.py
@@ -0,0 +1,42 @@
+#!/usr/bin/env python
+
+#
+# Copyright (c) 2017 embedded brains GmbH. All rights reserved.
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.rtems.org/license/LICENSE.
+#
+
+import re
+import libxml2
+from libxml2 import xmlNode
+import matplotlib.pyplot as plt
+data = open('smpopenmp01.scn').read()
+data = re.sub(r'\*\*\*.*', '', data)
+doc = libxml2.parseDoc(data)
+ctx = doc.xpathNewContext()
+
+plt.title('OpenMP Microbench')
+plt.xlabel('Number of Threads')
+plt.ylabel('Relative Duration')
+
+def m(n):
+ return float(n.getContent())
+
+def p(bench):
+ d = map(m, ctx.xpathEval('/SMPOpenMP01/Microbench/' + bench))
+ y = [x / d[0] for x in d]
+ x = range(1, len(y) + 1)
+ plt.xticks(x)
+ plt.plot(x, y, label = bench, marker = 'o')
+
+p('BarrierBench')
+p('ParallelBench')
+p('StaticBench')
+p('DynamicBench')
+p('GuidedBench')
+p('RuntimeBench')
+p('SingleBench')
+plt.legend(loc = 'best')
+plt.show()