From 5924c81cf010dea84872a9b05824afd4932628ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= <klinkovsky@mmg.fjfi.cvut.cz> Date: Thu, 9 Apr 2020 19:29:03 +0200 Subject: [PATCH] Split matrix tests into separate CI jobs because they take too long --- .gitlab-ci.yml | 96 +++++++++++++++++++++++++++++++++++- CMakeLists.txt | 4 +- build | 9 +++- src/CMakeLists.txt | 3 ++ src/UnitTests/CMakeLists.txt | 2 +- 5 files changed, 109 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index de46d4c827..8cd1f87480 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,6 +24,7 @@ stages: WITH_MPI: "no" # configurations WITH_TESTS: "no" + WITH_MATRIX_TESTS: "no" WITH_COVERAGE: "no" WITH_DOC: "no" WITH_BENCHMARKS: "no" @@ -56,6 +57,7 @@ stages: -DWITH_CUDA=${WITH_CUDA} -DWITH_CUDA_ARCH=${WITH_CUDA_ARCH} -DWITH_TESTS=${WITH_TESTS} + -DWITH_MATRIX_TESTS=${WITH_MATRIX_TESTS} -DWITH_DOC=${WITH_DOC} -DWITH_COVERAGE=${WITH_COVERAGE} -DWITH_BENCHMARKS=${WITH_BENCHMARKS} @@ -65,7 +67,7 @@ stages: -DWITH_CI_FLAGS=yes # "install" implies the "all" target - ninja ${NINJAFLAGS} install - - if [[ ${WITH_TESTS} == "yes" ]]; then + - if [[ ${WITH_TESTS} == "yes" ]] || [[ ${WITH_MATRIX_TESTS} == "yes" ]]; then ninja test; fi - popd @@ -125,6 +127,31 @@ cuda_tests_Release: WITH_TESTS: "yes" +cuda_matrix_tests_Debug: + <<: *build_template + tags: + - openmp + - gpu + variables: + <<: *default_cmake_flags + WITH_OPENMP: "yes" + WITH_CUDA: "yes" + BUILD_TYPE: Debug + WITH_MATRIX_TESTS: "yes" + +cuda_matrix_tests_Release: + <<: *build_template + tags: + - openmp + - gpu + variables: + <<: *default_cmake_flags + WITH_OPENMP: "yes" + WITH_CUDA: "yes" + BUILD_TYPE: Release + WITH_MATRIX_TESTS: "yes" + + cuda_examples_Debug: <<: *build_template tags: @@ -214,6 +241,35 @@ cuda_mpi_tests_Release: WITH_TESTS: "yes" +cuda_mpi_matrix_tests_Debug: + <<: *build_template + tags: + - openmp + - gpu + - mpi + variables: + <<: *default_cmake_flags + WITH_OPENMP: "yes" + WITH_CUDA: "yes" + WITH_MPI: "yes" + BUILD_TYPE: Debug + WITH_MATRIX_TESTS: "yes" + +cuda_mpi_matrix_tests_Release: + <<: *build_template + tags: + - openmp + - gpu + - mpi + variables: + <<: *default_cmake_flags + WITH_OPENMP: "yes" + WITH_CUDA: "yes" + WITH_MPI: "yes" + BUILD_TYPE: Release + WITH_MATRIX_TESTS: "yes" + + cuda_mpi_examples_Debug: <<: *build_template tags: @@ -293,6 +349,20 @@ default_tests_Release: BUILD_TYPE: Release WITH_TESTS: "yes" +default_matrix_tests_Debug: + <<: *build_template + variables: + <<: *default_cmake_flags + BUILD_TYPE: Debug + WITH_MATRIX_TESTS: "yes" + +default_matrix_tests_Release: + <<: *build_template + variables: + <<: *default_cmake_flags + BUILD_TYPE: Release + WITH_MATRIX_TESTS: "yes" + default_examples_Debug: <<: *build_template variables: @@ -350,6 +420,30 @@ mpi_tests_Release: BUILD_TYPE: Release WITH_TESTS: "yes" +mpi_matrix_tests_Debug: + <<: *build_template + tags: + - openmp + - mpi + variables: + <<: *default_cmake_flags + WITH_OPENMP: "yes" + WITH_MPI: "yes" + BUILD_TYPE: Debug + WITH_MATRIX_TESTS: "yes" + +mpi_matrix_tests_Release: + <<: *build_template + tags: + - openmp + - mpi + variables: + <<: *default_cmake_flags + WITH_OPENMP: "yes" + WITH_MPI: "yes" + BUILD_TYPE: Release + WITH_MATRIX_TESTS: "yes" + mpi_examples_Debug: <<: *build_template tags: diff --git a/CMakeLists.txt b/CMakeLists.txt index 3fd9e9a7db..e74510f942 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,7 @@ option(WITH_OPENMP "Build with OpenMP support" ON) option(WITH_MPI "Build with MPI support" ON) option(WITH_GMP "Build with GMP support" OFF) option(WITH_TESTS "Build tests" ON) +option(WITH_MATRIX_TESTS "Build tests for matrices" ON) option(WITH_PROFILING "Enable code profiling compiler flags" OFF ) option(WITH_COVERAGE "Enable code coverage reports from unit tests" OFF) option(WITH_EXAMPLES "Compile the 'src/Examples' directory" ON) @@ -142,7 +143,7 @@ if( DEFINED ENV{CI_JOB_NAME} OR ${CMAKE_GENERATOR} STREQUAL "Ninja" ) endif() # gtest has to be built before we add the MPI flags -if( ${WITH_TESTS} ) +if( ${WITH_TESTS} OR ${WITH_MATRIX_TESTS} ) enable_testing() # build gtest libs @@ -358,6 +359,7 @@ message( " WITH_OPENMP = ${WITH_OPENMP}" ) message( " WITH_MPI = ${WITH_MPI}" ) message( " WITH_GMP = ${WITH_GMP}" ) message( " WITH_TESTS = ${WITH_TESTS}" ) +message( " WITH_MATRIX_TESTS = ${WITH_MATRIX_TESTS}" ) message( " WITH_PROFILING = ${WITH_PROFILING}" ) message( " WITH_COVERAGE = ${WITH_COVERAGE}" ) message( " WITH_EXAMPLES = ${WITH_EXAMPLES}" ) diff --git a/build b/build index ee74fa87bf..5c9b86918a 100755 --- a/build +++ b/build @@ -22,6 +22,7 @@ WITH_CUDA_ARCH="auto" WITH_OPENMP="yes" WITH_GMP="no" WITH_TESTS="yes" +WITH_MATRIX_TESTS="yes" RUN_TESTS="yes" # whether to run tests if they were compiled (coverage script sets it to no) TESTS_JOBS="4" WITH_PROFILING="no" @@ -54,6 +55,7 @@ do --with-openmp=* ) WITH_OPENMP="${option#*=}" ;; --with-gmp=* ) WITH_GMP="${option#*=}" ;; --with-tests=* ) WITH_TESTS="${option#*=}" ;; + --with-matrix-tests=* ) WITH_MATRIX_TESTS="${option#*=}" ;; --run-tests=* ) RUN_TESTS="${option#*=}" ;; --tests-jobs=* ) TESTS_JOBS="${option#*=}" ;; --with-profiling=* ) WITH_PROFILING="${option#*=}" ;; @@ -137,6 +139,7 @@ cmake_command=( -DWITH_MPI=${WITH_MPI} -DWITH_GMP=${WITH_GMP} -DWITH_TESTS=${WITH_TESTS} + -DWITH_MATRIX_TESTS=${WITH_MATRIX_TESTS} -DWITH_PROFILING=${WITH_PROFILING} -DWITH_COVERAGE=${WITH_COVERAGE} -DWITH_DOC=${WITH_DOC} @@ -213,6 +216,8 @@ if [[ ${WITH_DOC} == "yes" ]]; then "$ROOT_DIR/Documentation/build" --prefix="$PREFIX" fi -if [[ ${WITH_TESTS} == "yes" ]] && [[ ${RUN_TESTS} == "yes" ]]; then - CTEST_PARALLEL_LEVEL=${TESTS_JOBS} CTEST_OUTPUT_ON_FAILURE=1 $make test +if [[ ${WITH_TESTS} == "yes" ]] || [[ ${WITH_MATRIX_TESTS} == "yes" ]]; then + if [[ ${RUN_TESTS} == "yes" ]]; then + CTEST_PARALLEL_LEVEL=${TESTS_JOBS} CTEST_OUTPUT_ON_FAILURE=1 $make test + fi fi diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d394ac2ec6..f0ac2d2005 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -24,6 +24,9 @@ endif() if( ${WITH_TESTS} ) ADD_SUBDIRECTORY( UnitTests ) endif() +if( ${WITH_MATRIX_TESTS} ) + ADD_SUBDIRECTORY( UnitTests/Matrices ) +endif() if( ${WITH_PYTHON} ) ADD_SUBDIRECTORY( Python ) diff --git a/src/UnitTests/CMakeLists.txt b/src/UnitTests/CMakeLists.txt index 6bfae47e16..15a6bf9f0d 100644 --- a/src/UnitTests/CMakeLists.txt +++ b/src/UnitTests/CMakeLists.txt @@ -1,7 +1,7 @@ ADD_SUBDIRECTORY( Communicators ) ADD_SUBDIRECTORY( Containers ) ADD_SUBDIRECTORY( Functions ) -ADD_SUBDIRECTORY( Matrices ) +# Matrices are included from src/CMakeLists.txt ADD_SUBDIRECTORY( Meshes ) ADD_SUBDIRECTORY( Pointers ) -- GitLab