Skip to content

Commit

Permalink
Simplify conda weekly test (#3467)
Browse files Browse the repository at this point in the history
* Need to deal with mpich on macOS and Linux.

* Fix.

* Temporarily enable on push.

* Fix.

* Try bash.

* Put conda on path.

* Fix.

* Try an action.

* Simplify workflow.

* Fix.

* Try this.

* Fix.

* Fix.

* Single quotes?

* Set special shell.

* Switch to mpiexec (standard compliant)

* Just mpi4py

* More info

* Disable windows-2022 to get merged.

* Re-enable tests.
  • Loading branch information
jhale authored Oct 11, 2024
1 parent 04b32ff commit ef503b1
Showing 1 changed file with 29 additions and 46 deletions.
75 changes: 29 additions & 46 deletions .github/workflows/conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Conda install

on:
# Uncomment the below 'push' to trigger on push
# push:
# branches:
#push:
# branches:
# - "**"
schedule:
# '*' is a special character in YAML, so string must be quoted
Expand All @@ -15,52 +15,35 @@ jobs:
name: Install and test
strategy:
matrix:
# NOTE: Re-enable windows-2022 after iimpi libfabric.dll issue fixed.
os: [ubuntu-latest, macos-13, macos-14]
python-version: ["3.9", "3.10", "3.11", "3.12"]
runs-on: ${{ matrix.os }}
timeout-minutes: 30
# This is necessary to ensure conda environment is activated in every step.
defaults:
run:
shell: bash -el {0}

steps:
- name: Install conda (macOS)
if: runner.os == 'macOS'
run: |
brew install anaconda
echo "/opt/homebrew/anaconda3/bin:/usr/local/anaconda3/bin" >> $GITHUB_PATH
- name: Update conda
run: |
conda update conda
- name: Install DOLFINx (py3-10)
run: |
conda create -n env3-10 -c conda-forge python=3.10 fenics-dolfinx mpich
conda env export -n env3-10
- name: Test (py3-10)
run: |
conda run -n env3-10 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))"
conda run -n env3-10 mpirun -np 2 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))"
- name: Install DOLFINx (py3-11)
run: |
conda create -n env3-11 -c conda-forge python=3.11 fenics-dolfinx mpich
conda env export -n env3-11
- name: Test (py3-11)
run: |
conda run -n env3-11 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))"
conda run -n env3-11 mpirun -np 2 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))"
- name: Install DOLFINx (py3-12)
run: |
conda create -n env3-12 -c conda-forge python=3.12 fenics-dolfinx mpich
conda env export -n env3-12
- name: Test (py3-12)
run: |
conda run -n env3-12 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))"
conda run -n env3-12 mpirun -np 2 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))"
- name: Install DOLFINx (py3-12, petsc-complex)
run: |
conda create -n env3-12-complex -c conda-forge python=3.12 fenics-dolfinx petsc=*=complex* mpich
conda env export -n env3-12-complex
- name: Test (py3-12-complex)
run: |
conda run -n env3-12-complex python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))"
conda run -n env3-12-complex mpirun -np 2 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))"
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}

- name: Install DOLFINx with MPICH (Unix-like)
if: ${{ runner.os == 'macOS' || runner.os == 'Linux' }}
run: |
conda install -c conda-forge fenics-dolfinx mpich
- name: Install DOLFINx (Windows)
if: ${{ runner.os == 'Windows' }}
run: |
conda install -c conda-forge fenics-dolfinx
- name: Test
run: |
conda info
conda list
mpiexec --version
mpiexec -v -np 1 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))"
mpiexec -v -np 2 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))"

0 comments on commit ef503b1

Please sign in to comment.