Skip to content

Commit

Permalink
Merge pull request #12526 from dalcinl/test/ompi-relocate
Browse files Browse the repository at this point in the history
mpi4py: Run mpi4py tests with a relocated Open MPI installation
  • Loading branch information
wenduwan authored May 31, 2024
2 parents 88302d9 + bead2b3 commit 55a2ac8
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 9 deletions.
23 changes: 16 additions & 7 deletions .github/workflows/ompi_mpi4py.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
name: mpi4py

on: [ pull_request ]
on:
pull_request:
workflow_dispatch:
inputs:
repository:
description: 'mpi4py repository'
default: 'mpi4py/mpi4py'
required: false
type: string
ref:
description: 'mpi4py branch/tag/SHA'
default: 'master'
required: false
type: string

jobs:
build:
Expand Down Expand Up @@ -89,7 +102,8 @@ jobs:
- name: Checkout mpi4py
uses: actions/checkout@v4
with:
repository: "mpi4py/mpi4py"
repository: ${{ inputs.repository || 'mpi4py/mpi4py' }}
ref: ${{ inputs.ref }}

- name: Build mpi4py wheel
run: python -m pip wheel .
Expand Down Expand Up @@ -117,11 +131,6 @@ jobs:
# 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

#==============================================

Expand Down
26 changes: 24 additions & 2 deletions .github/workflows/ompi_mpi4py_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@ on:
workflow_call:
inputs:
env_name:
required: true
default: 'MAKE_TODAY_AN_OMPI_DAY'
required: false
type: string

jobs:
mpi4py-tests:
runs-on: ubuntu-latest
timeout-minutes: 30
env:
${{ inputs.env_name}}: 1
${{ inputs.env_name }}: true
steps:
- name: Use Python
uses: actions/setup-python@v5
Expand Down Expand Up @@ -67,3 +68,24 @@ jobs:
run: python demo/test-run/test_run.py -v
if: ${{ true }}
timeout-minutes: 10

#----------------------------------------------

- name: Relocate Open MPI installation
run: mv /opt/openmpi /opt/ompi
- name: Update PATH and set OPAL_PREFIX and LD_LIBRARY_PATH
run: |
sed -i '\|/opt/openmpi/bin|d' $GITHUB_PATH
echo OPAL_PREFIX=/opt/ompi >> $GITHUB_ENV
echo LD_LIBRARY_PATH=/opt/ompi/lib >> $GITHUB_ENV
- name: Test mpi4py (singleton)
run: python test/main.py -v
if: ${{ true }}
timeout-minutes: 10
- name: Test mpi4py (np=5)
run: /opt/ompi/bin/mpiexec -n 5 python test/main.py -v -f
if: ${{ true }}
timeout-minutes: 10

#----------------------------------------------

0 comments on commit 55a2ac8

Please sign in to comment.