From 417b7d129d47e718a00e65ed744866605997fc00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= Date: Sun, 14 Jun 2020 17:05:26 +0200 Subject: [PATCH 01/12] Enabled host-only Clang builds in Gitlab CI --- .gitlab-ci.yml | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 028a64624..4fe1b951f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -32,6 +32,15 @@ stages: WITH_TOOLS: "no" WITH_PYTHON: "no" +# base for Clang builds +.clang: + variables: + CXX: clang++ + CC: clang + CUDA_HOST_COMPILER: clang++ + tags: + - clang + # template for build jobs .build_template_def: &build_template stage: build @@ -498,6 +507,88 @@ mpi_benchmarks_tools_python_Release: WITH_PYTHON: "yes" +clang_tests_Debug: + extends: + - default_tests_Debug + - .clang + +clang_tests_Release: + extends: + - default_tests_Release + - .clang + +clang_matrix_tests_Debug: + extends: + - default_matrix_tests_Debug + - .clang + +clang_matrix_tests_Release: + extends: + - default_matrix_tests_Release + - .clang + +clang_examples_Debug: + extends: + - default_examples_Debug + - .clang + +clang_examples_Release: + extends: + - default_examples_Release + - .clang + +clang_benchmarks_tools_python_Debug: + extends: + - default_benchmarks_tools_python_Debug + - .clang + +clang_benchmarks_tools_python_Release: + extends: + - default_benchmarks_tools_python_Release + - .clang + + +clang_mpi_tests_Debug: + extends: + - mpi_tests_Debug + - .clang + +clang_mpi_tests_Release: + extends: + - mpi_tests_Release + - .clang + +clang_mpi_matrix_tests_Debug: + extends: + - mpi_matrix_tests_Debug + - .clang + +clang_mpi_matrix_tests_Release: + extends: + - mpi_matrix_tests_Release + - .clang + +clang_mpi_examples_Debug: + extends: + - mpi_examples_Debug + - .clang + +clang_mpi_examples_Release: + extends: + - mpi_examples_Release + - .clang + +clang_mpi_benchmarks_tools_python_Debug: + extends: + - mpi_benchmarks_tools_python_Debug + - .clang + +clang_mpi_benchmarks_tools_python_Release: + extends: + - mpi_benchmarks_tools_python_Release + - .clang + + build documentation: -- GitLab From 9ece8a67a2ff3c38a7699629a1378c5d87bd48e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= Date: Sun, 14 Jun 2020 17:30:07 +0200 Subject: [PATCH 02/12] .gitlab-ci.yml: use "needs" instead of "dependencies" for documentation build --- .gitlab-ci.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4fe1b951f..d09d22dd5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -598,9 +598,11 @@ build documentation: - Documentation/**/* - src/TNL/**/*.{h,hpp} - .gitlab-ci.yml - dependencies: + # use "needs" instead of "dependencies" to allow out-of-order start of this job + needs: # the job which builds Documentation/output_snippets/ - - cuda_examples_Debug + - job: cuda_examples_Debug + artifacts: true script: - ./Documentation/build artifacts: @@ -622,6 +624,7 @@ deploy documentation: - develop - schedules - triggers + # use "dependencies" instead of "needs" to deploy only when the entire pipeline succeeds dependencies: - build documentation script: -- GitLab From f4d1bb738763d83a46cb7e0eb3304b570232d65f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= Date: Sun, 14 Jun 2020 16:18:00 +0200 Subject: [PATCH 03/12] Fixed typos in MatrixType.h --- src/TNL/Matrices/MatrixType.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TNL/Matrices/MatrixType.h b/src/TNL/Matrices/MatrixType.h index ad1faaa8b..5eececf51 100644 --- a/src/TNL/Matrices/MatrixType.h +++ b/src/TNL/Matrices/MatrixType.h @@ -32,8 +32,8 @@ struct MatrixType type = "General"; else { - if( isSymmetric ) type = "Symmetric"; - if( isBinary ) type += "Binary"; + if( isSymmetric() ) type = "Symmetric"; + if( isBinary() ) type += "Binary"; } return type; } -- GitLab From 7f074380e17c081b1ac23a5c8eb903a61e2afe88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= Date: Sun, 14 Jun 2020 16:18:32 +0200 Subject: [PATCH 04/12] Commented out unused variable in GMRES_impl.h --- src/TNL/Solvers/Linear/GMRES_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TNL/Solvers/Linear/GMRES_impl.h b/src/TNL/Solvers/Linear/GMRES_impl.h index 2e1d9fbb2..02a122a5d 100644 --- a/src/TNL/Solvers/Linear/GMRES_impl.h +++ b/src/TNL/Solvers/Linear/GMRES_impl.h @@ -185,7 +185,7 @@ orthogonalize_CGS( const int m, const RealType normb, const RealType beta ) // initial binding to _M_tmp sets the correct local range, global size and // communication group for distributed views VectorViewType v_i( _M_tmp.getView() ); - VectorViewType v_k( _M_tmp.getView() ); +// VectorViewType v_k( _M_tmp.getView() ); /*** * v_0 = r / | r | = 1.0 / beta * r -- GitLab From c8ed0db845f5024de2af69aa61ac89fc5cdf5f83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= Date: Sun, 14 Jun 2020 17:39:34 +0200 Subject: [PATCH 05/12] Disabled parallel scan on the host when OpenMP is disabled --- src/TNL/Algorithms/Scan.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/TNL/Algorithms/Scan.hpp b/src/TNL/Algorithms/Scan.hpp index fc1f2f1e5..74351077e 100644 --- a/src/TNL/Algorithms/Scan.hpp +++ b/src/TNL/Algorithms/Scan.hpp @@ -108,8 +108,12 @@ perform( Vector& v, const typename Vector::RealType zero ) { #ifdef HAVE_OPENMP - const auto blockShifts = performFirstPhase( v, begin, end, reduction, zero ); - performSecondPhase( v, blockShifts, begin, end, reduction, zero ); + if( Devices::Host::isOMPEnabled() && Devices::Host::getMaxThreadsCount() >= 2 ) { + const auto blockShifts = performFirstPhase( v, begin, end, reduction, zero ); + performSecondPhase( v, blockShifts, begin, end, reduction, zero ); + } + else + Scan< Devices::Sequential, Type >::perform( v, begin, end, reduction, zero ); #else Scan< Devices::Sequential, Type >::perform( v, begin, end, reduction, zero ); #endif -- GitLab From f1bdcc741d4ad4eee6c643005a826a8abe80534c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= Date: Sun, 14 Jun 2020 17:50:06 +0200 Subject: [PATCH 06/12] Hidden unused device-only variables from the host compiler --- src/Benchmarks/BLAS/vector-operations.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Benchmarks/BLAS/vector-operations.h b/src/Benchmarks/BLAS/vector-operations.h index 7254ba9f4..5531b360d 100644 --- a/src/Benchmarks/BLAS/vector-operations.h +++ b/src/Benchmarks/BLAS/vector-operations.h @@ -56,7 +56,9 @@ benchmarkVectorOperations( Benchmark & benchmark, #endif HostView hostView( hostVector ), hostView2( hostVector2 ), hostView3( hostVector3 ), hostView4( hostVector4 ); +#ifdef HAVE_CUDA CudaView deviceView( deviceVector ), deviceView2( deviceVector2 ), deviceView3( deviceVector3 ), deviceView4( deviceVector4 ); +#endif Real resultHost, resultDevice; -- GitLab From ee7c23377e53a7661af7e21b8ce54b8e2ab289e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= Date: Sun, 14 Jun 2020 17:50:22 +0200 Subject: [PATCH 07/12] Fixed reset functions in the SpMV benchmark --- src/Benchmarks/SpMV/spmv-legacy.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Benchmarks/SpMV/spmv-legacy.h b/src/Benchmarks/SpMV/spmv-legacy.h index 91db24d01..617f34479 100644 --- a/src/Benchmarks/SpMV/spmv-legacy.h +++ b/src/Benchmarks/SpMV/spmv-legacy.h @@ -243,7 +243,7 @@ benchmarkSpmvSynthetic( Benchmark& benchmark, auto resetHostVectors = [&]() { hostInVector = 1.0; - hostOutVector == 0.0; + hostOutVector = 0.0; }; auto spmvCSRHost = [&]() { @@ -279,7 +279,7 @@ benchmarkSpmvSynthetic( Benchmark& benchmark, auto resetCusparseVectors = [&]() { cusparseInVector = 1.0; - cusparseOutVector == 0.0; + cusparseOutVector = 0.0; }; auto spmvCusparse = [&]() { -- GitLab From 5f52a19e2500cbb600d4c3472d0e027d44aa00c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= Date: Sun, 14 Jun 2020 17:52:11 +0200 Subject: [PATCH 08/12] Fixed overriding virtual methods in SparseMatrix --- src/TNL/Matrices/SparseMatrix.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/TNL/Matrices/SparseMatrix.h b/src/TNL/Matrices/SparseMatrix.h index 268af8a33..9b6bf9fd1 100644 --- a/src/TNL/Matrices/SparseMatrix.h +++ b/src/TNL/Matrices/SparseMatrix.h @@ -322,7 +322,7 @@ class SparseMatrix : public Matrix< Real, Device, Index, RealAllocator > * \par Output * \include SparseMatrixExample_getSerializationType.out */ - virtual String getSerializationTypeVirtual() const; + virtual String getSerializationTypeVirtual() const override; /** * \brief Set number of rows and columns of this matrix. @@ -855,21 +855,21 @@ class SparseMatrix : public Matrix< Real, Device, Index, RealAllocator > * * \param fileName is name of the file. */ - void save( File& file ) const; + virtual void save( File& file ) const override; /** * \brief Method for loading the matrix from a file. * * \param fileName is name of the file. */ - void load( File& file ); + virtual void load( File& file ) override; /** * \brief Method for printing the matrix to output stream. * * \param str is the output stream. */ - void print( std::ostream& str ) const; + virtual void print( std::ostream& str ) const override; /** * \brief Returns a padding index value. -- GitLab From ff3c6ad0644e9a04d6542753b373bcd9bfebbaea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= Date: Sun, 14 Jun 2020 17:59:13 +0200 Subject: [PATCH 09/12] Disabled errors due to -Wunused-value coming from pybind11 --- src/Python/pytnl/tnl/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Python/pytnl/tnl/CMakeLists.txt b/src/Python/pytnl/tnl/CMakeLists.txt index de405e5e5..ca0c10af0 100644 --- a/src/Python/pytnl/tnl/CMakeLists.txt +++ b/src/Python/pytnl/tnl/CMakeLists.txt @@ -33,4 +33,12 @@ endif() # per-target, so we need to undefine it by passing -U NDEBUG. target_compile_options( pytnl PRIVATE -U NDEBUG -D TNL_THROW_ASSERTION_ERROR ) +# disable errors due to -Wunused-value coming from pybind11 +if( ${WITH_CI_FLAGS} ) + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + target_compile_options( pytnl PRIVATE -Wno-error=unused-value ) + endif() +endif() + + install( TARGETS pytnl DESTINATION ${PYTHON_SITE_PACKAGES_DIR} ) -- GitLab From d04bdde0bf7ca44815347e48b8f3b3b3b599a969 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= Date: Sun, 14 Jun 2020 18:08:57 +0200 Subject: [PATCH 10/12] .gitlab-ci.yml: mark all build jobs as interruptible --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d09d22dd5..2e08e74d8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -91,6 +91,7 @@ stages: - Documentation/Tutorials/**/*.{h,hpp,cpp,cu} - "**/CMakeLists.txt" - .gitlab-ci.yml + interruptible: true # Dummy build job to ensure that a pipeline is created for a merge request, even # when there were no changes. -- GitLab From 6a2c91f0b9192cee77f2adcaff3f66f4fdf927ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= Date: Sun, 14 Jun 2020 18:22:54 +0200 Subject: [PATCH 11/12] .gitlab-ci.yml: shortening definitions of build jobs --- .gitlab-ci.yml | 291 ++++++++++++++----------------------------------- 1 file changed, 80 insertions(+), 211 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2e08e74d8..b2d553d13 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -32,6 +32,23 @@ stages: WITH_TOOLS: "no" WITH_PYTHON: "no" +# base for OpenMP+MPI builds +.openmp_mpi: + tags: + - openmp + - mpi + variables: + WITH_OPENMP: "yes" + WITH_MPI: "yes" + +.cuda_openmp_mpi: + extends: .openmp_mpi + # tags are overridden, not merged... + tags: + - gpu + - openmp + - mpi + # base for Clang builds .clang: variables: @@ -41,6 +58,13 @@ stages: tags: - clang +.clang_mpi: + extends: .clang + # tags are overridden, not merged... + tags: + - clang + - mpi + # template for build jobs .build_template_def: &build_template stage: build @@ -116,11 +140,9 @@ dummy build job: cuda_tests_Debug: <<: *build_template tags: - - openmp - gpu variables: <<: *default_cmake_flags - WITH_OPENMP: "yes" WITH_CUDA: "yes" BUILD_TYPE: Debug WITH_TESTS: "yes" @@ -128,11 +150,9 @@ cuda_tests_Debug: cuda_tests_Release: <<: *build_template tags: - - openmp - gpu variables: <<: *default_cmake_flags - WITH_OPENMP: "yes" WITH_CUDA: "yes" BUILD_TYPE: Release WITH_TESTS: "yes" @@ -141,11 +161,9 @@ cuda_tests_Release: 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" @@ -153,11 +171,9 @@ cuda_matrix_tests_Debug: 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" @@ -166,11 +182,9 @@ cuda_matrix_tests_Release: cuda_examples_Debug: <<: *build_template tags: - - openmp - gpu variables: <<: *default_cmake_flags - WITH_OPENMP: "yes" WITH_CUDA: "yes" BUILD_TYPE: Debug WITH_EXAMPLES: "yes" @@ -184,11 +198,9 @@ cuda_examples_Debug: cuda_examples_Release: <<: *build_template tags: - - openmp - gpu variables: <<: *default_cmake_flags - WITH_OPENMP: "yes" WITH_CUDA: "yes" BUILD_TYPE: Release WITH_EXAMPLES: "yes" @@ -197,11 +209,9 @@ cuda_examples_Release: cuda_benchmarks_tools_python_Debug: <<: *build_template tags: - - openmp - gpu variables: <<: *default_cmake_flags - WITH_OPENMP: "yes" WITH_CUDA: "yes" BUILD_TYPE: Debug WITH_BENCHMARKS: "yes" @@ -211,11 +221,9 @@ cuda_benchmarks_tools_python_Debug: cuda_benchmarks_tools_python_Release: <<: *build_template tags: - - openmp - gpu variables: <<: *default_cmake_flags - WITH_OPENMP: "yes" WITH_CUDA: "yes" BUILD_TYPE: Release WITH_BENCHMARKS: "yes" @@ -224,123 +232,44 @@ cuda_benchmarks_tools_python_Release: cuda_mpi_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_TESTS: "yes" + extends: + - cuda_tests_Debug + - .cuda_openmp_mpi cuda_mpi_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_TESTS: "yes" - + extends: + - cuda_tests_Release + - .cuda_openmp_mpi 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" + extends: + - cuda_matrix_tests_Debug + - .cuda_openmp_mpi 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" - + extends: + - cuda_matrix_tests_Release + - .cuda_openmp_mpi cuda_mpi_examples_Debug: - <<: *build_template - tags: - - openmp - - gpu - - mpi - variables: - <<: *default_cmake_flags - WITH_OPENMP: "yes" - WITH_CUDA: "yes" - WITH_MPI: "yes" - BUILD_TYPE: Debug - WITH_EXAMPLES: "yes" + extends: + - cuda_examples_Debug + - .cuda_openmp_mpi cuda_mpi_examples_Release: - <<: *build_template - tags: - - openmp - - gpu - - mpi - variables: - <<: *default_cmake_flags - WITH_OPENMP: "yes" - WITH_CUDA: "yes" - WITH_MPI: "yes" - BUILD_TYPE: Release - WITH_EXAMPLES: "yes" - + extends: + - cuda_examples_Release + - .cuda_openmp_mpi cuda_mpi_benchmarks_tools_python_Debug: - <<: *build_template - tags: - - openmp - - gpu - - mpi - variables: - <<: *default_cmake_flags - WITH_OPENMP: "yes" - WITH_CUDA: "yes" - WITH_MPI: "yes" - BUILD_TYPE: Debug - WITH_BENCHMARKS: "yes" - WITH_TOOLS: "yes" - WITH_PYTHON: "yes" + extends: + - cuda_benchmarks_tools_python_Debug + - .cuda_openmp_mpi cuda_mpi_benchmarks_tools_python_Release: - <<: *build_template - tags: - - openmp - - gpu - - mpi - variables: - <<: *default_cmake_flags - WITH_OPENMP: "yes" - WITH_CUDA: "yes" - WITH_MPI: "yes" - BUILD_TYPE: Release - WITH_BENCHMARKS: "yes" - WITH_TOOLS: "yes" - WITH_PYTHON: "yes" + extends: + - cuda_benchmarks_tools_python_Release + - .cuda_openmp_mpi @@ -408,104 +337,44 @@ default_benchmarks_tools_python_Release: mpi_tests_Debug: - <<: *build_template - tags: - - openmp - - mpi - variables: - <<: *default_cmake_flags - WITH_OPENMP: "yes" - WITH_MPI: "yes" - BUILD_TYPE: Debug - WITH_TESTS: "yes" + extends: + - default_tests_Debug + - .openmp_mpi mpi_tests_Release: - <<: *build_template - tags: - - openmp - - mpi - variables: - <<: *default_cmake_flags - WITH_OPENMP: "yes" - WITH_MPI: "yes" - BUILD_TYPE: Release - WITH_TESTS: "yes" + extends: + - default_tests_Release + - .openmp_mpi 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" + extends: + - default_matrix_tests_Debug + - .openmp_mpi 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" + extends: + - default_matrix_tests_Release + - .openmp_mpi mpi_examples_Debug: - <<: *build_template - tags: - - openmp - - mpi - variables: - <<: *default_cmake_flags - WITH_OPENMP: "yes" - WITH_MPI: "yes" - BUILD_TYPE: Debug - WITH_EXAMPLES: "yes" + extends: + - default_examples_Debug + - .openmp_mpi mpi_examples_Release: - <<: *build_template - tags: - - openmp - - mpi - variables: - <<: *default_cmake_flags - WITH_OPENMP: "yes" - WITH_MPI: "yes" - BUILD_TYPE: Release - WITH_EXAMPLES: "yes" + extends: + - default_examples_Release + - .openmp_mpi mpi_benchmarks_tools_python_Debug: - <<: *build_template - tags: - - openmp - - mpi - variables: - <<: *default_cmake_flags - WITH_OPENMP: "yes" - WITH_MPI: "yes" - BUILD_TYPE: Debug - WITH_BENCHMARKS: "yes" - WITH_TOOLS: "yes" - WITH_PYTHON: "yes" + extends: + - default_benchmarks_tools_python_Debug + - .openmp_mpi mpi_benchmarks_tools_python_Release: - <<: *build_template - tags: - - openmp - - mpi - variables: - <<: *default_cmake_flags - WITH_OPENMP: "yes" - WITH_MPI: "yes" - BUILD_TYPE: Release - WITH_BENCHMARKS: "yes" - WITH_TOOLS: "yes" - WITH_PYTHON: "yes" + extends: + - default_benchmarks_tools_python_Release + - .openmp_mpi clang_tests_Debug: @@ -552,42 +421,42 @@ clang_benchmarks_tools_python_Release: clang_mpi_tests_Debug: extends: - mpi_tests_Debug - - .clang + - .clang_mpi clang_mpi_tests_Release: extends: - mpi_tests_Release - - .clang + - .clang_mpi clang_mpi_matrix_tests_Debug: extends: - mpi_matrix_tests_Debug - - .clang + - .clang_mpi clang_mpi_matrix_tests_Release: extends: - mpi_matrix_tests_Release - - .clang + - .clang_mpi clang_mpi_examples_Debug: extends: - mpi_examples_Debug - - .clang + - .clang_mpi clang_mpi_examples_Release: extends: - mpi_examples_Release - - .clang + - .clang_mpi clang_mpi_benchmarks_tools_python_Debug: extends: - mpi_benchmarks_tools_python_Debug - - .clang + - .clang_mpi clang_mpi_benchmarks_tools_python_Release: extends: - mpi_benchmarks_tools_python_Release - - .clang + - .clang_mpi -- GitLab From b1f65d48ffdabd59f4b0f3459c93e9ff26db97bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= Date: Sun, 14 Jun 2020 20:47:24 +0200 Subject: [PATCH 12/12] .gitlab-ci.yml: use stages --- .gitlab-ci.yml | 59 +++++++++++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 25 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b2d553d13..fc5b04679 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,14 +5,12 @@ before_script: - which cmake - which ninja -# Stages are useful only to enforce some ordering of the jobs. Every job is run -# in its own directory and only very few data can be shared between the jobs in -# different stages. It has to be zipped and uploaded to the server, so we can't -# do it with the build directory. Hence, we must build, test and install in the -# same job. stages: - build - - doc_build + - build:cuda + - build:gcc + - build:clang + - build:doc - deploy # default flags for cmake @@ -51,6 +49,7 @@ stages: # base for Clang builds .clang: + stage: build:clang variables: CXX: clang++ CC: clang @@ -66,8 +65,10 @@ stages: - mpi # template for build jobs -.build_template_def: &build_template - stage: build +.build_template: + stage: build:gcc + # don't wait for jobs in previous stages to complete before starting this job + needs: [] script: # all cores including hyperthreading # - export NUM_CORES=$(grep "core id" /proc/cpuinfo | wc -l) @@ -138,7 +139,8 @@ dummy build job: # significantly more time than debug builds). cuda_tests_Debug: - <<: *build_template + extends: .build_template + stage: build:cuda tags: - gpu variables: @@ -148,7 +150,8 @@ cuda_tests_Debug: WITH_TESTS: "yes" cuda_tests_Release: - <<: *build_template + extends: .build_template + stage: build:cuda tags: - gpu variables: @@ -159,7 +162,8 @@ cuda_tests_Release: cuda_matrix_tests_Debug: - <<: *build_template + extends: .build_template + stage: build:cuda tags: - gpu variables: @@ -169,7 +173,8 @@ cuda_matrix_tests_Debug: WITH_MATRIX_TESTS: "yes" cuda_matrix_tests_Release: - <<: *build_template + extends: .build_template + stage: build:cuda tags: - gpu variables: @@ -180,7 +185,8 @@ cuda_matrix_tests_Release: cuda_examples_Debug: - <<: *build_template + extends: .build_template + stage: build:cuda tags: - gpu variables: @@ -196,7 +202,8 @@ cuda_examples_Debug: - Documentation/output_snippets/ cuda_examples_Release: - <<: *build_template + extends: .build_template + stage: build:cuda tags: - gpu variables: @@ -207,7 +214,8 @@ cuda_examples_Release: cuda_benchmarks_tools_python_Debug: - <<: *build_template + extends: .build_template + stage: build:cuda tags: - gpu variables: @@ -219,7 +227,8 @@ cuda_benchmarks_tools_python_Debug: WITH_PYTHON: "yes" cuda_benchmarks_tools_python_Release: - <<: *build_template + extends: .build_template + stage: build:cuda tags: - gpu variables: @@ -276,49 +285,49 @@ cuda_mpi_benchmarks_tools_python_Release: default_tests_Debug: - <<: *build_template + extends: .build_template variables: <<: *default_cmake_flags BUILD_TYPE: Debug WITH_TESTS: "yes" default_tests_Release: - <<: *build_template + extends: .build_template variables: <<: *default_cmake_flags BUILD_TYPE: Release WITH_TESTS: "yes" default_matrix_tests_Debug: - <<: *build_template + extends: .build_template variables: <<: *default_cmake_flags BUILD_TYPE: Debug WITH_MATRIX_TESTS: "yes" default_matrix_tests_Release: - <<: *build_template + extends: .build_template variables: <<: *default_cmake_flags BUILD_TYPE: Release WITH_MATRIX_TESTS: "yes" default_examples_Debug: - <<: *build_template + extends: .build_template variables: <<: *default_cmake_flags BUILD_TYPE: Debug WITH_EXAMPLES: "yes" default_examples_Release: - <<: *build_template + extends: .build_template variables: <<: *default_cmake_flags BUILD_TYPE: Release WITH_EXAMPLES: "yes" default_benchmarks_tools_python_Debug: - <<: *build_template + extends: .build_template variables: <<: *default_cmake_flags BUILD_TYPE: Debug @@ -327,7 +336,7 @@ default_benchmarks_tools_python_Debug: WITH_PYTHON: "yes" default_benchmarks_tools_python_Release: - <<: *build_template + extends: .build_template variables: <<: *default_cmake_flags BUILD_TYPE: Release @@ -462,7 +471,7 @@ clang_mpi_benchmarks_tools_python_Release: build documentation: - stage: doc_build + stage: build:doc only: changes: - Documentation/**/* -- GitLab