diff --git a/.github/workflows/unittest-flux-mpich.yml b/.github/workflows/unittest-flux-mpich.yml new file mode 100644 index 00000000..88611b79 --- /dev/null +++ b/.github/workflows/unittest-flux-mpich.yml @@ -0,0 +1,40 @@ +name: Unittests-flux-mpich + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Extend environment + shell: bash -l {0} + timeout-minutes: 5 + run: | + echo -e '- coverage\n- flux-core =0.59.0\n- versioneer =0.28'>> .ci_support/environment-mpich.yml + cat .ci_support/environment-mpich.yml + - uses: conda-incubator/setup-miniconda@v2.2.0 + with: + python-version: '3.12' + mamba-version: "*" + channels: conda-forge + miniforge-variant: Mambaforge + channel-priority: strict + auto-update-conda: true + environment-file: .ci_support/environment-mpich.yml + - name: Test + shell: bash -l {0} + timeout-minutes: 5 + run: | + pip install . --no-deps --no-build-isolation + python -m unittest discover tests + - name: Test Flux + shell: bash -l {0} + timeout-minutes: 5 + run: > + flux start + python -m unittest tests/test_flux_executor.py tests/test_executor_backend_flux.py; \ No newline at end of file diff --git a/.github/workflows/unittest-flux-openmpi.yml b/.github/workflows/unittest-flux-openmpi.yml new file mode 100644 index 00000000..80a70328 --- /dev/null +++ b/.github/workflows/unittest-flux-openmpi.yml @@ -0,0 +1,45 @@ +name: Unittests-flux-openmpi + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Extend environment + shell: bash -l {0} + timeout-minutes: 5 + run: | + echo -e '- coverage\n- flux-core =0.59.0\n- flux-pmix=0.5.0\n- versioneer =0.28' >> .ci_support/environment-openmpi.yml + cat .ci_support/environment-openmpi.yml + - uses: conda-incubator/setup-miniconda@v2.2.0 + with: + python-version: '3.12' + mamba-version: "*" + channels: conda-forge + miniforge-variant: Mambaforge + channel-priority: strict + auto-update-conda: true + environment-file: .ci_support/environment-openmpi.yml + - name: Test + shell: bash -l {0} + timeout-minutes: 5 + run: | + pip install . --no-deps --no-build-isolation + coverage run -a --omit="pympipool/_version.py,tests/*" -m unittest discover tests + - name: Test Flux with OpenMPI + shell: bash -l {0} + timeout-minutes: 5 + run: > + flux start + coverage run -a --omit="pympipool/_version.py,tests/*" -m unittest tests/test_flux_executor.py tests/test_executor_backend_flux.py; + coverage xml + env: + PYMPIPOOL_PMIX: "pmix" + - name: Coveralls + uses: coverallsapp/github-action@v2 diff --git a/.github/workflows/unittest-flux.yml b/.github/workflows/unittest-flux.yml deleted file mode 100644 index d4f048cf..00000000 --- a/.github/workflows/unittest-flux.yml +++ /dev/null @@ -1,71 +0,0 @@ -# This workflow is used to run the unittest of pyiron - -name: Unittests-flux - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - build: - - runs-on: ${{ matrix.operating-system }} - strategy: - matrix: - include: - - operating-system: ubuntu-latest - python-version: '3.12' - label: linux-64-py-3-12-openmpi - prefix: /Users/runner/miniconda3/envs/my-env - environment-file: .ci_support/environment-openmpi.yml - - - operating-system: ubuntu-latest - python-version: '3.12' - label: linux-64-py-3-12-mpich - prefix: /usr/share/miniconda3/envs/my-env - environment-file: .ci_support/environment-mpich.yml - - steps: - - uses: actions/checkout@v2 - - name: Extend environment openmpi - shell: bash -l {0} - timeout-minutes: 5 - if: matrix.label == 'linux-64-py-3-12-openmpi' - run: | - echo -e '- coverage\n- flux-core =0.59.0\n- flux-pmix=0.5.0' >> ${{ matrix.environment-file }} - cat ${{ matrix.environment-file }} - - name: Extend environment mpich - shell: bash -l {0} - timeout-minutes: 5 - if: matrix.label == 'linux-64-py-3-12-mpich' - run: | - echo -e '- coverage\n- flux-core =0.59.0' >> ${{ matrix.environment-file }} - cat ${{ matrix.environment-file }} - - uses: conda-incubator/setup-miniconda@v2.2.0 - with: - python-version: ${{ matrix.python-version }} - mamba-version: "*" - channels: conda-forge - miniforge-variant: Mambaforge - channel-priority: strict - auto-update-conda: true - environment-file: ${{ matrix.environment-file }} - - name: Test - shell: bash -l {0} - timeout-minutes: 5 - run: | - pip install versioneer[toml]==0.29 - pip install . --no-deps --no-build-isolation - coverage run -a --omit="pympipool/_version.py,tests/*" -m unittest discover tests - - name: Test Flux - shell: bash -l {0} - timeout-minutes: 5 - run: > - flux start - coverage run -a --omit="pympipool/_version.py,tests/*" -m unittest tests/test_flux_executor.py tests/test_executor_backend_flux.py; - coverage xml - - name: Coveralls - if: matrix.label == 'linux-64-py-3-12-openmpi' - uses: coverallsapp/github-action@v2 diff --git a/tests/test_executor_backend_flux.py b/tests/test_executor_backend_flux.py index e07064cc..1eb599ee 100644 --- a/tests/test_executor_backend_flux.py +++ b/tests/test_executor_backend_flux.py @@ -14,6 +14,7 @@ ) skip_flux_test = "FLUX_URI" not in os.environ + pmi = os.environ.get("PYMPIPOOL_PMIX", None) except ImportError: skip_flux_test = True @@ -81,6 +82,7 @@ def test_flux_executor_parallel(self): executor=self.executor, backend="flux", block_allocation=True, + pmi=pmi, ) as exe: fs_1 = exe.submit(mpi_funct, 1) self.assertEqual(fs_1.result(), [(1, 2, 0), (1, 2, 1)]) @@ -93,6 +95,7 @@ def test_single_task(self): executor=self.executor, backend="flux", block_allocation=True, + pmi=pmi, ) as p: output = p.map(mpi_funct, [1, 2, 3]) self.assertEqual( diff --git a/tests/test_flux_executor.py b/tests/test_flux_executor.py index 2861ebdc..14f6413d 100644 --- a/tests/test_flux_executor.py +++ b/tests/test_flux_executor.py @@ -16,6 +16,7 @@ ) skip_flux_test = "FLUX_URI" not in os.environ + pmi = os.environ.get("PYMPIPOOL_PMIX", None) except ImportError: skip_flux_test = True @@ -69,7 +70,7 @@ def test_flux_executor_threads(self): def test_flux_executor_parallel(self): with PyFluxExecutor( - max_workers=1, cores_per_worker=2, executor=self.executor + max_workers=1, cores_per_worker=2, executor=self.executor, pmi=pmi ) as exe: fs_1 = exe.submit(mpi_funct, 1) self.assertEqual(fs_1.result(), [(1, 2, 0), (1, 2, 1)]) @@ -77,7 +78,7 @@ def test_flux_executor_parallel(self): def test_single_task(self): with PyFluxExecutor( - max_workers=1, cores_per_worker=2, executor=self.executor + max_workers=1, cores_per_worker=2, executor=self.executor, pmi=pmi ) as p: output = p.map(mpi_funct, [1, 2, 3]) self.assertEqual(