From 03146198a084f3e594d4a44f61e86d7ec85b05f8 Mon Sep 17 00:00:00 2001 From: Florent Pruvost <florent.pruvost@inria.fr> Date: Fri, 7 Mar 2025 11:11:57 +0100 Subject: [PATCH] benchs: database scalfmm.sqlite3 must be updated serially --- .gitlab-ci.yml | 13 +++++++++++++ scripts/database.sh | 37 +++++++++++++++++++++++++++++++++++++ scripts/plafrim_level3.sh | 36 +++--------------------------------- 3 files changed, 53 insertions(+), 33 deletions(-) create mode 100755 scripts/database.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1adfc8d1e..51ab17c61 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -98,6 +98,19 @@ benchmark: when: always paths: - ./*.log + - ./*.csv + - ./scripts/results/ + +database: + stage: deploy + tags: ['plafrim'] + #extends: .only-main-mr + needs: ['benchmark'] + script: + - ./scripts/database.sh + artifacts: + when: always + paths: - ./*.sqlite3 - ./*.csv diff --git a/scripts/database.sh b/scripts/database.sh new file mode 100755 index 000000000..ddf0fde3e --- /dev/null +++ b/scripts/database.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -ex + +# get current database file scalfmm.sqlite3 stored on gitlab +if [[ ! -z "${CI_JOB_TOKEN}" ]]; then + export PACKAGEID=`curl --header "JOB-TOKEN: $CI_JOB_TOKEN" "https://gitlab.inria.fr/api/v4/projects/$CI_PROJECT_ID/packages" |jq '.[0].id'` + if [[ "${PACKAGEID}" != "null" ]]; then + export FILEID=`curl --header "JOB-TOKEN: $CI_JOB_TOKEN" "https://gitlab.inria.fr/api/v4/projects/$CI_PROJECT_ID/packages/$PACKAGEID/package_files" |jq '.[0].id'` + if [[ "${FILEID}" != "null" ]]; then + curl --header "JOB-TOKEN: $CI_JOB_TOKEN" "https://gitlab.inria.fr/api/v4/projects/$CI_PROJECT_ID/packages/generic/benchmark/latest/scalfmm.sqlite3" -o scalfmm.sqlite3 + fi + fi +fi + +# update scalfmm.sqlite3 database, tables : accuracy, timeseq, timeomp +jube result scripts/results --id 1 -o accuracy +jube result scripts/results --id 2 -o timeseq +jube result scripts/results --id 3 -o timeomp + +# upload updated scalfmm.sqlite3 on gitlab +if [[ ! -z "${CI_JOB_TOKEN}" ]]; then + # get package id of the database stored on gitlab + export PACKAGEID=`curl --header "JOB-TOKEN: $CI_JOB_TOKEN" "https://gitlab.inria.fr/api/v4/projects/$CI_PROJECT_ID/packages" |jq '.[0].id'` + if [[ "${PACKAGEID}" != "null" ]]; then + # get file id of the database on gitlab + export FILEID=`curl --header "JOB-TOKEN: $CI_JOB_TOKEN" "https://gitlab.inria.fr/api/v4/projects/$CI_PROJECT_ID/packages/$PACKAGEID/package_files" |jq '.[0].id'` + if [[ "${FILEID}" != "null" ]]; then + # delete previous database version on gitlab if exists + curl --request DELETE --header "JOB-TOKEN: $CI_JOB_TOKEN" "https://gitlab.inria.fr/api/v4/projects/$CI_PROJECT_ID/packages/$PACKAGEID/package_files/$FILEID" + fi + fi + curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ./scalfmm.sqlite3 "https://gitlab.inria.fr/api/v4/projects/$CI_PROJECT_ID/packages/generic/benchmark/latest/scalfmm.sqlite3" +fi + +# send results to the elasticsearch server +#ls guix.json +#python3 script/add_result.py -e https://elasticsearch.bordeaux.inria.fr -t concace -p "scalfmm" scalfmm.csv diff --git a/scripts/plafrim_level3.sh b/scripts/plafrim_level3.sh index 523cd38aa..bd3e8dbcc 100755 --- a/scripts/plafrim_level3.sh +++ b/scripts/plafrim_level3.sh @@ -25,17 +25,6 @@ if [ -d scripts/results ]; then rm scripts/results -r fi -# get current database file scalfmm.sqlite3 stored on gitlab -if [[ ! -z "${CI_JOB_TOKEN}" ]]; then - export PACKAGEID=`curl --header "JOB-TOKEN: $CI_JOB_TOKEN" "https://gitlab.inria.fr/api/v4/projects/$CI_PROJECT_ID/packages" |jq '.[0].id'` - if [[ "${PACKAGEID}" != "null" ]]; then - export FILEID=`curl --header "JOB-TOKEN: $CI_JOB_TOKEN" "https://gitlab.inria.fr/api/v4/projects/$CI_PROJECT_ID/packages/$PACKAGEID/package_files" |jq '.[0].id'` - if [[ "${FILEID}" != "null" ]]; then - curl --header "JOB-TOKEN: $CI_JOB_TOKEN" "https://gitlab.inria.fr/api/v4/projects/$CI_PROJECT_ID/packages/generic/benchmark/latest/scalfmm.sqlite3" -o scalfmm.sqlite3 - fi - fi -fi - # configuration cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-O3 -march=native" -Dscalfmm_BUILD_BENCH=ON -Dscalfmm_USE_MKL=ON @@ -53,7 +42,7 @@ case "${CI_BENCHMARK}" in jube result scripts/results --id 1 -o accuracy_csv > scalfmm_accuracy.csv cat scalfmm_accuracy.csv # update scalfmm.sqlite3 database, table accuracy - jube result scripts/results --id 1 -o accuracy + #jube result scripts/results --id 1 -o accuracy ;; timeseq) echo "CI_BENCHMARK is set to timeseq." @@ -62,7 +51,7 @@ case "${CI_BENCHMARK}" in jube analyse scripts/results --id 2 jube result scripts/results --id 2 -o timeseq_csv > scalfmm_timeseq.csv cat scalfmm_timeseq.csv - jube result scripts/results --id 2 -o timeseq + #jube result scripts/results --id 2 -o timeseq ;; timeomp) echo "CI_BENCHMARK is set to timeomp." @@ -71,29 +60,10 @@ case "${CI_BENCHMARK}" in jube analyse scripts/results --id 3 jube result scripts/results --id 3 -o timeomp_csv > scalfmm_timeomp.csv cat scalfmm_timeomp.csv - jube result scripts/results --id 3 -o timeomp + #jube result scripts/results --id 3 -o timeomp ;; *) echo "CI_BENCHMARK is set to an unknown value." exit 1 ;; esac - -# upload updated scalfmm.sqlite3 on gitlab -if [[ ! -z "${CI_JOB_TOKEN}" ]]; then - # get package id of the database stored on gitlab - export PACKAGEID=`curl --header "JOB-TOKEN: $CI_JOB_TOKEN" "https://gitlab.inria.fr/api/v4/projects/$CI_PROJECT_ID/packages" |jq '.[0].id'` - if [[ "${PACKAGEID}" != "null" ]]; then - # get file id of the database on gitlab - export FILEID=`curl --header "JOB-TOKEN: $CI_JOB_TOKEN" "https://gitlab.inria.fr/api/v4/projects/$CI_PROJECT_ID/packages/$PACKAGEID/package_files" |jq '.[0].id'` - if [[ "${FILEID}" != "null" ]]; then - # delete previous database version on gitlab if exists - curl --request DELETE --header "JOB-TOKEN: $CI_JOB_TOKEN" "https://gitlab.inria.fr/api/v4/projects/$CI_PROJECT_ID/packages/$PACKAGEID/package_files/$FILEID" - fi - fi - curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ./scalfmm.sqlite3 "https://gitlab.inria.fr/api/v4/projects/$CI_PROJECT_ID/packages/generic/benchmark/latest/scalfmm.sqlite3" -fi - -# send results to the elasticsearch server -#ls guix.json -#python3 script/add_result.py -e https://elasticsearch.bordeaux.inria.fr -t concace -p "scalfmm" scalfmm.csv -- GitLab