Skip to content

Commit

Permalink
add nproc flag to builds
Browse files Browse the repository at this point in the history
  • Loading branch information
rrsettgast committed May 24, 2024
1 parent 60d512a commit dc7dfeb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/continuousIntegration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ jobs:
CMAKE_BUILD_TYPE: Release
ENABLE_CUDA: ON
CMAKE_CUDA_ARCHITECTURES: "86"
NPROC: 4
DOCKER_RUN_ARGS: "--cpus=4 --memory=64g --runtime=nvidia --gpus all"

- name: ubuntu22-gcc11-cuda11-dbg (ubuntu-22, gcc 11.4.0, cuda-11.8.0, Debug)
Expand All @@ -147,6 +148,7 @@ jobs:
CMAKE_BUILD_TYPE: Debug
ENABLE_CUDA: ON
CMAKE_CUDA_ARCHITECTURES: "86"
NPROC: 4
DOCKER_RUN_ARGS: "--cpus=4 --memory=64g --runtime=nvidia --gpus all"

- name: ubuntu22-clang14-cuda11-rel (ubuntu-22, clang-14.0.0, cuda-11.8.0, Release)
Expand All @@ -157,6 +159,7 @@ jobs:
CMAKE_BUILD_TYPE: Release
ENABLE_CUDA: ON
CMAKE_CUDA_ARCHITECTURES: "86"
NPROC: 4
DOCKER_RUN_ARGS: "--cpus=4 --memory=64g --runtime=nvidia --gpus all"

- name: ubuntu22-clang14-cuda11-dbg (ubuntu-22, clang-14.0.0, cuda-11.8.0, Debug)
Expand All @@ -167,6 +170,7 @@ jobs:
CMAKE_BUILD_TYPE: Debug
ENABLE_CUDA: ON
CMAKE_CUDA_ARCHITECTURES: "86"
NPROC: 4
DOCKER_RUN_ARGS: "--cpus=4 --memory=64g --runtime=nvidia --gpus all"

- name: RHEL8.9-clang17-cuda12-rel (ubi8.9, clang-17.0.6, cuda-12.4.1, Release)
Expand All @@ -177,6 +181,7 @@ jobs:
CMAKE_BUILD_TYPE: Release
ENABLE_CUDA: ON
CMAKE_CUDA_ARCHITECTURES: "86"
NPROC: 4
DOCKER_RUN_ARGS: "--cpus=4 --memory=64g --runtime=nvidia --gpus all"

- name: RHEL8.9-gcc13-cuda12-rel (ubi8.8, gcc 13.2.1, cuda-12.4.1, Release)
Expand All @@ -187,6 +192,7 @@ jobs:
CMAKE_BUILD_TYPE: Release
ENABLE_CUDA: ON
CMAKE_CUDA_ARCHITECTURES: "86"
NPROC: 4
DOCKER_RUN_ARGS: "--cpus=4 --memory=64g --runtime=nvidia --gpus all"

steps:
Expand All @@ -207,6 +213,7 @@ jobs:
CMAKE_BUILD_TYPE: ${{ matrix.CMAKE_BUILD_TYPE }}
ENABLE_CUDA: ${{ matrix.ENABLE_CUDA }}
CMAKE_CUDA_ARCHITECTURES: ${{ matrix.CMAKE_CUDA_ARCHITECTURES }}
NPROC: ${{ matrix.NPROC }}
BUILD_AND_TEST_ARGS: ${{ matrix.BUILD_AND_TEST_ARGS }} --build-exe
DOCKER_RUN_ARGS: ${{ matrix.DOCKER_RUN_ARGS }}
HOST_CONFIG: hostconfigs/environment.cmake
Expand Down
5 changes: 5 additions & 0 deletions scripts/ci_build_and_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ BUILD_DIR=${GITHUB_WORKSPACE}
BUILD_DIR_MOUNT_POINT=/tmp/Shiva


if [[ -z "${NPROC}" ]]; then
NPROC=$(nproc)
fi

# We need to keep track of the building container (hence the `CONTAINER_NAME`)
# so we can extract the data from it later (if needed). Another solution would have been to use a mount point,
# but that would not have solved the problem for the TPLs (we would require extra action to copy them to the mount point).
Expand All @@ -23,5 +27,6 @@ docker run \
-e ENABLE_CUDA=${ENABLE_CUDA} \
-e CMAKE_CUDA_ARCHITECTURES=${CMAKE_CUDA_ARCHITECTURES} \
-e CMAKE_BUILD_TYPE \
-e NPROC \
${DOCKER_REPOSITORY} \
${BUILD_DIR_MOUNT_POINT}/scripts/ci_build_and_test_in_container.sh ${BUILD_AND_TEST_ARGS};
9 changes: 2 additions & 7 deletions scripts/ci_build_and_test_in_container.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
#!/bin/bash
env

echo "running nproc"
nproc

echo "running free -m"
free -m

# The or_die function run the passed command line and
# exits the program in case of non zero error code
Expand Down Expand Up @@ -70,14 +65,14 @@ fi


if [[ "$*" == *--code-coverage* ]]; then
or_die make -j $(nproc) VERBOSE=1
or_die make -j ${NPROC} VERBOSE=1
or_die make shiva_coverage
cp -r ${SHIVA_BUILD_DIR}/shiva_coverage.info.cleaned /tmp/Shiva/shiva_coverage.info.cleaned
fi


if [[ "$*" == *--build-exe* ]]; then
or_die make -j $(nproc)
or_die make -j ${NPROC}

if [[ "$*" != *--disable-unit-tests* ]]; then
or_die ctest --output-on-failure -E "testUncrustifyCheck|testDoxygenCheck|testCppCheck|testClangTidy"
Expand Down

0 comments on commit dc7dfeb

Please sign in to comment.