From 304d343a02bbda54af084ac6b2e63c214f499c3e Mon Sep 17 00:00:00 2001
From: Jayesh Badwaik <j.badwaik@fz-juelich.de>
Date: Tue, 18 Feb 2025 07:57:14 +0100
Subject: [PATCH] + plotting scripts

---
 .gitlab-ci.yml   | 42 ++++++++++++++++++++++++++++++++++++++++++
 benchmark.yml    |  6 +++---
 post/plotting.py | 31 +++++++++++++++++++++++++++++++
 3 files changed, 76 insertions(+), 3 deletions(-)
 create mode 100644 .gitlab-ci.yml
 create mode 100644 post/plotting.py

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..b286478
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,42 @@
+
+
+
+powercap-measurement:
+  variables:
+    CUSTOM_CI_BUILDS_DIR: $[[inputs.build_dir]]
+  id_tokens:
+    SITE_ID_TOKEN:
+      aud: "https://gitlab.jsc.fz-juelich.de"
+  tags:
+    - jedi
+    - jacamar
+    - login
+    - shell
+  script:
+    - module load JUBE
+    - export JUBE_INCLUDE_PATH=$PWD/jube
+    - |
+      jutil env activate \
+        --project cjsc \
+        --budget zam \
+        --reservation test-alvarez-jpbot-001-22
+    - jube-autorun -r "-e --outpath ../outpath" benchmark.yml
+    - jube result --style csv ../outpath > benchmark.csv
+
+
+powercap-plotting:
+  image: registry.jsc.fz-juelich.de/exacb/docker/report:latest
+  tags:
+    - docker
+  needs:
+    - job: powercap-measurement
+      artifacts: true
+  artifacts:
+    paths:
+      - benchmark.pdf
+  script:
+    - python -m venv venv
+    - source venv/bin/activate
+    - pip install matplotlib
+    - python post/plotting.py --input benchmark.csv --output benchmark.pdf
+
diff --git a/benchmark.yml b/benchmark.yml
index 37b85e3..c6a8f4c 100644
--- a/benchmark.yml
+++ b/benchmark.yml
@@ -12,7 +12,7 @@ parameterset:
   - name: benchParam
     parameter:
       - name: inputpowercap
-        _: "100, 200, 300"
+        _: "100, 120, 140, 160, 180, 200, 220, 240, 260, 280, 300"
   - name: systemParam
     init_with: "platform.xml:systemParameter"
     parameter:
@@ -31,7 +31,7 @@ parameterset:
     parameter:
     - name: args_starter
       _: "--cpu-bind=none"
-  
+
 step:
   - name: build
     use:
@@ -69,7 +69,7 @@ patternset:
       - name: performance
         _: ${jube_pat_int}
 
-        
+
 analyser:
   - name: bench_info
     analyse:
diff --git a/post/plotting.py b/post/plotting.py
new file mode 100644
index 0000000..cb976b2
--- /dev/null
+++ b/post/plotting.py
@@ -0,0 +1,31 @@
+#!/usr/bin/env python3
+
+
+import matplotlib.pyplot
+import csv
+import argparse
+
+
+if __name__ == "__main__":
+    parser = argparse.ArgumentParser()
+    parser.add_argument("--input", help="input file")
+    parser.add_argument("--output", help="output file")
+    args = parser.parse_args()
+    filename = args.input
+
+    x = []
+    y = []
+
+    with open(filename) as f:
+        plots = csv.reader(f, delimiter=",")
+        for row in plots:
+            x.append(int(row[0]))
+            y.append(int(row[1]))
+
+    fig, ax = matplotlib.pyplot.subplots()
+    ax.plot(x, y)
+    ax.set(xlabel="power", ylabel="performance", title="Graph")
+    matplotlib.pyplot.savefig(args.output)
+
+
+
-- 
GitLab