From d360a30ed59013b3c0ed00de7d2b5a9f8c676f1b Mon Sep 17 00:00:00 2001 From: Steven Roberts Date: Fri, 17 Jan 2025 19:15:31 -0800 Subject: [PATCH 1/5] Run (c)make commands in parallel --- .github/actions/test-driver/action.yml | 1 + .github/workflows/docs-pdfs.yml | 8 ++++---- .github/workflows/macos-latest.yml | 5 ++++- .github/workflows/ubuntu-clang-latest.yml | 5 ++++- .github/workflows/ubuntu-latest-oneapi.yml | 5 ++++- .github/workflows/windows-latest-intel.yml | 4 ++-- .github/workflows/windows-latest-mingw.yml | 4 ++-- .github/workflows/windows-latest.yml | 2 +- 8 files changed, 22 insertions(+), 12 deletions(-) diff --git a/.github/actions/test-driver/action.yml b/.github/actions/test-driver/action.yml index 47c0fab83f..e9e24bfc7d 100644 --- a/.github/actions/test-driver/action.yml +++ b/.github/actions/test-driver/action.yml @@ -32,6 +32,7 @@ runs: ./test_driver.sh \ --testtype CUSTOM \ --env env/docker.sh \ + --buildjobs $(nproc) \ --tpls ${{ inputs.tpls }} \ --sunrealtype ${{ inputs.precision }} \ --indexsize ${{ inputs.indexsize }} diff --git a/.github/workflows/docs-pdfs.yml b/.github/workflows/docs-pdfs.yml index b2745ebb22..14ba48fff1 100644 --- a/.github/workflows/docs-pdfs.yml +++ b/.github/workflows/docs-pdfs.yml @@ -39,7 +39,7 @@ jobs: pip install -r doc/requirements.txt - name: Build docs - run: cd doc/install_guide && make latexpdf + run: cd doc/install_guide && make -j$(nproc) latexpdf - name: Archive files from failed build uses: actions/upload-artifact@v4 @@ -91,7 +91,7 @@ jobs: pip install -r doc/requirements.txt - name: Build docs - run: cd doc/${{matrix.package}}/guide && make latexpdf + run: cd doc/${{matrix.package}}/guide && make -j$(nproc) latexpdf # run: cd doc/${{matrix.package}}/${{matrix.type}} && make latexpdf - name: Archive files from failed build @@ -146,7 +146,7 @@ jobs: pip install -r doc/requirements.txt - name: Build docs - run: cd doc/${{matrix.package}}/examples && make latexpdf + run: cd doc/${{matrix.package}}/examples && make -j$(nproc) latexpdf - name: Archive files from failed build uses: actions/upload-artifact@v4 @@ -191,7 +191,7 @@ jobs: submodules: true - name: Build docs - run: cd doc/${{matrix.package}} && make ex + run: cd doc/${{matrix.package}} && make -j$(nproc) ex - name: Archive files from failed build uses: actions/upload-artifact@v4 diff --git a/.github/workflows/macos-latest.yml b/.github/workflows/macos-latest.yml index ae0eb137d2..aacd531723 100644 --- a/.github/workflows/macos-latest.yml +++ b/.github/workflows/macos-latest.yml @@ -35,7 +35,10 @@ jobs: - name: Build # Build your program with the given configuration - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + run: cmake \ + --build ${{github.workspace}}/build \ + --parallel $(sysctl -n hw.ncpu) \ + --config ${{env.BUILD_TYPE}} - name: Test working-directory: ${{github.workspace}}/build diff --git a/.github/workflows/ubuntu-clang-latest.yml b/.github/workflows/ubuntu-clang-latest.yml index 2031797a42..baf57aabb6 100644 --- a/.github/workflows/ubuntu-clang-latest.yml +++ b/.github/workflows/ubuntu-clang-latest.yml @@ -47,7 +47,10 @@ jobs: - name: Build # Build your program with the given configuration - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + run: cmake \ + --build ${{github.workspace}}/build \ + --parallel $(nproc) \ + --config ${{env.BUILD_TYPE}} - name: Test # Run logging tests diff --git a/.github/workflows/ubuntu-latest-oneapi.yml b/.github/workflows/ubuntu-latest-oneapi.yml index bebd04efad..7f653b9df1 100644 --- a/.github/workflows/ubuntu-latest-oneapi.yml +++ b/.github/workflows/ubuntu-latest-oneapi.yml @@ -42,4 +42,7 @@ jobs: -D ENABLE_SYCL=ON - name: Build - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + run: cmake \ + --build ${{github.workspace}}/build \ + --parallel $(nproc) \ + --config ${{env.BUILD_TYPE}} diff --git a/.github/workflows/windows-latest-intel.yml b/.github/workflows/windows-latest-intel.yml index 4e3f292e04..3108b24032 100644 --- a/.github/workflows/windows-latest-intel.yml +++ b/.github/workflows/windows-latest-intel.yml @@ -33,7 +33,7 @@ jobs: run: cmake -G "Ninja" -B ${{github.workspace}}/build_static -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_FLAGS=-Wno-deprecated-declarations -DCMAKE_C_COMPILER=icx-cl -DCMAKE_CXX_COMPILER=icx-cl -DCMAKE_Fortran_COMPILER=ifx -DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_FORTRAN_MODULE_INTERFACE=ON -DSUNDIALS_BUILD_WITH_PROFILING=ON -DSUNDIALS_TEST_ENABLE_UNIT_TESTS=OFF -DEXAMPLES_ENABLE_CXX=ON - name: Build (Static) - run: cmake --build ${{github.workspace}}/build_static --verbose + run: cmake --build ${{github.workspace}}/build_static --parallel $NUMBER_OF_PROCESSORS --verbose - name: Test (Static) working-directory: ${{github.workspace}}/build_static @@ -43,7 +43,7 @@ jobs: run: cmake -G "Ninja" -B ${{github.workspace}}/build_shared -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_FLAGS=-Wno-deprecated-declarations -DCMAKE_C_COMPILER=icx-cl -DCMAKE_CXX_COMPILER=icx-cl -DCMAKE_Fortran_COMPILER=ifx -DBUILD_STATIC_LIBS=OFF -DBUILD_SHARED_LIBS=ON -DBUILD_FORTRAN_MODULE_INTERFACE=ON -DSUNDIALS_BUILD_WITH_PROFILING=ON -DSUNDIALS_TEST_ENABLE_UNIT_TESTS=OFF -DEXAMPLES_ENABLE_CXX=ON - name: Build (Shared) - run: cmake --build ${{github.workspace}}/build_shared --verbose + run: q ${{github.workspace}}/build_shared --parallel $NUMBER_OF_PROCESSORS --verbose - name: Test (Shared) working-directory: ${{github.workspace}}/build_shared diff --git a/.github/workflows/windows-latest-mingw.yml b/.github/workflows/windows-latest-mingw.yml index bb103d049f..1ccd50e88d 100644 --- a/.github/workflows/windows-latest-mingw.yml +++ b/.github/workflows/windows-latest-mingw.yml @@ -64,7 +64,7 @@ jobs: - name: Build (Static) # Build program - run: cmake --build ${GITHUB_WORKSPACE}/build_static --verbose + run: cmake --build ${GITHUB_WORKSPACE}/build_static --parallel $NUMBER_OF_PROCESSORS --verbose - name: Test (Static) working-directory: ${{github.workspace}}/build_static @@ -91,7 +91,7 @@ jobs: - name: Build (Shared) # Build program - run: cmake --build ${GITHUB_WORKSPACE}/build_shared --verbose + run: cmake --build ${GITHUB_WORKSPACE}/build_shared --parallel $NUMBER_OF_PROCESSORS --verbose - name: Test (Shared) working-directory: ${{github.workspace}}/build_shared diff --git a/.github/workflows/windows-latest.yml b/.github/workflows/windows-latest.yml index ea1c4bbcfc..96a35a9130 100644 --- a/.github/workflows/windows-latest.yml +++ b/.github/workflows/windows-latest.yml @@ -23,7 +23,7 @@ jobs: run: cmake -G "Visual Studio 17 2022" -B ${{github.workspace}}/build -DSUNDIALS_BUILD_WITH_PROFILING=ON -DSUNDIALS_TEST_ENABLE_UNIT_TESTS=ON -DEXAMPLES_ENABLE_CXX=ON - name: Build - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --verbose + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel $NUMBER_OF_PROCESSORS --verbose - name: Test working-directory: ${{github.workspace}}/build From 715c56272e6746a2621271a4c0c32e2cc981dc19 Mon Sep 17 00:00:00 2001 From: Steven Roberts Date: Fri, 17 Jan 2025 23:54:17 -0500 Subject: [PATCH 2/5] Apply suggestions from code review Co-authored-by: David Gardner --- .github/workflows/macos-latest.yml | 3 ++- .github/workflows/ubuntu-clang-latest.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/macos-latest.yml b/.github/workflows/macos-latest.yml index aacd531723..870e547127 100644 --- a/.github/workflows/macos-latest.yml +++ b/.github/workflows/macos-latest.yml @@ -35,7 +35,8 @@ jobs: - name: Build # Build your program with the given configuration - run: cmake \ + run: | + cmake \ --build ${{github.workspace}}/build \ --parallel $(sysctl -n hw.ncpu) \ --config ${{env.BUILD_TYPE}} diff --git a/.github/workflows/ubuntu-clang-latest.yml b/.github/workflows/ubuntu-clang-latest.yml index baf57aabb6..9fe8e1fd29 100644 --- a/.github/workflows/ubuntu-clang-latest.yml +++ b/.github/workflows/ubuntu-clang-latest.yml @@ -47,7 +47,8 @@ jobs: - name: Build # Build your program with the given configuration - run: cmake \ + run: | + cmake \ --build ${{github.workspace}}/build \ --parallel $(nproc) \ --config ${{env.BUILD_TYPE}} From 13b0dacd9376b30fb7a5fa2bdf466e86f8954d28 Mon Sep 17 00:00:00 2001 From: Steven Roberts Date: Fri, 17 Jan 2025 23:55:01 -0500 Subject: [PATCH 3/5] Apply suggestions from code review Co-authored-by: David Gardner --- .github/workflows/ubuntu-latest-oneapi.yml | 3 ++- .github/workflows/windows-latest-intel.yml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ubuntu-latest-oneapi.yml b/.github/workflows/ubuntu-latest-oneapi.yml index 7f653b9df1..06c13a33a8 100644 --- a/.github/workflows/ubuntu-latest-oneapi.yml +++ b/.github/workflows/ubuntu-latest-oneapi.yml @@ -42,7 +42,8 @@ jobs: -D ENABLE_SYCL=ON - name: Build - run: cmake \ + run: | + cmake \ --build ${{github.workspace}}/build \ --parallel $(nproc) \ --config ${{env.BUILD_TYPE}} diff --git a/.github/workflows/windows-latest-intel.yml b/.github/workflows/windows-latest-intel.yml index 3108b24032..7d84a3a3d3 100644 --- a/.github/workflows/windows-latest-intel.yml +++ b/.github/workflows/windows-latest-intel.yml @@ -43,7 +43,7 @@ jobs: run: cmake -G "Ninja" -B ${{github.workspace}}/build_shared -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_FLAGS=-Wno-deprecated-declarations -DCMAKE_C_COMPILER=icx-cl -DCMAKE_CXX_COMPILER=icx-cl -DCMAKE_Fortran_COMPILER=ifx -DBUILD_STATIC_LIBS=OFF -DBUILD_SHARED_LIBS=ON -DBUILD_FORTRAN_MODULE_INTERFACE=ON -DSUNDIALS_BUILD_WITH_PROFILING=ON -DSUNDIALS_TEST_ENABLE_UNIT_TESTS=OFF -DEXAMPLES_ENABLE_CXX=ON - name: Build (Shared) - run: q ${{github.workspace}}/build_shared --parallel $NUMBER_OF_PROCESSORS --verbose + run: cmake ${{github.workspace}}/build_shared --parallel $NUMBER_OF_PROCESSORS --verbose - name: Test (Shared) working-directory: ${{github.workspace}}/build_shared From 530f1d476f5f2e771bfcc2b615b58de050073f99 Mon Sep 17 00:00:00 2001 From: Steven Roberts Date: Sat, 18 Jan 2025 00:00:04 -0500 Subject: [PATCH 4/5] Update .github/workflows/windows-latest-intel.yml Co-authored-by: David Gardner --- .github/workflows/windows-latest-intel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows-latest-intel.yml b/.github/workflows/windows-latest-intel.yml index 7d84a3a3d3..610658bde3 100644 --- a/.github/workflows/windows-latest-intel.yml +++ b/.github/workflows/windows-latest-intel.yml @@ -43,7 +43,7 @@ jobs: run: cmake -G "Ninja" -B ${{github.workspace}}/build_shared -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_FLAGS=-Wno-deprecated-declarations -DCMAKE_C_COMPILER=icx-cl -DCMAKE_CXX_COMPILER=icx-cl -DCMAKE_Fortran_COMPILER=ifx -DBUILD_STATIC_LIBS=OFF -DBUILD_SHARED_LIBS=ON -DBUILD_FORTRAN_MODULE_INTERFACE=ON -DSUNDIALS_BUILD_WITH_PROFILING=ON -DSUNDIALS_TEST_ENABLE_UNIT_TESTS=OFF -DEXAMPLES_ENABLE_CXX=ON - name: Build (Shared) - run: cmake ${{github.workspace}}/build_shared --parallel $NUMBER_OF_PROCESSORS --verbose + run: cmake --build ${{github.workspace}}/build_shared --parallel $NUMBER_OF_PROCESSORS --verbose - name: Test (Shared) working-directory: ${{github.workspace}}/build_shared From ed8f729df9d157d95c08ac9f562f9f47117f5db3 Mon Sep 17 00:00:00 2001 From: Steven Roberts Date: Sat, 18 Jan 2025 14:57:52 -0800 Subject: [PATCH 5/5] Enable ctest parallelism --- .github/actions/test-driver/action.yml | 1 + .github/workflows/macos-latest.yml | 5 +++-- .github/workflows/ubuntu-clang-latest.yml | 10 ++++++++-- .github/workflows/ubuntu-latest-oneapi.yml | 3 ++- .github/workflows/windows-latest-intel.yml | 4 ++-- .github/workflows/windows-latest-mingw.yml | 4 ++-- .github/workflows/windows-latest.yml | 2 +- 7 files changed, 19 insertions(+), 10 deletions(-) diff --git a/.github/actions/test-driver/action.yml b/.github/actions/test-driver/action.yml index e9e24bfc7d..7e6b71bcb0 100644 --- a/.github/actions/test-driver/action.yml +++ b/.github/actions/test-driver/action.yml @@ -33,6 +33,7 @@ runs: --testtype CUSTOM \ --env env/docker.sh \ --buildjobs $(nproc) \ + --testjobs $(nproc) \ --tpls ${{ inputs.tpls }} \ --sunrealtype ${{ inputs.precision }} \ --indexsize ${{ inputs.indexsize }} diff --git a/.github/workflows/macos-latest.yml b/.github/workflows/macos-latest.yml index aacd531723..86711ce552 100644 --- a/.github/workflows/macos-latest.yml +++ b/.github/workflows/macos-latest.yml @@ -35,7 +35,8 @@ jobs: - name: Build # Build your program with the given configuration - run: cmake \ + run: | + cmake \ --build ${{github.workspace}}/build \ --parallel $(sysctl -n hw.ncpu) \ --config ${{env.BUILD_TYPE}} @@ -44,4 +45,4 @@ jobs: working-directory: ${{github.workspace}}/build # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail - run: ctest -C ${{env.BUILD_TYPE}} + run: ctest -C ${{env.BUILD_TYPE}} --parallel $(sysctl -n hw.ncpu) diff --git a/.github/workflows/ubuntu-clang-latest.yml b/.github/workflows/ubuntu-clang-latest.yml index baf57aabb6..63028044ae 100644 --- a/.github/workflows/ubuntu-clang-latest.yml +++ b/.github/workflows/ubuntu-clang-latest.yml @@ -47,7 +47,8 @@ jobs: - name: Build # Build your program with the given configuration - run: cmake \ + run: | + cmake \ --build ${{github.workspace}}/build \ --parallel $(nproc) \ --config ${{env.BUILD_TYPE}} @@ -57,6 +58,7 @@ jobs: run: | ctest \ --test-dir ${{github.workspace}}/build \ + --parallel $(nproc) \ --label-regex logging \ --verbose @@ -101,7 +103,11 @@ jobs: - name: Build # Build your program with the given configuration - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + run: | + cmake \ + --build ${{github.workspace}}/build \ + --parallel $(nproc) \ + --config ${{env.BUILD_TYPE}} - name: Archive build files from failed build uses: actions/upload-artifact@v4 diff --git a/.github/workflows/ubuntu-latest-oneapi.yml b/.github/workflows/ubuntu-latest-oneapi.yml index 7f653b9df1..06c13a33a8 100644 --- a/.github/workflows/ubuntu-latest-oneapi.yml +++ b/.github/workflows/ubuntu-latest-oneapi.yml @@ -42,7 +42,8 @@ jobs: -D ENABLE_SYCL=ON - name: Build - run: cmake \ + run: | + cmake \ --build ${{github.workspace}}/build \ --parallel $(nproc) \ --config ${{env.BUILD_TYPE}} diff --git a/.github/workflows/windows-latest-intel.yml b/.github/workflows/windows-latest-intel.yml index 3108b24032..58c56627d8 100644 --- a/.github/workflows/windows-latest-intel.yml +++ b/.github/workflows/windows-latest-intel.yml @@ -37,7 +37,7 @@ jobs: - name: Test (Static) working-directory: ${{github.workspace}}/build_static - run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure + run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure --parallel $NUMBER_OF_PROCESSORS - name: Configure CMake (Shared) run: cmake -G "Ninja" -B ${{github.workspace}}/build_shared -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_FLAGS=-Wno-deprecated-declarations -DCMAKE_C_COMPILER=icx-cl -DCMAKE_CXX_COMPILER=icx-cl -DCMAKE_Fortran_COMPILER=ifx -DBUILD_STATIC_LIBS=OFF -DBUILD_SHARED_LIBS=ON -DBUILD_FORTRAN_MODULE_INTERFACE=ON -DSUNDIALS_BUILD_WITH_PROFILING=ON -DSUNDIALS_TEST_ENABLE_UNIT_TESTS=OFF -DEXAMPLES_ENABLE_CXX=ON @@ -47,4 +47,4 @@ jobs: - name: Test (Shared) working-directory: ${{github.workspace}}/build_shared - run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure + run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure --parallel $NUMBER_OF_PROCESSORS diff --git a/.github/workflows/windows-latest-mingw.yml b/.github/workflows/windows-latest-mingw.yml index 1ccd50e88d..e461375feb 100644 --- a/.github/workflows/windows-latest-mingw.yml +++ b/.github/workflows/windows-latest-mingw.yml @@ -69,7 +69,7 @@ jobs: - name: Test (Static) working-directory: ${{github.workspace}}/build_static # Execute tests - run: ctest --output-on-failure + run: ctest --output-on-failure --parallel $NUMBER_OF_PROCESSORS # TODO(CJB): shared libraries with the fortran interfaces turned on # fail to link correctly with this toolchain see https://github.com/LLNL/sundials/issues/507. @@ -96,4 +96,4 @@ jobs: - name: Test (Shared) working-directory: ${{github.workspace}}/build_shared # Execute tests - run: ctest --output-on-failure + run: ctest --output-on-failure --parallel $NUMBER_OF_PROCESSORS diff --git a/.github/workflows/windows-latest.yml b/.github/workflows/windows-latest.yml index 96a35a9130..ee648a2b42 100644 --- a/.github/workflows/windows-latest.yml +++ b/.github/workflows/windows-latest.yml @@ -27,4 +27,4 @@ jobs: - name: Test working-directory: ${{github.workspace}}/build - run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure + run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure --parallel $NUMBER_OF_PROCESSORS