From eae0c8f9166ee6725b8b96dcebda7d0c575cedd1 Mon Sep 17 00:00:00 2001
From: Florent Pruvost <florent.pruvost@inria.fr>
Date: Thu, 6 Mar 2025 16:50:55 +0100
Subject: [PATCH] benchs: update

---
 .gitlab-ci.yml            |  9 ++++++++-
 scripts/plafrim_level1.sh |  2 +-
 scripts/plafrim_level2.sh | 13 +++++++------
 scripts/plafrim_level3.sh |  8 +++-----
 4 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 40a9a9996..6369be08d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -83,12 +83,19 @@ benchmark:
   tags: ['plafrim']
   #extends: .only-main-mr
   needs: []
+  variables:
+    CI_HOSTNAME: zonda
+  cache:
+    key: "$CI_JOB_NAME_SLUG-$CI_COMMIT_REF_SLUG"
+    paths:
+      - build
   script:
     - ./scripts/plafrim_level1.sh
   artifacts:
     when: always
     paths:
-      - bench.sqlite3
+      - ./*.out
+      - ./*.sqlite3
       - ./*.csv
 
 pages:
diff --git a/scripts/plafrim_level1.sh b/scripts/plafrim_level1.sh
index 391c279fe..5a57490ed 100755
--- a/scripts/plafrim_level1.sh
+++ b/scripts/plafrim_level1.sh
@@ -2,7 +2,7 @@
 set -x
 
 # Submit slurm jobs
-sbatch --wait --job-name=scalfmm --output=scalfmm.out --nodes=1 --time=01:00:00 --constraint=suroit --exclusive --ntasks-per-node=1 ./scripts/plafrim_level2.sh
+sbatch --wait --job-name=scalfmm --output=scalfmm.out --nodes=1 --time=03:00:00 --constraint=$CI_HOSTNAME --exclusive --ntasks-per-node=1 ./scripts/plafrim_level2.sh
 err=$?
 
 cat scalfmm.out
diff --git a/scripts/plafrim_level2.sh b/scripts/plafrim_level2.sh
index d8cd9781d..4c90657ea 100755
--- a/scripts/plafrim_level2.sh
+++ b/scripts/plafrim_level2.sh
@@ -2,19 +2,20 @@
 set -x
 
 # to avoid a lock during fetching git branches in parallel
-export XDG_CACHE_HOME=/tmp/guix-$$
+#export XDG_CACHE_HOME=/tmp/guix-$$
 
 # save guix commits
+#guix describe --format=json > guix.json
 guix time-machine -C .guix/scalfmm-channels.scm -- describe --format=json > guix.json
 
-exec guix time-machine -C .guix/scalfmm-channels.scm -- shell \
-       --pure --preserve="^CI|proxy$|^SLURM" \
-       -m .guix/scalfmm-manifest-gcc-mkl-bench.scm \
-       -- /bin/bash --norc ./scripts/plafrim_level3.sh
+#exec guix shell --pure --preserve="^CI|proxy$|^SLURM" \
+exec guix time-machine -C .guix/scalfmm-channels.scm -- shell --pure --preserve="^CI|proxy$|^SLURM" \
+  -m .guix/scalfmm-manifest-gcc-mkl-bench.scm \
+  -- /bin/bash --norc ./scripts/plafrim_level3.sh
 err=$?
 
 # clean tmp
-rm -rf /tmp/guix-$$
+#rm -rf /tmp/guix-$$
 
 # exit with error code from the guix command
 exit $err
diff --git a/scripts/plafrim_level3.sh b/scripts/plafrim_level3.sh
index c4179019e..c03be9767 100755
--- a/scripts/plafrim_level3.sh
+++ b/scripts/plafrim_level3.sh
@@ -19,12 +19,10 @@ if [[ -z "${CI_HOSTNAME}" ]]; then
 fi
 
 # configuration and compilation
-#if [ -d build ]; then
-#  rm build -r
-#fi
 cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-O3 -march=native" -Dscalfmm_BUILD_BENCH=ON -Dscalfmm_USE_MKL=ON
-cmake --build build --target fmm-computation-seq
-cmake --build build --target fmm-computation-omp
+cmake --build build --target fmm-computation-seq &
+cmake --build build --target fmm-computation-omp &
+wait
 export SCALFMM_EXE_DIR=$PWD/build/bench/Release
 
 # clean old benchmarks
-- 
GitLab