Skip to content

Commit

Permalink
Update all actions to use Ninja instead of make (#1256)
Browse files Browse the repository at this point in the history
Description
I think it is well documented by now that Ninja is a more efficient build system than make, especially in parallel. This PR changes all CI actions to use Ninja instead of make. This is just a simple change in the cmake configuration file and running ninja instead of make

Testing
Nothing should be altered anywhere, ideally it should just decrease slightly the CI run time.
  • Loading branch information
blaisb authored Aug 22, 2024
1 parent afe7dbb commit ce7667e
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ jobs:
run: |
mkdir build-debug
cd build-debug
cmake ../ -DCMAKE_BUILD_TYPE=Debug
make -j${{ env.COMPILE_JOBS }}
cmake ../ -DCMAKE_BUILD_TYPE=Debug -G Ninja
ninja -j${{ env.COMPILE_JOBS }}
# These tests require a single core each so we will run them in parallel
- name: Run Lethe tests (Debug-deal.ii:${{ matrix.dealii_version }})
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/examples-parameter-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ jobs:
ls
mkdir build-parameter-files
cd build-parameter-files
cmake ../ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../inst/
make install -j${{ env.COMPILE_JOBS }}
cmake ../ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../inst/ -G Ninja
ninja install -j${{ env.COMPILE_JOBS }}
cd ../inst/bin
install_dir=$(pwd)
cd ../../
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main_dealii_distributed_vectors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,5 @@ jobs:
run: |
mkdir build-warnings
cd build-warnings
cmake ../ -DCMAKE_BUILD_TYPE=Debug -DLETHE_USE_LDV=ON
make -j${{ env.COMPILE_JOBS }}
cmake ../ -DCMAKE_BUILD_TYPE=Debug -DLETHE_USE_LDV=ON -G Ninja
ninja -j${{ env.COMPILE_JOBS }}
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ jobs:
run: |
mkdir build-release
cd build-release
cmake ../ -DCMAKE_BUILD_TYPE=Release
make -j${{ env.COMPILE_JOBS }}
cmake ../ -DCMAKE_BUILD_TYPE=Release -G Ninja
ninja -j${{ env.COMPILE_JOBS }}
# These tests require a single core each so we will run them in parallel
# Only run tests on deal.ii master version
# Restart files are not compatible with deal.ii v9.5.0
- name: Run Lethe tests (Release-deal.ii:${{ matrix.dealii_version }})
if: ${{ matrix.dealii_version == 'master'}}
# if: ${{ matrix.dealii_version == 'master-focal'}}
run: |
#Allow OMPI to run as root
export OMPI_ALLOW_RUN_AS_ROOT=1
Expand All @@ -82,7 +82,7 @@ jobs:
# Only run tests on deal.ii master version
# Restart files are not compatible with deal.ii v9.5.0
- name: Run multi-core Lethe tests (Release-deal.ii:${{ matrix.dealii_version }})
if: ${{ matrix.dealii_version == 'master'}}
# if: ${{ matrix.dealii_version == 'master-focal'}}
run: |
#Allow OMPI to run as root
export OMPI_ALLOW_RUN_AS_ROOT=1
Expand All @@ -91,4 +91,4 @@ jobs:
# Print the tests to be executed
ctest -N --tests-regex ${{ env.MULTI_CORE_TESTS_REGEX }}
# Run sequencially
ctest --output-on-failure --tests-regex ${{ env.MULTI_CORE_TESTS_REGEX }}
ctest --output-on-failure --tests-regex ${{ env.MULTI_CORE_TESTS_REGEX }}
4 changes: 2 additions & 2 deletions .github/workflows/warnings-gcc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,5 @@ jobs:
run: |
mkdir build-warnings
cd build-warnings
cmake ../ -DCMAKE_BUILD_TYPE=Debug -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -DBUILD_PROTOTYPES=ON
make -j${{ env.COMPILE_JOBS }}
cmake ../ -DCMAKE_BUILD_TYPE=Debug -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -DBUILD_PROTOTYPES=ON -G Ninja
ninja -j${{ env.COMPILE_JOBS }}
4 changes: 2 additions & 2 deletions source/dem/visualization.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ Visualization<dim>::build_patches(
// Check to see if the property is a vector
if (components_number == dim)
{
vector_datasets.push_back(std::make_tuple(
vector_datasets.emplace_back(std::make_tuple(
field_position,
field_position + components_number - 1,
field_name,
DataComponentInterpretation::component_is_part_of_vector));
}
dataset_names.push_back(field_name);
dataset_names.emplace_back(field_name);
}

// Building the patch data
Expand Down

0 comments on commit ce7667e

Please sign in to comment.