From a64662421161fab23f8e15c65399c87d959ec7a0 Mon Sep 17 00:00:00 2001
From: Mathieu Faverge <mathieu.faverge@inria.fr>
Date: Fri, 11 Oct 2019 15:09:06 +0200
Subject: [PATCH] Upgrade CI

---
 .gitlab-ci.yml                  | 443 ++------------------------------
 .gitlab/bench_plafrim.yml       |  10 +
 .gitlab/build.yml               |  61 +++++
 .gitlab/common.yml              |  65 +++++
 .gitlab/coverage.yml            |  23 ++
 .gitlab/coverity.yml            |  29 +++
 .gitlab/pages.yml               |  24 ++
 .gitlab/release.yml             |  18 ++
 .gitlab/sonarqube.yml           |  22 ++
 .gitlab/test_openmp.yml         |  56 ++++
 .gitlab/test_parsec.yml         |  88 +++++++
 .gitlab/test_quark.yml          |  56 ++++
 .gitlab/test_starpu.yml         | 104 ++++++++
 .gitlab/test_starpu_simgrid.yml |  34 +++
 CTestConfig.cmake               |   2 +-
 tools/analysis.sh               |  18 +-
 tools/find_sources.sh           |  17 +-
 17 files changed, 633 insertions(+), 437 deletions(-)
 create mode 100644 .gitlab/bench_plafrim.yml
 create mode 100644 .gitlab/build.yml
 create mode 100644 .gitlab/common.yml
 create mode 100644 .gitlab/coverage.yml
 create mode 100644 .gitlab/coverity.yml
 create mode 100644 .gitlab/pages.yml
 create mode 100644 .gitlab/release.yml
 create mode 100644 .gitlab/sonarqube.yml
 create mode 100644 .gitlab/test_openmp.yml
 create mode 100644 .gitlab/test_parsec.yml
 create mode 100644 .gitlab/test_quark.yml
 create mode 100644 .gitlab/test_starpu.yml
 create mode 100644 .gitlab/test_starpu_simgrid.yml

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 520725253..efa9f6a20 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,3 +1,4 @@
+---
 stages:
   - build
   - test
@@ -9,434 +10,20 @@ before_script:
   - source .gitlab-ci-env.sh $SIMU
   - mkdir -p build-$VERSION
 
-.build_script_template: &build_script
-  image: hpclib/hiepacs
-  stage: build
-  tags: ["large"]
-  script:
-    - echo BUILD_OPTIONS $BUILD_OPTIONS
-    - echo VERSION $VERSION
-    - (cd build-$VERSION &&
-       scan-build -plist --intercept-first --exclude CMakeFiles --analyze-headers -o analyzer_reports
-       cmake -C ../cmake_modules/gitlab-ci-initial-cache.cmake .. $BUILD_OPTIONS &&
-       scan-build -plist --intercept-first --exclude CMakeFiles --analyze-headers -o analyzer_reports
-       ctest --no-compress-output -V -j 5
-             -D ExperimentalBuild
-             -D ExperimentalSubmit
-             | tee ../chameleon_${VERSION}.log)
-    - (cd build-$VERSION &&
-       make install | tee -a ../chameleon_${VERSION}.log &&
-       rm install/ -r)
-  except:
-    - schedules
+include:
+  - .gitlab/common.yml
+  - .gitlab/build.yml
+  - .gitlab/test_starpu.yml
+  - .gitlab/test_starpu_simgrid.yml
+  - .gitlab/test_parsec.yml
+  - .gitlab/test_quark.yml
+  - .gitlab/test_openmp.yml
+  - .gitlab/coverage.yml
+  - .gitlab/coverity.yml
+  - .gitlab/sonarqube.yml
+  - .gitlab/bench_plafrim.yml
+  - .gitlab/pages.yml
+  - .gitlab/release.yml
 
