Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COMM_WORLD.Get_size() returns 1 reguardless of num threads launched on Github Runner #13

Closed
jpmorgan98 opened this issue Jan 8, 2025 · 1 comment

Comments

@jpmorgan98
Copy link

mpi4py in a Github runner seems to have stopped being able to allocate multiple threads. We have tests that need exactly 4 threads to pass and mpi4py from setup-mpi seems to have stopped allocating anything other then 1, even tho it will still execute a given script n times. For an example I am attaching a runner script, a sample mpi4py test, the incorrect, and the expected outputs.

For some more background see our issue tracking this problem

Thanks in advance!

mpi_error.yml

name: MPI CI Error

on: [push, pull_request]

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
        fail-fast: false
        matrix:
            os: ["ubuntu-latest"]
    steps:
    - uses: actions/checkout@v3
    - name: Set up python 3.11
      uses: actions/setup-python@v3
      with:
        python-version: "3.11"
    - name: debug
      run: |
        pwd
        ls
    - uses: mpi4py/setup-mpi@v1
    - name: Install dependencies
      run: |
        pip install mpi4py
    - name: Run MPI
      run : |
        lscpu
        mpiexec -n 4 python -m mpi4py.bench helloworld
        mpiexec -n 4 python test_mpi.py

test_mpi.py

from mpi4py import MPI
print(MPI.COMM_WORLD.Get_size())

output when github runner CI is used

Hello, World! I am process 0 of 1 on fv-az1308-741.
Hello, World! I am process 0 of 1 on fv-az1308-741.
Hello, World! I am process 0 of 1 on fv-az1308-741.
Hello, World! I am process 0 of 1 on fv-az1308-741.

1
1
1
1

The expected output (commands run on a local machine configured with mpi4py)

Hello, World! I am process 0 of 4 on 
Hello, World! I am process 1 of 4 on 
Hello, World! I am process 2 of 4 on 
Hello, World! I am process 3 of 4 on 

4
4
4
4
@dalcinl
Copy link
Member

dalcinl commented Jan 11, 2025

There is nothing I can do about it. The root issue is the broken MPICH package in Ubuntu 24.04, six month after and the issue is still unresolved. IIRC, the required fix is available in 24.10, but it has not been backported to the 24.04 LTS release. This issue effectively renders MPICH unusable on Ubuntu 22.04.
cf. https://bugs.launchpad.net/ubuntu/+source/mpich/+bug/2072338

The only thing you can do for the time being is replacing ubuntu-latest -> ubuntu-22.04 in your workflow file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants