Docker: Hardcode the parallelism level for gpuCI jobs, but keep using
`determine_build_parallelism.bash` for local builds.
MODIFY
ci/common/build.bash
ci/common/build.bash
@@ -77,8 +77,7 @@ else
fi
logger "Build Thrust and CUB..."
-source ../ci/common/determine_build_parallelism.bash
-cmake --build . -j${BUILD_THREADS} "${@}"
+cmake --build . -j${PARALLEL_LEVEL} "${@}"
################################################################################
# TEST - Run Thrust and CUB examples and tests.

MODIFY
ci/common/determine_build_parallelism.bash
ci/common/determine_build_parallelism.bash
@@ -21,9 +21,9 @@ export MEM_BOUND_THREADS=$((${TOTAL_MEM_KB} / (2 * 1000 * 1000))) # 2 GB / Build
# Pick the smaller of the two as the default.
if [ ${MEM_BOUND_THREADS} -lt ${CPU_BOUND_THREADS} ]; then
- export BUILD_THREADS=${MEM_BOUND_THREADS}
+ export PARLLEL_LEVEL=${MEM_BOUND_THREADS}
else
- export BUILD_THREADS=${CPU_BOUND_THREADS}
+ export PARLLEL_LEVEL=${CPU_BOUND_THREADS}
fi
echo "Logical CPU Count: ${LOGICAL_CPU_COUNT} [threads]"
@@ -31,5 +31,5 @@ echo "Physical CPU Count: ${PHYSICAL_CPU_COUNT} [cores]"
echo "Total Mem: ${TOTAL_MEM_KB} [kb]"
echo "CPU Bound Jobs: ${CPU_BOUND_THREADS}"
echo "Mem Bound Jobs: ${MEM_BOUND_THREADS}"
-echo "Build Threads: ${BUILD_THREADS} [threads]"
+echo "Parallel Level: ${PARLLEL_LEVEL} [threads]"

MODIFY
ci/cpu/build.bash
ci/cpu/build.bash
@@ -14,6 +14,7 @@ SCRIPT_PATH=$(cd $(dirname ${0}); pwd -P)
REPOSITORY_PATH=$(realpath ${SCRIPT_PATH}/../..)
export BUILD_KIND=cpu
+export PARALLEL_LEVEL=4
source ${REPOSITORY_PATH}/ci/common/build.bash

MODIFY
ci/gpu/build.bash
ci/gpu/build.bash
@@ -14,6 +14,7 @@ SCRIPT_PATH=$(cd $(dirname ${0}); pwd -P)
REPOSITORY_PATH=$(realpath ${SCRIPT_PATH}/../..)
export BUILD_KIND=gpu
+export PARALLEL_LEVEL=4
source ${REPOSITORY_PATH}/ci/common/build.bash

MODIFY
ci/local/build.bash
ci/local/build.bash
@@ -137,7 +137,7 @@ COMMAND="sudo ldconfig; sudo ldconfig"
if [ "${SHELL_ONLY}" != 0 ]; then
COMMAND="${COMMAND}; bash"
else
- COMMAND="${COMMAND}; ${REPOSITORY_PATH_IN_CONTAINER}/ci/gpu/build.bash ${TARGETS} || bash"
+ COMMAND="${COMMAND}; ${REPOSITORY_PATH_IN_CONTAINER}/ci/common/build.bash ${TARGETS} || bash"
fi
################################################################################
@@ -168,7 +168,9 @@ if [ "${NVIDIA_DOCKER_INSTALLED}" == 0 ]; then
exit -4
fi
-#docker pull "${IMAGE}"
+source ../ci/common/determine_build_parallelism.bash
+
+docker pull "${IMAGE}"
docker run --rm -it ${GPU_OPTS} \
--cap-add=SYS_PTRACE \
@@ -178,6 +180,8 @@ docker run --rm -it ${GPU_OPTS} \
-v "${PASSWD_PATH}":/etc/passwd:ro \
-v "${GROUP_PATH}":/etc/group:ro \
-e "WORKSPACE=${REPOSITORY_PATH_IN_CONTAINER}" \
+ -e "BUILD_KIND=gpu"
+ -e "PARALLEL_LEVEL=${PARALLEL_LEVEL}" \
-w "${REPOSITORY_PATH_IN_CONTAINER}" \
"${IMAGE}" bash -c "${COMMAND}"

Docker: Hardcode the parallelism level for gpuCI jobs, but keep using
`determine_build_parallelism.bash` for local builds.