Update ompi_mpi4py_tests.yaml #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: mpi4py | |
on: [ pull_request ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- name: Configure hostname | |
run: echo 127.0.0.1 `hostname` | sudo tee -a /etc/hosts > /dev/null | |
if: ${{ runner.os == 'Linux' || runner.os == 'macOS' }} | |
- name: Install depencencies | |
run: sudo apt-get install -y -q | |
libnuma-dev | |
if: ${{ runner.os == 'Linux' }} | |
- name: Checkout Open MPI | |
uses: actions/checkout@v4 | |
with: | |
path: mpi-build | |
submodules: recursive | |
- name: Bootstrap Open MPI | |
run: ./autogen.pl | |
working-directory: mpi-build | |
# Install into a separate directory (/opt/openmpi) so that we can | |
# bundle up that tree into an artifact to share with other jobs in | |
# this github action. Specifically don't use /usr/local, because | |
# there's a bunch of other stuff already installed in /usr/local, | |
# and we don't need to include that in our artifact. | |
- name: Configure Open MPI | |
run: ./configure | |
--disable-dependency-tracking | |
--enable-debug | |
--enable-mem-debug | |
--disable-sphinx | |
--disable-mpi-fortran | |
--disable-oshmem | |
--prefix=/opt/openmpi | |
LDFLAGS=-Wl,-rpath,/opt/openmpi/lib | |
working-directory: mpi-build | |
- name: Build MPI | |
run: make -j $(nproc) | |
working-directory: mpi-build | |
- name: Install MPI | |
run: sudo make install | |
working-directory: mpi-build | |
- name: Add Open MPI to PATH | |
run: echo /opt/openmpi/bin >> $GITHUB_PATH | |
- name: Tweak MPI | |
run: | | |
# Tweak MPI | |
mca_params="$HOME/.openmpi/mca-params.conf" | |
mkdir -p "$(dirname "$mca_params")" | |
echo mpi_param_check = true >> "$mca_params" | |
echo mpi_show_handle_leaks = true >> "$mca_params" | |
echo rmaps_base_oversubscribe = true >> "$mca_params" | |
mca_params="$HOME/.prte/mca-params.conf" | |
mkdir -p "$(dirname "$mca_params")" | |
echo rmaps_default_mapping_policy = :oversubscribe >> "$mca_params" | |
- name: Show MPI | |
run: ompi_info | |
- name: Show MPICC | |
run: mpicc -show | |
- name: Use Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3 | |
architecture: x64 | |
- name: Install Python packages (build) | |
run: python -m pip install --upgrade | |
setuptools pip wheel | |
- name: Install Python packages (test) | |
run: python -m pip install --upgrade | |
numpy cffi pyyaml | |
- name: Checkout mpi4py | |
uses: actions/checkout@v4 | |
with: | |
repository: "mpi4py/mpi4py" | |
- name: Build mpi4py wheel | |
run: python -m pip wheel . | |
env: | |
CFLAGS: "-O0" | |
- name: Save the artifacts for other jobs | |
uses: actions/upload-artifact@v4 | |
with: | |
path: | | |
/opt/openmpi | |
~/.openmpi | |
~/.prte | |
test | |
demo | |
mpi4py-*.whl | |
retention-days: 2 | |
name: build-artifacts | |
#============================================== | |
run_defaults: | |
# This whole set of tests run with mpi4py's defaults. As of March | |
# 2024, this means disabling the spawn and dynamic tests. We want | |
# this job of tests to pass. | |
needs: [ build ] | |
uses: ./.github/workflows/ompi_mpi4py_tests.yaml | |
with: | |
# This parameter is required, so send a meaningless | |
# environment variable name that will not affect the tests at | |
# all (i.e., the tests will be run with default values). | |
env_name: MAKE_TODAY_AN_OMPI_DAY | |
#============================================== | |
run_spawn: | |
# This whole set of tests runs explicitly with setting "enable the | |
# spawn tests". As of March 2024, we know that Open MPI is | |
# failing these tests. | |
needs: [ build ] | |
# Only run if the label "mpi4py" is set on this PR. | |
if: ${{ contains(github.event.pull_request.labels.*.name, 'mpi4py-all') }} | |
uses: ./.github/workflows/ompi_mpi4py_tests.yaml | |
with: | |
# Enable the spawn tests | |
env_name: MPI4PY_TEST_SPAWN |