-.test_script_template: &test_script
-  image: hpclib/hiepacs
-  stage: test
-  tags: ["large"]
-  script:
-    - echo TESTS_RESTRICTION $TESTS_RESTRICTION
-    - echo VERSION $VERSION
-    - (cd build-$VERSION &&
-       eval "ctest --no-compress-output -V
-             $TESTS_RESTRICTION
-             -D ExperimentalTest
-             -D ExperimentalCoverage
-             -D ExperimentalSubmit
-             | tee -a ../chameleon_${VERSION}.log")
-    - lcov --directory build-$VERSION --capture --output-file ./chameleon_${VERSION}.lcov
-  except:
-    - schedules
 
-build_openmp:
-  <<: *build_script
-  artifacts:
-    name: build_openmp
-    expire_in: 48 hours
-    paths:
-      - build-$VERSION
-      - chameleon_openmp.log
-  variables:
-    BUILD_OPTIONS: "-DCHAMELEON_SCHED=OPENMP"
-    VERSION: openmp
 
-build_parsec:
-  <<: *build_script
-  artifacts:
-    name: build_parsec
-    expire_in: 48 hours
-    paths:
-      - build-$VERSION
-      - chameleon_parsec.log
-  variables:
-    BUILD_OPTIONS: "-DCHAMELEON_SCHED=PARSEC"
-    VERSION: parsec
-
-build_quark:
-  <<: *build_script
-  artifacts:
-    name: build_quark
-    expire_in: 48 hours
-    paths:
-      - build-$VERSION
-      - chameleon_quark.log
-  variables:
-    BUILD_OPTIONS: "-DCHAMELEON_SCHED=QUARK"
-    VERSION: quark
-
-build_starpu:
-  <<: *build_script
-  artifacts:
-    name: build_starpu
-    expire_in: 48 hours
-    paths:
-      - build-$VERSION
-      - chameleon_starpu.log
-  variables:
-    BUILD_OPTIONS: "-DCHAMELEON_USE_CUDA=ON -DCHAMELEON_USE_MPI=ON"
-    VERSION: starpu
-
-build_starpu_simgrid:
-  <<: *build_script
-  artifacts:
-    name: build_starpu_simgrid
-    expire_in: 48 hours
-    paths:
-      - build-$VERSION
-      - chameleon_starpu_simgrid.log
-  variables:
-    SIMU: simu
-    BUILD_OPTIONS: "-DCHAMELEON_SIMULATION=ON -DCHAMELEON_USE_CUDA=ON -DCHAMELEON_USE_MPI=OFF"
-    VERSION: starpu_simgrid
-
-test_openmp_branches:
-  <<: *test_script
-  variables:
-    TESTS_RESTRICTION: "-R \"test_shm_s|test_mpi_s\""
-    VERSION: openmp
-  dependencies:
-    - build_openmp
-  artifacts:
-    name: test_openmp
-    expire_in: 48 hours
-    paths:
-      - build-$VERSION
-      - chameleon_openmp.log
-      - chameleon_openmp.lcov
-  only:
-    - branches
-  except:
-    - master
-    - /^ci-.*$/
-    - schedules
-
-test_openmp_master:
-  <<: *test_script
-  variables:
-    TESTS_RESTRICTION: "-R \"_shm_|_mpi_\""
-    VERSION: openmp
-  dependencies:
-    - build_openmp
-  artifacts:
-    name: test_openmp
-    expire_in: 48 hours
-    paths:
-      - build-$VERSION
-      - chameleon_openmp.log
-      - chameleon_openmp.lcov
-  only:
-    - master@solverstack/chameleon
-    - /^ci-.*$/
-
-test_parsec_branches:
-  <<: *test_script
-  variables:
-    TESTS_RESTRICTION: "-R \"test_shm_s|test_mpi_s\""
-    VERSION: parsec
-  dependencies:
-    - build_parsec
-  artifacts:
-    name: test_parsec
-    expire_in: 48 hours
-    paths:
-      - build-$VERSION
-      - chameleon_parsec.log
-      - chameleon_parsec.lcov
-  only:
-    - branches
-  except:
-    - master
-    - /^ci-.*$/
-    - schedules
-
-test_parsec_master:
-  <<: *test_script
-  variables:
-    TESTS_RESTRICTION: "-R \"_shm_|_mpi_\""
-    VERSION: parsec
-  dependencies:
-    - build_parsec
-  artifacts:
-    name: test_parsec
-    expire_in: 48 hours
-    paths:
-      - build-$VERSION
-      - chameleon_parsec.log
-      - chameleon_parsec.lcov
-  only:
-    - master@solverstack/chameleon
-    - /^ci-.*$/
-
-test_quark_branches:
-  <<: *test_script
-  variables:
-    TESTS_RESTRICTION: "-R \"test_shm_s|test_mpi_s\""
-    VERSION: quark
-  dependencies:
-    - build_quark
-  artifacts:
-    name: test_quark
-    expire_in: 48 hours
-    paths:
-      - build-$VERSION
-      - chameleon_quark.log
-      - chameleon_quark.lcov
-  only:
-    - branches
-  except:
-    - master
-    - /^ci-.*$/
-    - schedules
-
-test_quark_master:
-  <<: *test_script
-  variables:
-    TESTS_RESTRICTION: "-R \"_shm_|_mpi_\""
-    VERSION: quark
-  dependencies:
-    - build_quark
-  artifacts:
-    name: test_quark
-    expire_in: 48 hours
-    paths:
-      - build-$VERSION
-      - chameleon_quark.log
-      - chameleon_quark.lcov
-  only:
-    - master@solverstack/chameleon
-    - /^ci-.*$/
-
-test_starpu_branches:
-  <<: *test_script
-  variables:
-    TESTS_RESTRICTION: "-R \"test_shm_s|test_mpi_s|time_ooc_shm_s|time_ooc_mpi_s\""
-    VERSION: starpu
-  dependencies:
-    - build_starpu
-  artifacts:
-    name: test_starpu
-    expire_in: 48 hours
-    paths:
-      - build-$VERSION
-      - chameleon_starpu.log
-      - chameleon_starpu.lcov
-  only:
-    - branches
-  except:
-    - master
-    - /^ci-.*$/
-    - schedules
-
-test_starpu_master:
-  <<: *test_script
-  variables:
-    TESTS_RESTRICTION: "-R \"_shm_|_mpi_\""
-    VERSION: starpu
-  dependencies:
-    - build_starpu
-  artifacts:
-    name: test_starpu
-    expire_in: 48 hours
-    paths:
-      - build-$VERSION
-      - chameleon_starpu.log
-      - chameleon_starpu.lcov
-  only:
-    - master@solverstack/chameleon
-    - /^ci-.*$/
-
-test_starpu_simgrid_branches:
-  <<: *test_script
-  variables:
-    SIMU: simu
-    TESTS_RESTRICTION: "-R simu"
-    VERSION: starpu_simgrid
-  dependencies:
-    - build_starpu_simgrid
-  artifacts:
-    name: test_starpu_simgrid
-    expire_in: 48 hours
-    paths:
-      - build-$VERSION
-      - chameleon_starpu_simgrid.log
-      - chameleon_starpu_simgrid.lcov
-  only:
-    - branches
-  except:
-    - master
-    - /^ci-.*$/
-    - schedules
-
-test_starpu_simgrid_master:
-  <<: *test_script
-  variables:
-    SIMU: simu
-    TESTS_RESTRICTION: "-R simu"
-    VERSION: starpu_simgrid
-  dependencies:
-    - build_starpu_simgrid
-  artifacts:
-    name: test_starpu_simgrid
-    expire_in: 48 hours
-    paths:
-      - build-$VERSION
-      - chameleon_starpu_simgrid.log
-      - chameleon_starpu_simgrid.lcov
-  only:
-    - master@solverstack/chameleon
-    - /^ci-.*$/
-  except:
-    - schedules
-
-bench_plafrim:
-  stage: test
-  tags: ['plafrim']
-  variables:
-    BUILD_OPTIONS: "-DCHAMELEON_USE_MPI=ON -DCMAKE_BUILD_TYPE=Release"
-    VERSION: miriel
-  script:
-    - (cd tools/bench/plafrim/miriel && ./run.sh)
-  only:
-    - schedules
-
-coverage:
-  image: hpclib/hiepacs
-  stage: analyse
-  dependencies:
-    - test_starpu_branches
-    - test_starpu_simgrid_branches
-    - test_quark_branches
-    - test_parsec_branches
-    - test_openmp_branches
-  script:
-      - lcov -a chameleon_starpu.lcov
-             -a chameleon_starpu_simgrid.lcov
-             -a chameleon_quark.lcov
-             -a chameleon_parsec.lcov
-             -a chameleon_openmp.lcov
-             -o chameleon.lcov
-      - lcov --summary chameleon.lcov
-  except:
-    - master
-    - /^ci-.*$/
-    - schedules
-
-.coverity:
-  image: hpclib/hiepacs
-  stage: analyse
-  tags: ["large"]
-  dependencies: []
-  artifacts:
-    name: chameleon_coverity
-    expire_in: 1 week
-    paths:
-      - chameleon.tgz
-  variables:
-    VERSION: coverity
-  script:
-    - (cd build-$VERSION &&
-       cmake -C ../cmake_modules/gitlab-ci-initial-cache.cmake .. -DCHAMELEON_USE_CUDA=ON -DCHAMELEON_USE_MPI=ON &&
-       cov-build --dir ../cov-int make -j 4)
-    - tar czvf chameleon.tgz cov-int
-    - curl --form token=$COVERITY_TOKEN
-           --form email=florent.pruvost@inria.fr
-           --form file=@chameleon.tgz
-           --form version="`git rev-parse --short HEAD`"
-           --form description=""
-           https://scan.coverity.com/builds?project=Chameleon
-  only:
-    - master@solverstack/chameleon
-  except:
-    - schedules
-
-sonarqube:
-  image: hpclib/hiepacs
-  stage: analyse
-  tags: ["large"]
-  dependencies:
-    - test_starpu_master
-    - test_starpu_simgrid_master
-    - test_quark_master
-    - test_parsec_master
-    - test_openmp_master
-  artifacts:
-    name: chameleon_analysis
-    expire_in: 1 week
-    paths:
-      - chameleon_build.log
-      - chameleon_coverage.xml
-      - chameleon_cppcheck.xml
-      - chameleon_rats.xml
-      - sonar.log
-  variables:
-    VERSION: sonarqube
-  script:
-    - cat *.log > chameleon_build.log
-    - ./tools/analysis.sh
-  only:
-    - master@solverstack/chameleon
-    - /^ci-.*$/
-  except:
-    - schedules
-
-pages:
-  image: hpclib/hiepacs
-  stage: deploy
-  dependencies: []
-  artifacts:
-    name: chameleon_doc
-    expire_in: 1 week
-    paths:
-      - public
-  variables:
-    VERSION: pages
-  script:
-    - cd build-$VERSION
-    - cmake .. -DCHAMELEON_ENABLE_DOC=ON
-    - make doc -j5
-    - mv doc/orgmode/ ../public/
-    - ln -s ../public/users_guide.html ../public/index.html
-    - mv doc/doxygen/out/html/ ../public/doxygen/
-  only:
-    - master@solverstack/chameleon
-    - /^ci-.*$/
-  except:
-    - schedules
-
-release:
-  image: hpclib/hiepacs
-  stage: deploy
-  dependencies: []
-  artifacts:
-    name: chameleon_release
-    expire_in: 1 week
-    paths:
-      - chameleon-*.tar.gz
-  variables:
-    VERSION: release
-  script:
-    - ./tools/release.sh
-  only:
-    - /^release-.*$/
-  except:
-    - schedules
diff --git a/.gitlab/bench_plafrim.yml b/.gitlab/bench_plafrim.yml
new file mode 100644
index 000000000..0542e3018
--- /dev/null
+++ b/.gitlab/bench_plafrim.yml
@@ -0,0 +1,10 @@
+bench_plafrim:
+  stage: test
+  tags: ['plafrim']
+  variables:
+    BUILD_OPTIONS: "-DCHAMELEON_USE_MPI=ON -DCMAKE_BUILD_TYPE=Release"
+    VERSION: miriel
+  script:
+    - (cd tools/bench/plafrim/miriel && ./run.sh)
+  only:
+    - schedules
diff --git a/.gitlab/build.yml b/.gitlab/build.yml
new file mode 100644
index 000000000..28217166a
--- /dev/null
+++ b/.gitlab/build.yml
@@ -0,0 +1,61 @@
+---
+build_openmp:
+  extends: .build_script_template
+  artifacts:
+    name: build_openmp
+    expire_in: 48 hours
+    paths:
+      - build-openmp
+      - chameleon_openmp.log
+  variables:
+    BUILD_OPTIONS: "-DCHAMELEON_SCHED=OPENMP"
+    VERSION: openmp
+
+build_parsec:
+  extends: .build_script_template
+  artifacts:
+    name: build_parsec
+    expire_in: 48 hours
+    paths:
+      - build-parsec
+      - chameleon_parsec.log
+  variables:
+    BUILD_OPTIONS: "-DCHAMELEON_SCHED=PARSEC"
+    VERSION: parsec
+
+build_quark:
+  extends: .build_script_template
+  artifacts:
+    name: build_quark
+    expire_in: 48 hours
+    paths:
+      - build-quark
+      - chameleon_quark.log
+  variables:
+    BUILD_OPTIONS: "-DCHAMELEON_SCHED=QUARK"
+    VERSION: quark
+
+build_starpu:
+  extends: .build_script_template
+  artifacts:
+    name: build_starpu
+    expire_in: 48 hours
+    paths:
+      - build-starpu
+      - chameleon_starpu.log
+  variables:
+    BUILD_OPTIONS: "-DCHAMELEON_USE_CUDA=ON -DCHAMELEON_USE_MPI=ON"
+    VERSION: starpu
+
+build_starpu_simgrid:
+  extends: .build_script_template
+  artifacts:
+    name: build_starpu_simgrid
+    expire_in: 48 hours
+    paths:
+      - build-starpu_simgrid
+      - chameleon_starpu_simgrid.log
+  variables:
+    SIMU: simu
+    BUILD_OPTIONS: "-DCHAMELEON_SIMULATION=ON -DCHAMELEON_USE_CUDA=ON -DCHAMELEON_USE_MPI=OFF"
+    VERSION: starpu_simgrid
diff --git a/.gitlab/common.yml b/.gitlab/common.yml
new file mode 100644
index 000000000..5960f8c8b
--- /dev/null
+++ b/.gitlab/common.yml
@@ -0,0 +1,65 @@
+#
+# This file describes the common rules for the stages
+#
+---
+.only-master:
+  only:
+    - master@solverstack/chameleon
+    - /^ci-.*$/
+
+.only-branches:
+  only:
+    - branches
+    - master@solverstack/chameleon
+    - /^ci-.*$/
+  except:
+    - master
+    - schedules
+
+.build_script_template:
+  image: hpclib/hiepacs
+  stage: build
+  tags: ["large"]
+  script:
+    - export LOGNAME=chameleon_${VERSION}.log
+    - echo $LOGNAME
+    - echo build BUILD_OPTIONS $BUILD_OPTIONS | tee -a ${LOGNAME}
+    - echo build VERSION       $VERSION       | tee -a ${LOGNAME}
+    - ls -l *.log
+    - (cd build-$VERSION &&
+       scan-build -plist --intercept-first --exclude CMakeFiles --analyze-headers -o analyzer_reports
+       cmake -C ../cmake_modules/gitlab-ci-initial-cache.cmake .. $BUILD_OPTIONS &&
+       scan-build -plist --intercept-first --exclude CMakeFiles --analyze-headers -o analyzer_reports
+       ctest --no-compress-output -V -j 5
+             -D ExperimentalBuild
+             -D ExperimentalSubmit
+             | tee ../${LOGNAME})
+    - (cd build-$VERSION &&
+       make install | tee -a ../${LOGNAME} &&
+       rm install/ -r)
+  except:
+    - schedules
+
+.test_script_template:
+  image: hpclib/hiepacs
+  stage: test
+  tags: ["large"]
+  script:
+    - export LOGNAME=chameleon_${VERSION}_${CATEGORY}_${PRECISION}
+    - echo $LOGNAME
+    - echo test TESTS_RESTRICTION $TESTS_RESTRICTION  | tee -a ${LOGNAME}.log
+    - echo test VERSION $VERSION     | tee -a ${LOGNAME}.log
+    - echo test CATEGORY $CATEGORY   | tee -a ${LOGNAME}.log
+    - echo test PRECISION $PRECISION | tee -a ${LOGNAME}.log
+    - ls -l *.log
+    - (cd build-$VERSION &&
+       eval "ctest --no-compress-output -V
+             $TESTS_RESTRICTION
+             -D ExperimentalTest
+             -D ExperimentalCoverage
+             -D ExperimentalSubmit
+             | tee -a ../${LOGNAME}.log")
+    - lcov --directory build-$VERSION --capture --output-file ./${LOGNAME}.lcov
+    - (cd build-$VERSION && lcov --directory . --capture --output-file ../bis_${LOGNAME}.lcov)
+  except:
+    - schedules
diff --git a/.gitlab/coverage.yml b/.gitlab/coverage.yml
new file mode 100644
index 000000000..17dd8dceb
--- /dev/null
+++ b/.gitlab/coverage.yml
@@ -0,0 +1,23 @@
+#
+# Rule to generate the full coverage of the testings in the branches.
+# Not used by the master, as it s done in the analysis script for sonarqube
+#
+# Rk: We do not take into account the simgrid lcov file for now, as it is empty with new testings
+#
+---
+coverage:
+  image: hpclib/hiepacs
+  stage: analyse
+  script:
+    - export INPUT_FILES=""
+    - for name in $( ls -1 chameleon_*.lcov | grep -v simgrid); do export INPUT_FILES="$INPUT_FILES -a $name"; done
+    - lcov $INPUT_FILES -o chameleon.lcov
+    - lcov --summary chameleon.lcov
+    - export INPUT_FILES=""
+    - for name in $( ls -1 bis_chameleon_*.lcov | grep -v simgrid); do export INPUT_FILES="$INPUT_FILES -a $name"; done
+    - lcov $INPUT_FILES -o bis_chameleon.lcov
+    - lcov --summary bis_chameleon.lcov
+  except:
+    - master
+    - /^ci-.*$/
+    - schedules
diff --git a/.gitlab/coverity.yml b/.gitlab/coverity.yml
new file mode 100644
index 000000000..2b1374526
--- /dev/null
+++ b/.gitlab/coverity.yml
@@ -0,0 +1,29 @@
+---
+.coverity:
+  image: hpclib/hiepacs
+  stage: analyse
+  tags: ["large"]
+  dependencies: []
+  artifacts:
+    name: chameleon_coverity
+    expire_in: 1 week
+    paths:
+      - chameleon.tgz
+  variables:
+    VERSION: coverity
+  script:
+    - (cd build-$VERSION &&
+       cmake -C ../cmake_modules/gitlab-ci-initial-cache.cmake \
+                .. -DCHAMELEON_USE_CUDA=ON -DCHAMELEON_USE_MPI=ON &&
+       cov-build --dir ../cov-int make -j 4)
+    - tar czvf chameleon.tgz cov-int
+    - curl --form token=$COVERITY_TOKEN
+           --form email=florent.pruvost@inria.fr
+           --form file=@chameleon.tgz
+           --form version="`git rev-parse --short HEAD`"
+           --form description=""
+           https://scan.coverity.com/builds?project=Chameleon
+  only:
+    - master@solverstack/chameleon
+  except:
+    - schedules
diff --git a/.gitlab/pages.yml b/.gitlab/pages.yml
new file mode 100644
index 000000000..9373abd47
--- /dev/null
+++ b/.gitlab/pages.yml
@@ -0,0 +1,24 @@
+---
+pages:
+  image: hpclib/hiepacs
+  stage: deploy
+  dependencies: []
+  artifacts:
+    name: chameleon_doc
+    expire_in: 1 week
+    paths:
+      - public
+  variables:
+    VERSION: pages
+  script:
+    - cd build-$VERSION
+    - cmake .. -DCHAMELEON_ENABLE_DOC=ON
+    - make doc -j5
+    - mv doc/orgmode/ ../public/
+    - ln -s ../public/users_guide.html ../public/index.html
+    - mv doc/doxygen/out/html/ ../public/doxygen/
+  only:
+    - master@solverstack/chameleon
+    - /^ci-.*$/
+  except:
+    - schedules
diff --git a/.gitlab/release.yml b/.gitlab/release.yml
new file mode 100644
index 000000000..8d499fd37
--- /dev/null
+++ b/.gitlab/release.yml
@@ -0,0 +1,18 @@
+---
+release:
+  image: hpclib/hiepacs
+  stage: deploy
+  dependencies: []
+  artifacts:
+    name: chameleon_release
+    expire_in: 1 week
+    paths:
+      - chameleon-*.tar.gz
+  variables:
+    VERSION: release
+  script:
+    - ./tools/release.sh
+  only:
+    - /^release-.*$/
+  except:
+    - schedules
diff --git a/.gitlab/sonarqube.yml b/.gitlab/sonarqube.yml
new file mode 100644
index 000000000..d564f271c
--- /dev/null
+++ b/.gitlab/sonarqube.yml
@@ -0,0 +1,22 @@
+sonarqube:
+  image: hpclib/hiepacs
+  stage: analyse
+  tags: ["large"]
+  artifacts:
+    name: chameleon_analysis
+    expire_in: 1 week
+    paths:
+      - chameleon_coverage.xml
+      - chameleon_cppcheck.xml
+      - chameleon_rats.xml
+      - sonar.log
+  variables:
+    VERSION: sonarqube
+  script:
+    - cat *.log > chameleon_build.log
+    - ./tools/analysis.sh
+  only:
+    - master@solverstack/chameleon
+    - /^ci-.*$/
+  except:
+    - schedules
diff --git a/.gitlab/test_openmp.yml b/.gitlab/test_openmp.yml
new file mode 100644
index 000000000..2984c852d
--- /dev/null
+++ b/.gitlab/test_openmp.yml
@@ -0,0 +1,56 @@
+---
+.test_openmp_template: &test_openmp
+  extends: .test_script_template
+  needs: [build_openmp]
+  dependencies:
+    - build_openmp
+  artifacts:
+    name: test_openmp
+    expire_in: 48 hours
+    paths:
+      - build_openmp
+      - chameleon_openmp_*.log
+      - chameleon_openmp_*.lcov
+      - bis_chameleon_openmp_*.lcov
+
+.test_openmp_template_master: &test_openmp_master
+  extends:
+    - .test_openmp_template
+    - .only-master
+
+.test_openmp_template_branches: &test_openmp_branches
+  extends:
+    - .test_openmp_template
+    - .only-branches
+
+test_openmp_shm_s:
+  <<: *test_openmp_master
+  variables:
+    VERSION: openmp
+    CATEGORY: shm
+    PRECISION: s
+    TESTS_RESTRICTION: "-R \"_${CATEGORY}_${PRECISION}\""
+
+test_openmp_shm_d:
+  <<: *test_openmp_master
+  variables:
+    VERSION: openmp
+    CATEGORY: shm
+    PRECISION: d
+    TESTS_RESTRICTION: "-R \"_${CATEGORY}_${PRECISION}\""
+
+test_openmp_shm_c:
+  <<: *test_openmp_master
+  variables:
+    VERSION: openmp
+    CATEGORY: shm
+    PRECISION: c
+    TESTS_RESTRICTION: "-R \"_${CATEGORY}_${PRECISION}\""
+
+test_openmp_shm_z:
+  <<: *test_openmp_branches
+  variables:
+    VERSION: openmp
+    CATEGORY: shm
+    PRECISION: z
+    TESTS_RESTRICTION: "-R \"_${CATEGORY}_${PRECISION}\""
diff --git a/.gitlab/test_parsec.yml b/.gitlab/test_parsec.yml
new file mode 100644
index 000000000..cd50846d6
--- /dev/null
+++ b/.gitlab/test_parsec.yml
@@ -0,0 +1,88 @@
+---
+.test_parsec_template: &test_parsec
+  extends: .test_script_template
+  needs: [build_parsec]
+  dependencies:
+    - build_parsec
+  artifacts:
+    name: test_parsec
+    expire_in: 48 hours
+    paths:
+      - build_parsec
+      - chameleon_parsec_*.log
+      - chameleon_parsec_*.lcov
+      - bis_chameleon_parsec_*.lcov
+
+.test_parsec_template_master: &test_parsec_master
+  extends:
+    - .test_parsec_template
+    - .only-master
+
+.test_parsec_template_branches: &test_parsec_branches
+  extends:
+    - .test_parsec_template
+    - .only-branches
+
+test_parsec_shm_s:
+  <<: *test_parsec_master
+  variables:
+    VERSION: parsec
+    CATEGORY: shm
+    PRECISION: s
+    TESTS_RESTRICTION: "-R \"_${CATEGORY}_${PRECISION}\""
+
+test_parsec_shm_d:
+  <<: *test_parsec_master
+  variables:
+    VERSION: parsec
+    CATEGORY: shm
+    PRECISION: d
+    TESTS_RESTRICTION: "-R \"_${CATEGORY}_${PRECISION}\""
+
+test_parsec_shm_c:
+  <<: *test_parsec_branches
+  variables:
+    VERSION: parsec
+    CATEGORY: shm
+    PRECISION: c
+    TESTS_RESTRICTION: "-R \"_${CATEGORY}_${PRECISION}\""
+
+test_parsec_shm_z:
+  <<: *test_parsec_master
+  variables:
+    VERSION: parsec
+    CATEGORY: shm
+    PRECISION: z
+    TESTS_RESTRICTION: "-R \"_${CATEGORY}_${PRECISION}\""
+
+# test_parsec_mpi_s:
+#   <<: *test_parsec_branches
+#   variables:
+#     VERSION: parsec
+#     CATEGORY: mpi
+#     PRECISION: s
+#     TESTS_RESTRICTION: "-R \"_${CATEGORY}_${PRECISION}\""
+
+# test_parsec_mpi_d:
+#   <<: *test_parsec_master
+#   variables:
+#     VERSION: parsec
+#     CATEGORY: mpi
+#     PRECISION: d
+#     TESTS_RESTRICTION: "-R \"_${CATEGORY}_${PRECISION}\""
+
+# test_parsec_mpi_c:
+#   <<: *test_parsec_master
+#   variables:
+#     VERSION: parsec
+#     CATEGORY: mpi
+#     PRECISION: c
+#     TESTS_RESTRICTION: "-R \"_${CATEGORY}_${PRECISION}\""
+
+# test_parsec_mpi_z:
+#   <<: *test_parsec_master
+#   variables:
+#     VERSION: parsec
+#     CATEGORY: mpi
+#     PRECISION: z
+#     TESTS_RESTRICTION: "-R \"_${CATEGORY}_${PRECISION}\""
diff --git a/.gitlab/test_quark.yml b/.gitlab/test_quark.yml
new file mode 100644
index 000000000..0bde307c1
--- /dev/null
+++ b/.gitlab/test_quark.yml
@@ -0,0 +1,56 @@
+---
+.test_quark_template: &test_quark
+  extends: .test_script_template
+  needs: [build_quark]
+  dependencies:
+    - build_quark
+  artifacts:
+    name: test_quark
+    expire_in: 48 hours
+    paths:
+      - build_quark
+      - chameleon_quark_*.log
+      - chameleon_quark_*.lcov
+      - bis_chameleon_quark_*.lcov
+
+.test_quark_template_master: &test_quark_master
+  extends:
+    - .test_quark_template
+    - .only-master
+
+.test_quark_template_branches: &test_quark_branches
+  extends:
+    - .test_quark_template
+    - .only-branches
+
+test_quark_shm_s:
+  <<: *test_quark_branches
+  variables:
+    VERSION: quark
+    CATEGORY: shm
+    PRECISION: s
+    TESTS_RESTRICTION: "-R \"_${CATEGORY}_${PRECISION}\""
+
+test_quark_shm_d:
+  <<: *test_quark_master
+  variables:
+    VERSION: quark
+    CATEGORY: shm
+    PRECISION: d
+    TESTS_RESTRICTION: "-R \"_${CATEGORY}_${PRECISION}\""
+
+test_quark_shm_c:
+  <<: *test_quark_master
+  variables:
+    VERSION: quark
+    CATEGORY: shm
+    PRECISION: c
+    TESTS_RESTRICTION: "-R \"_${CATEGORY}_${PRECISION}\""
+
+test_quark_shm_z:
+  <<: *test_quark_master
+  variables:
+    VERSION: quark
+    CATEGORY: shm
+    PRECISION: z
+    TESTS_RESTRICTION: "-R \"_${CATEGORY}_${PRECISION}\""
diff --git a/.gitlab/test_starpu.yml b/.gitlab/test_starpu.yml
new file mode 100644
index 000000000..51dc59aca
--- /dev/null
+++ b/.gitlab/test_starpu.yml
@@ -0,0 +1,104 @@
+---
+.test_starpu_template:
+  extends: .test_script_template
+  needs: [build_starpu]
+  dependencies:
+    - build_starpu
+  artifacts:
+    name: test_starpu
+    expire_in: 48 hours
+    paths:
+      - build_starpu
+      - chameleon_starpu_*.log
+      - chameleon_starpu_*.lcov
+      - bis_chameleon_starpu_*.lcov
+
+.test_starpu_template_master: &test_starpu_master
+  extends:
+    - .test_starpu_template
+    - .only-master
+
+.test_starpu_template_branches: &test_starpu_branches
+  extends:
+    - .test_starpu_template
+    - .only-branches
+
+test_starpu_shm_s:
+  <<: *test_starpu_master
+  variables:
+    STARPU_WORKERS_NOBIND: 1
+    STARPU_SILENT: 1
+    VERSION: starpu
+    CATEGORY: shm
+    PRECISION: s
+    TESTS_RESTRICTION: "-R \"_${CATEGORY}_${PRECISION}\""
+
+test_starpu_shm_d:
+  <<: *test_starpu_branches
+  variables:
+    STARPU_WORKERS_NOBIND: 1
+    STARPU_SILENT: 1
+    VERSION: starpu
+    CATEGORY: shm
+    PRECISION: d
+    TESTS_RESTRICTION: "-R \"_${CATEGORY}_${PRECISION}\""
+
+test_starpu_shm_c:
+  <<: *test_starpu_master
+  variables:
+    STARPU_WORKERS_NOBIND: 1
+    STARPU_SILENT: 1
+    VERSION: starpu
+    CATEGORY: shm
+    PRECISION: c
+    TESTS_RESTRICTION: "-R \"_${CATEGORY}_${PRECISION}\""
+
+test_starpu_shm_z:
+  <<: *test_starpu_master
+  variables:
+    STARPU_WORKERS_NOBIND: 1
+    STARPU_SILENT: 1
+    VERSION: starpu
+    CATEGORY: shm
+    PRECISION: z
+    TESTS_RESTRICTION: "-R \"_${CATEGORY}_${PRECISION}\""
+
+test_starpu_mpi_s:
+  <<: *test_starpu_branches
+  variables:
+    STARPU_WORKERS_NOBIND: 1
+    STARPU_SILENT: 1
+    VERSION: starpu
+    CATEGORY: mpi
+    PRECISION: s
+    TESTS_RESTRICTION: "-R \"_${CATEGORY}_${PRECISION}\""
+
+test_starpu_mpi_d:
+  <<: *test_starpu_master
+  variables:
+    STARPU_WORKERS_NOBIND: 1
+    STARPU_SILENT: 1
+    VERSION: starpu
+    CATEGORY: mpi
+    PRECISION: d
+    TESTS_RESTRICTION: "-R \"_${CATEGORY}_${PRECISION}\""
+
+test_starpu_mpi_c:
+  <<: *test_starpu_master
+  variables:
+    STARPU_WORKERS_NOBIND: 1
+    STARPU_SILENT: 1
+    VERSION: starpu
+    CATEGORY: mpi
+    PRECISION: c
+    TESTS_RESTRICTION: "-R \"_${CATEGORY}_${PRECISION}\""
+
+test_starpu_mpi_z:
+  <<: *test_starpu_master
+  variables:
+    STARPU_WORKERS_NOBIND: 1
+    STARPU_SILENT: 1
+    VERSION: starpu
+    CATEGORY: mpi
+    PRECISION: z
+    TESTS_RESTRICTION: "-R \"_${CATEGORY}_${PRECISION}\""
diff --git a/.gitlab/test_starpu_simgrid.yml b/.gitlab/test_starpu_simgrid.yml
new file mode 100644
index 000000000..87e137eaa
--- /dev/null
+++ b/.gitlab/test_starpu_simgrid.yml
@@ -0,0 +1,34 @@
+---
+.test_starpu_simgrid_template: &test_starpu_simgrid
+  extends: .test_script_template
+  needs: [build_starpu_simgrid]
+  dependencies:
+    - build_starpu_simgrid
+  artifacts:
+    name: test_starpu_simgrid
+    expire_in: 48 hours
+    paths:
+      - build_starpu_simgrid
+      - chameleon_starpu_simgrid_*.log
+      - chameleon_starpu_simgrid_*.lcov
+      - bis_chameleon_starpu_simgrid_*.lcov
+
+.test_starpu_simgrid_template_master: &test_starpu_simgrid_master
+  extends:
+    - .test_starpu_simgrid_template
+    - .only-master
+
+.test_starpu_simgrid_template_branches: &test_starpu_simgrid_branches
+  extends:
+    - .test_starpu_simgrid_template
+    - .only-branches
+
+test_starpu_simgrid_simu_all:
+  <<: *test_starpu_simgrid_branches
+  variables:
+    STARPU_WORKERS_NOBIND: 1
+    SIMU: simu
+    VERSION: starpu_simgrid
+    CATEGORY: simu
+    PRECISION: all
+    TESTS_RESTRICTION: "-R \"_${CATEGORY}\""
diff --git a/CTestConfig.cmake b/CTestConfig.cmake
index 293066850..d6cfd23c6 100644
--- a/CTestConfig.cmake
+++ b/CTestConfig.cmake
@@ -7,7 +7,7 @@
 set(CTEST_PROJECT_NAME "Chameleon")
 set(CTEST_NIGHTLY_START_TIME "00:00:00 GMT")
 
-set(CTEST_DROP_METHOD "https")
+set(CTEST_DROP_METHOD "http")
 set(CTEST_DROP_SITE "cdash.inria.fr")
 set(CTEST_DROP_LOCATION "/CDash/submit.php?project=chameleon")
 set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/tools/analysis.sh b/tools/analysis.sh
index f29cce3d4..c4057ca04 100755
--- a/tools/analysis.sh
+++ b/tools/analysis.sh
@@ -12,11 +12,12 @@
 ./tools/find_sources.sh
 
 # Generate coverage xml output
-lcov -a $PWD/chameleon_starpu.lcov \
-     -a $PWD/chameleon_starpu_simgrid.lcov \
-     -a $PWD/chameleon_quark.lcov \
-     -a $PWD/chameleon_parsec.lcov \
-     -o $PWD/chameleon.lcov
+INPUT_FILES=""
+for name in $( ls -1 chameleon_*.lcov | grep -v simgrid)
+do
+    INPUT_FILES="$INPUT_FILES -a $name";
+done
+lcov $INPUT_FILES -o chameleon.lcov
 lcov --summary chameleon.lcov
 lcov_cobertura.py chameleon.lcov --output chameleon_coverage.xml
 
@@ -24,7 +25,12 @@ lcov_cobertura.py chameleon.lcov --output chameleon_coverage.xml
 export UNDEFINITIONS="-UCHAMELEON_USE_OPENCL -UWIN32 -UWIN64 -U_MSC_EXTENSIONS -U_MSC_VER -U__SUNPRO_C -U__SUNPRO_CC -U__sun -Usun -U__cplusplus"
 
 # run cppcheck analysis
-cppcheck -v -f --language=c --platform=unix64 --enable=all --xml --xml-version=2 --suppress=missingInclude ${UNDEFINITIONS} --file-list=./filelist.txt 2> chameleon_cppcheck.xml
+CPPCHECK_OPT=" -v -f --language=c --platform=unix64 --enable=all --xml --xml-version=2 --suppress=missingInclude ${UNDEFINITIONS}"
+cppcheck $CPPCHECK_OPT --file-list=./filelist_none.txt 2> chameleon_cppcheck.xml
+cppcheck $CPPCHECK_OPT -DPRECISION_s -UPRECISION_d -UPRECISION_c -UPRECISION_z --file-list=./filelist_s.txt 2>> chameleon_cppcheck.xml
+cppcheck $CPPCHECK_OPT -DPRECISION_d -UPRECISION_s -UPRECISION_c -UPRECISION_z --file-list=./filelist_d.txt 2>> chameleon_cppcheck.xml
+cppcheck $CPPCHECK_OPT -DPRECISION_c -UPRECISION_s -UPRECISION_d -UPRECISION_z --file-list=./filelist_c.txt 2>> chameleon_cppcheck.xml
+cppcheck $CPPCHECK_OPT -DPRECISION_z -UPRECISION_s -UPRECISION_d -UPRECISION_c --file-list=./filelist_z.txt 2>> chameleon_cppcheck.xml
 
 # create the sonarqube config file
 cat > sonar-project.properties << EOF
diff --git a/tools/find_sources.sh b/tools/find_sources.sh
index d4642717e..43b9e4d55 100755
--- a/tools/find_sources.sh
+++ b/tools/find_sources.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
-set -x
+#set -x
 
-SRCDIR_TO_ANALYZE="build-openmp/runtime/openmp build-parsec/runtime/parsec build-quark/runtime/quark build-starpu compute control coreblas example include runtime testing timing"
+SRCDIR_TO_ANALYZE="build-openmp/runtime/openmp build-parsec/runtime/parsec build-quark/runtime/quark build-starpu build compute control coreblas example include runtime testing timing"
 
 echo $PWD
 rm -f filelist.txt
@@ -27,3 +27,16 @@ for file in coreblas/include/coreblas/cblas.h coreblas/include/coreblas/lapacke.
 do
     sed -i "\:^$file.*:d" filelist.txt
 done
+
+rm -f filelist_*.txt
+for name in $(cat filelist.txt)
+do
+    test=$(grep "@generated" $name | wc -l)
+    if [ $test -gt 0 ]
+    then
+        prec=$(grep "@generated" $name | sed 's/^.*[scdz] -> \([sdcz]\).*$/\1/')
+        echo $name >> filelist_${prec}.txt
+    else
+        echo $name >> filelist_none.txt
+    fi
+done
-- 
GitLab