github-action: add a MPI4PY sanity check #2
Workflow file for this run
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: GitHub Action CI | ||
on: [pull_request] | ||
env: | ||
MPI4PY_VERSION: 3.1.5 | ||
jobs: | ||
mpi4py: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install dependencies | ||
run: | | ||
sudo apt update | ||
sudo apt install -y --no-install-recommends wget lsb-core software-properties-common curl python3-pip | ||
pip3 install cython | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Build Open MPI | ||
run: | | ||
./autogen.pl | ||
./configure --prefix=${GITHUB_WORKSPACE}/install --disable-oshmem --disable-mpi-fortran | ||
make -j install | ||
- name: Checkout mpi4py | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: "mpi4py/mpi4py" | ||
path: mpi4py.git | ||
- name: Build MPI4py | ||
run: | | ||
echo "PYTHONPATH=${GITHUB_WORKSPACE}/mpi4py/" >> ${GITHUB_ENV} | ||
export PATH=${GITHUB_WORKSPACE}/install/bin:$PATH | ||
cd mpi4py | ||
python3 setup.py build --mpicc="mpicc -shared" | ||
python3 setup.py install --user | ||
- name: Run MPI4py | ||
run: | | ||
export PATH=${GITHUB_WORKSPACE}/install/bin:$PATH | ||
cd mpi4py/test | ||
mpirun --map-by :OVERSUBSCRIBE -np 3 python3 ./main.py -v -f |