Skip to content

Commit

Permalink
CI: Python w/ MPI (#182)
Browse files Browse the repository at this point in the history
* CI: Python w/ MPI

Test Python with MPI as well.

* Fix: mpi4py requirement for `--target pip_install`
  • Loading branch information
ax3l authored Jul 27, 2022
1 parent 448e675 commit ee3637c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ concurrency:

jobs:
build_gcc:
name: GCC w/ MPI
name: GCC w/ MPI w/ Python
runs-on: ubuntu-20.04
if: github.event.pull_request.draft == false
env:
Expand Down Expand Up @@ -39,8 +39,10 @@ jobs:
run: |
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_VERBOSE_MAKEFILE=ON
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DImpactX_PYTHON=ON
cmake --build build -j 2
cmake --build build --target pip_install
- name: run ImpactX
run: |
Expand Down
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,13 @@ if(ImpactX_PYTHON)
)

# this will also upgrade/downgrade dependencies, e.g., when the version of numpy changes
if(ImpactX_MPI)
set(pyImpactX_REQUIREMENT_FILE "requirements_mpi.txt")
else()
set(pyImpactX_REQUIREMENT_FILE "requirements.txt")
endif()
add_custom_target(${ImpactX_CUSTOM_TARGET_PREFIX}pip_install_requirements
${Python_EXECUTABLE} -m pip install ${PYINSTALLOPTIONS} -r "${ImpactX_SOURCE_DIR}/requirements.txt"
${Python_EXECUTABLE} -m pip install ${PYINSTALLOPTIONS} -r "${ImpactX_SOURCE_DIR}/${pyImpactX_REQUIREMENT_FILE}"
WORKING_DIRECTORY
${ImpactX_BINARY_DIR}
)
Expand Down
2 changes: 2 additions & 0 deletions requirements_mpi.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-r requirements.txt
mpi4py>=2.1.0

0 comments on commit ee3637c

Please sign in to comment.