Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 197305e9 authored by Mathieu Faverge's avatar Mathieu Faverge
Browse files

Merge branch 'buildhip' into 'master'

Add gitlab-ci jobs to test compilation with HIP and HIP+CUDA

See merge request solverstack/chameleon!371
parents ac473886 05e069fb
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
set -x
# custom environment used during CI tests with gitlab ci
# these paths may depend on the runner used, please be careful and add
......@@ -15,15 +17,34 @@ export STARPU_WORKERS_NOBIND=1
# initialize empty to get just what we need
export PKG_CONFIG_PATH=""
# if simgrid change the default starpu dir to use
if [ "$1" == "simu" ]; then
export STARPU_DIR=$STARPUSIMGRID_DIR
export PKG_CONFIG_PATH=$SIMGRID_DIR/lib/pkgconfig:$PKG_CONFIG_PATH
# define the starpu dir depending on the build variant
STARPU_VARIANT=""
if [ ! -z "$1" ]
then
STARPU_VARIANT="-$1"
fi
export STARPU_DIR=/home/gitlab/install/starpu${STARPU_VARIANT}
# add additional env. var. depending on the starpu variant
case $STARPU_VARIANT in
-hip )
export CMAKE_PREFIX_PATH=$STARPU_DIR:/opt/rocm
export LD_LIBRARY_PATH=/opt/rocm/lib
;;
-hipcuda )
export CMAKE_PREFIX_PATH=$STARPU_DIR:$HIPCUDA_DIR
export LD_LIBRARY_PATH=$HIPCUDA_DIR/lib
export HIP_PLATFORM=nvidia
export HIP_PATH=$HIPCUDA_DIR
;;
* )
;;
esac
# for build: better to rely on pkg-config than to guess libraries with the env. var.
export PKG_CONFIG_PATH=$PARSEC_DIR/lib/pkgconfig:$PKG_CONFIG_PATH
export PKG_CONFIG_PATH=$STARPU_DIR/lib/pkgconfig:$PKG_CONFIG_PATH
export PKG_CONFIG_PATH=$SIMGRID_DIR/lib/pkgconfig:$PKG_CONFIG_PATH
# for ctest: we need this at runtime
export LD_LIBRARY_PATH=$PARSEC_DIR/lib:$LD_LIBRARY_PATH
......
......@@ -15,7 +15,7 @@ before_script:
- git config --global --add safe.directory $CI_PROJECT_DIR/hqr
- git config --global --add safe.directory $CI_PROJECT_DIR/testing/test_fembem
- git submodule update --init --recursive
- source .gitlab-ci-env.sh $SIMU
- source .gitlab-ci-env.sh $CHAM_CI_ENV_ARG
- mkdir -p build-$VERSION
include:
......
#!/usr/bin/env bash
fatal() {
echo "$0: error occurred, exit"
exit 1
}
set -x
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
if [[ -d build-$VERSION ]]
then
cd build-$VERSION
if [[ $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH ]]
then
SCAN="scan-build -plist --intercept-first --exclude CMakeFiles --analyze-headers -o analyzer_reports "
else
SCAN=""
fi
eval '${SCAN}cmake -C ../cmake_modules/gitlab-ci-initial-cache.cmake .. $BUILD_OPTIONS' || fatal
eval '${SCAN}ctest --no-compress-output -j 5 -V -T Build | tee ../${LOGNAME}' || fatal
make install | tee -a ../${LOGNAME} || fatal
rm install/ -r || fatal
else
echo "$0: directory build-$VERSION does not exist, exit."
exit 1
fi
......@@ -29,10 +29,24 @@ build_starpu:
BUILD_OPTIONS: "-DCHAMELEON_USE_CUDA=ON -DCHAMELEON_USE_MPI=ON"
VERSION: starpu
build_starpu_hip:
extends: .build_script_template
variables:
CHAM_CI_ENV_ARG: hip
BUILD_OPTIONS: "-DCHAMELEON_USE_HIP_ROC=ON -DCHAMELEON_USE_MPI=ON"
VERSION: starpu_hip
build_starpu_hipcuda:
extends: .build_script_template
variables:
CHAM_CI_ENV_ARG: hipcuda
BUILD_OPTIONS: "-DCHAMELEON_USE_HIP_CUDA=ON -DCHAMELEON_HIPBLAS_PATH=/home/gitlab/hipcuda/hipblas -DCHAMELEON_USE_MPI=ON"
VERSION: starpu_hipcuda
build_starpu_simgrid:
extends: .build_script_template
variables:
SIMU: simu
CHAM_CI_ENV_ARG: simgrid
BUILD_OPTIONS: "-DCHAMELEON_SIMULATION=ON -DCHAMELEON_USE_CUDA=ON -DCHAMELEON_USE_MPI=OFF"
VERSION: starpu_simgrid
......
......@@ -25,21 +25,7 @@ default:
stage: build
extends: .only-branches
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 -j 5 -V
-T Build
| tee ../${LOGNAME})
- (cd build-$VERSION &&
make install | tee -a ../${LOGNAME} &&
rm install/ -r)
- ./.gitlab/build.sh
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
expire_in: 2 days
......@@ -49,23 +35,7 @@ default:
.test_script_template:
stage: test
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
$TESTS_RESTRICTION
-T Test
--output-junit ../${LOGNAME}.junit
| tee -a ../${LOGNAME}.log")
- gcovr --xml-pretty --exclude-unreachable-branches --print-summary -o ${LOGNAME}.cov --root ${CI_PROJECT_DIR}
- lcov --directory build-$VERSION --capture --output-file ${LOGNAME}.lcov
- cp ${LOGNAME}.junit junit.xml
- cp ${LOGNAME}.cov coverage.xml
- ./.gitlab/test.sh
coverage: /^\s*lines:\s*\d+.\d+\%/
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
......
#!/usr/bin/env bash
fatal() {
echo "$0: error occurred, exit"
exit 1
}
set -x
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
if [[ -d build-$VERSION ]]
then
cd build-$VERSION
eval "ctest --no-compress-output $TESTS_RESTRICTION -T Test --output-junit ../${LOGNAME}.junit | tee -a ../${LOGNAME}.log" || fatal
cd $CI_PROJECT_DIR || fatal
gcovr --xml-pretty --exclude-unreachable-branches --print-summary -o ${LOGNAME}.cov --root $CI_PROJECT_DIR || fatal
lcov --directory build-$VERSION --capture --output-file ${LOGNAME}.lcov || fatal
cp ${LOGNAME}.junit junit.xml || fatal
cp ${LOGNAME}.cov coverage.xml || fatal
else
echo "$0: directory build-$VERSION does not exist, exit."
exit 1
fi
......@@ -18,7 +18,7 @@ test_starpu_simgrid_simu_all:
<<: *test_starpu_simgrid_branches
variables:
STARPU_WORKERS_NOBIND: 1
SIMU: simu
CHAM_CI_ENV_ARG: simgrid
VERSION: starpu_simgrid
CATEGORY: simu
PRECISION: all
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment