diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh index 7fbce051..99baf86d 100755 --- a/.scripts/build_steps.sh +++ b/.scripts/build_steps.sh @@ -10,9 +10,10 @@ export FEEDSTOCK_ROOT="${FEEDSTOCK_ROOT:-/home/conda/feedstock_root}" source ${FEEDSTOCK_ROOT}/.scripts/logging_utils.sh -endgroup "Start Docker" +( endgroup "Start Docker" ) 2> /dev/null + +( startgroup "Configuring conda" ) 2> /dev/null -startgroup "Configuring conda" export PYTHONUNBUFFERED=1 export RECIPE_ROOT="${RECIPE_ROOT:-/home/conda/recipe_root}" export CI_SUPPORT="${FEEDSTOCK_ROOT}/.ci_support" @@ -40,34 +41,38 @@ if [[ "${HOST_PLATFORM}" != "${BUILD_PLATFORM}" ]] && [[ "${BUILD_WITH_CONDA_DEB EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --no-test" fi -endgroup "Configuring conda" + +( endgroup "Configuring conda" ) 2> /dev/null if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then - startgroup "Running conda debug" if [[ "x${BUILD_OUTPUT_ID:-}" != "x" ]]; then EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --output-id ${BUILD_OUTPUT_ID}" fi conda debug "${RECIPE_ROOT}" -m "${CI_SUPPORT}/${CONFIG}.yaml" \ ${EXTRA_CB_OPTIONS:-} \ --clobber-file "${CI_SUPPORT}/clobber_${CONFIG}.yaml" - endgroup "Running conda debug" + # Drop into an interactive shell /bin/bash else - startgroup "Running conda $BUILD_CMD" conda $BUILD_CMD "${RECIPE_ROOT}" -m "${CI_SUPPORT}/${CONFIG}.yaml" \ --suppress-variables ${EXTRA_CB_OPTIONS:-} \ --clobber-file "${CI_SUPPORT}/clobber_${CONFIG}.yaml" - endgroup "Running conda build" - startgroup "Validating outputs" + ( startgroup "Validating outputs" ) 2> /dev/null + validate_recipe_outputs "${FEEDSTOCK_NAME}" - endgroup "Validating outputs" + + ( endgroup "Validating outputs" ) 2> /dev/null + + ( startgroup "Uploading packages" ) 2> /dev/null if [[ "${UPLOAD_PACKAGES}" != "False" ]]; then - startgroup "Uploading packages" upload_package --validate --feedstock-name="${FEEDSTOCK_NAME}" "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" - endgroup "Uploading packages" fi + + ( endgroup "Uploading packages" ) 2> /dev/null fi +( startgroup "Final checks" ) 2> /dev/null + touch "${FEEDSTOCK_ROOT}/build_artifacts/conda-forge-build-done-${CONFIG}" \ No newline at end of file diff --git a/.scripts/logging_utils.sh b/.scripts/logging_utils.sh index a53ef3f2..57bc95c2 100644 --- a/.scripts/logging_utils.sh +++ b/.scripts/logging_utils.sh @@ -13,18 +13,23 @@ function startgroup { travis ) echo "$1" echo -en 'travis_fold:start:'"${1// /}"'\\r';; + github_actions ) + echo "::group::$1";; * ) echo "$1";; esac -} +} 2> /dev/null function endgroup { # End a foldable group of log lines # Pass a single argument, quoted + case ${CI:-} in azure ) echo "##[endgroup]";; travis ) echo -en 'travis_fold:end:'"${1// /}"'\\r';; + github_actions ) + echo "::endgroup::";; esac -} +} 2> /dev/null diff --git a/.scripts/run_docker_build.sh b/.scripts/run_docker_build.sh index 16d6c15a..44ad3ce0 100755 --- a/.scripts/run_docker_build.sh +++ b/.scripts/run_docker_build.sh @@ -7,7 +7,7 @@ source .scripts/logging_utils.sh -startgroup "Configure Docker" +( startgroup "Configure Docker" ) 2> /dev/null set -xeo pipefail @@ -69,9 +69,11 @@ DOCKER_RUN_ARGS="${CONDA_FORGE_DOCKER_RUN_ARGS}" if [ -z "${CI}" ]; then DOCKER_RUN_ARGS="-it ${DOCKER_RUN_ARGS}" fi -endgroup "Configure Docker" -startgroup "Start Docker" +( endgroup "Configure Docker" ) 2> /dev/null + +( startgroup "Start Docker" ) 2> /dev/null + export UPLOAD_PACKAGES="${UPLOAD_PACKAGES:-True}" docker run ${DOCKER_RUN_ARGS} \ -v "${RECIPE_ROOT}":/home/conda/recipe_root:rw,z,delegated \ @@ -94,4 +96,7 @@ docker run ${DOCKER_RUN_ARGS} \ /home/conda/feedstock_root/${PROVIDER_DIR}/build_steps.sh # verify that the end of the script was reached -test -f "$DONE_CANARY" \ No newline at end of file +test -f "$DONE_CANARY" + +# This closes the last group opened in `build_steps.sh` +( endgroup "Final checks" ) 2> /dev/null \ No newline at end of file diff --git a/.scripts/run_osx_build.sh b/.scripts/run_osx_build.sh index 7688497f..cbcce724 100755 --- a/.scripts/run_osx_build.sh +++ b/.scripts/run_osx_build.sh @@ -2,16 +2,19 @@ source .scripts/logging_utils.sh -set -x +set -xe + +( startgroup "Installing a fresh version of Miniforge" ) 2> /dev/null -startgroup "Installing a fresh version of Miniforge" MINIFORGE_URL="https://github.com/conda-forge/miniforge/releases/latest/download" MINIFORGE_FILE="Miniforge3-MacOSX-x86_64.sh" curl -L -O "${MINIFORGE_URL}/${MINIFORGE_FILE}" bash $MINIFORGE_FILE -b -endgroup "Installing a fresh version of Miniforge" -startgroup "Configuring conda" +( endgroup "Installing a fresh version of Miniforge" ) 2> /dev/null + +( startgroup "Configuring conda" ) 2> /dev/null + BUILD_CMD=build source ${HOME}/miniforge3/etc/profile.d/conda.sh @@ -34,11 +37,10 @@ echo -e "\n\nRunning the build setup script." source run_conda_forge_build_setup -endgroup "Configuring conda" -set -e +( endgroup "Configuring conda" ) 2> /dev/null + -startgroup "Running conda $BUILD_CMD" echo -e "\n\nMaking the build clobber file" make_build_number ./ ./recipe ./.ci_support/${CONFIG}.yaml @@ -47,13 +49,16 @@ if [[ "${HOST_PLATFORM}" != "${BUILD_PLATFORM}" ]]; then fi conda $BUILD_CMD ./recipe -m ./.ci_support/${CONFIG}.yaml --suppress-variables --clobber-file ./.ci_support/clobber_${CONFIG}.yaml ${EXTRA_CB_OPTIONS:-} -endgroup "Running conda build" -startgroup "Validating outputs" +( startgroup "Validating outputs" ) 2> /dev/null + validate_recipe_outputs "${FEEDSTOCK_NAME}" -endgroup "Validating outputs" + +( endgroup "Validating outputs" ) 2> /dev/null + +( startgroup "Uploading packages" ) 2> /dev/null if [[ "${UPLOAD_PACKAGES}" != "False" ]]; then - startgroup "Uploading packages" upload_package --validate --feedstock-name="${FEEDSTOCK_NAME}" ./ ./recipe ./.ci_support/${CONFIG}.yaml - endgroup "Uploading packages" -fi \ No newline at end of file +fi + +( endgroup "Uploading packages" ) 2> /dev/null \ No newline at end of file diff --git a/README.md b/README.md index 132a5fba..636a4e44 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,7 @@ Installing `openmpi-mpi` from the `conda-forge` channel can be achieved by addin ``` conda config --add channels conda-forge +conda config --set channel_priority strict ``` Once the `conda-forge` channel has been enabled, `openmpi, openmpi-mpicc, openmpi-mpicxx, openmpi-mpifort` can be installed with: diff --git a/recipe/build-mpi.sh b/recipe/build-mpi.sh index ed3472bf..11395a64 100755 --- a/recipe/build-mpi.sh +++ b/recipe/build-mpi.sh @@ -21,8 +21,8 @@ if [[ "$target_platform" == osx-* ]]; then fi fi -if [ $cuda_compiler_version == '10.2' ]; then - build_with_cuda="--with-cuda" +if [[ $cuda_compiler_version == 10.2 ]]; then + build_with_cuda="--with-cuda --with-ucx=$PREFIX" else build_with_cuda="" fi @@ -159,6 +159,11 @@ if [ ! -z "$build_with_cuda" ]; then echo "opal_warn_on_missing_libcuda = 0" >> $PREFIX/etc/openmpi-mca-params.conf echo "setting the mca opal_cuda_support to 0..." echo "opal_cuda_support = 0" >> $PREFIX/etc/openmpi-mca-params.conf + + echo "setting the mca pml to ^ucx..." + echo "pml = ^ucx" >> $PREFIX/etc/openmpi-mca-params.conf + echo "setting the mca osc to ^ucx..." + echo "osc = ^ucx" >> $PREFIX/etc/openmpi-mca-params.conf POST_LINK=$PREFIX/bin/.openmpi-post-link.sh cp $RECIPE_DIR/post-link.sh $POST_LINK diff --git a/recipe/meta.yaml b/recipe/meta.yaml index e6b1d787..5d9054c8 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -16,7 +16,7 @@ source: - ompi-8361.diff build: - number: 4 + number: 5 # remember to bump the CUDA version in build-mpi.sh too! skip: true # [win or (linux64 and cuda_compiler_version != '10.2') or ((aarch64 or ppc64le) and cuda_compiler_version not in (undefined, "None"))] @@ -27,7 +27,7 @@ outputs: run_exports: - {{ pin_subpackage('openmpi', min_pin='x.x.x', max_pin='x') }} ignore_run_exports_from: - - {{ compiler('cuda') }} + - {{ compiler('cuda') }} # [linux64] requirements: build: - {{ compiler('c') }} @@ -41,11 +41,14 @@ outputs: - perl 5.26.2 host: - zlib + - ucx 1.9.0 # [linux64] + - ucx-proc =*=gpu # [linux64] run: - zlib - mpi 1.0 openmpi run_constrained: - cudatoolkit >=9.2 # [linux64] + - ucx 1.9.0 # [linux64] test: script: run_test.sh files: diff --git a/recipe/post-link.sh b/recipe/post-link.sh index 32421dc8..8a45c74a 100644 --- a/recipe/post-link.sh +++ b/recipe/post-link.sh @@ -2,7 +2,16 @@ echo " " >> $PREFIX/.messages.txt echo "For Linux 64, Open MPI is built with CUDA awareness but this support is disabled by default." >> $PREFIX/.messages.txt -echo "To enable it, please set the environmental variable OMPI_MCA_opal_cuda_support=true before" >> $PREFIX/.messages.txt +echo "To enable it, please set the environment variable OMPI_MCA_opal_cuda_support=true before" >> $PREFIX/.messages.txt echo "launching your MPI processes. Equivalently, you can set the MCA parameter in the command line:" >> $PREFIX/.messages.txt echo "mpiexec --mca opal_cuda_support 1 ..." >> $PREFIX/.messages.txt echo " " >> $PREFIX/.messages.txt + +echo "In addition, the UCX support is also built but disabled by default." >> $PREFIX/.messages.txt +echo "To enable it, first install UCX (conda install -c conda-forge ucx). Then, set the environment" >> $PREFIX/.messages.txt +echo "variables OMPI_MCA_pml=\"ucx\" OMPI_MCA_osc=\"ucx\" before launching your MPI processes." >> $PREFIX/.messages.txt +echo "Equivalently, you can set the MCA parameters in the command line:" >> $PREFIX/.messages.txt +echo "mpiexec --mca pml ucx --mca osc ucx ..." >> $PREFIX/.messages.txt +echo "Note that you might also need to set UCX_MEMTYPE_CACHE=n for CUDA awareness via UCX." >> $PREFIX/.messages.txt +echo "Please consult UCX's documentation for detail." >> $PREFIX/.messages.txt +echo " " >> $PREFIX/.messages.txt