Skip to content

Build with OpenMPI on Mac#1010

Merged
scott-routledge2 merged 25 commits intomainfrom
scott/openmpi_mac
Jan 28, 2026
Merged

Build with OpenMPI on Mac#1010
scott-routledge2 merged 25 commits intomainfrom
scott/openmpi_mac

Conversation

@scott-routledge2
Copy link
Contributor

@scott-routledge2 scott-routledge2 commented Jan 23, 2026

Changes included in this PR

Use OpenMPI for Mac builds to improve initialization times.

  • Upgrade mpi4py dependency and remove vendored mpi4py for pip
  • Use MPI_Scatterv/MPI_Gatherv for OpenMPI builds (large count APIs aren't supported yet)

Testing strategy

Nightly tests (Run on Linux + openmpi)
https://dev.azure.com/bodo-inc/Bodo/_build/results?buildId=26270&view=results

Release CI

Benchmarking was done on my M2 macbook using the default pixi environment and a simple test program, TPCH SF10, and Taxi (40 million rows)

Results:

Test MPICH 4.3.2 OpenMPI
test.py 5.3s 2.5s
TPCH SF10 (Total) 196.8s 125.5s
Taxi 10.9s 6.86s
# test.py
import bodo
import bodo.pandas
import time

bodo.set_verbose_level(2)

t0 = time.time()

df = bodo.pandas.DataFrame({'col1': [1, 2, 3], 'col2': [4, 5, 6]})
print("DataFrame created:", df)

print("Total time:", time.time() - t0)

User facing changes

Checklist

  • Pipelines passed before requesting review. To run CI you must include [run CI] in your commit message.
  • I am familiar with the Contributing Guide
  • I have installed + ran pre-commit hooks.

@codecov
Copy link

codecov bot commented Jan 23, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 68.73%. Comparing base (c33fbb5) to head (97a3504).
⚠️ Report is 191 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1010      +/-   ##
==========================================
+ Coverage   66.68%   68.73%   +2.04%     
==========================================
  Files         186      195       +9     
  Lines       66795    67834    +1039     
  Branches     9507     9668     +161     
==========================================
+ Hits        44543    46623    +2080     
+ Misses      19572    18357    -1215     
- Partials     2680     2854     +174     

@scott-routledge2 scott-routledge2 marked this pull request as ready for review January 27, 2026 16:06
- fsspec >=2021.09
- pyarrow =22.0
- numba >=0.62,<0.64
- mpich # [not win]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mpich should be added to run dependencies automatically (same with impi-devel & openmpi)

python -u examples/Misc/misc_pi.py
if [[ "$(uname)" == "Darwin" ]]; then
# OpenMPI requires mpiexec on macOS CI.
mpiexec -n 1 python -u examples/Misc/misc_pi.py
Copy link
Contributor Author

@scott-routledge2 scott-routledge2 Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Singleton init (i.e. calling spawn from outside of mpiexec) doesn't seem to be working on github CI runners (maybe a misconfiguration or openmpi bug), it's otherwise been working on the other machines tested so far.

@scott-routledge2
Copy link
Contributor Author

scott-routledge2 commented Jan 27, 2026

Just noticed another issue which is when running test.py with the openmpi environment, the get_num_workers function does not behave as expected.

When the program is run outside of mpiexec, MPI.COMM_WORLD.Get_attr(MPI.UNIVERSE_SIZE) is set to 1, so the test.py only spawns 1 worker. When I run with mpiexec, it gets the correct size (10), but I get an error from mpiexec:

>> mpiexec -n 1 python test.py
--------------------------------------------------------------------------
There are not enough slots available in the system to satisfy the 10
slots that were requested by the application:

  env

Either request fewer procs for your application, or make more slots
available for use.

Not sure if this is expected behavior for openmpi or could be the reason CI was behaving strangely.

Would it make sense to ignore the value of MPI.COMM_WORLD.Get_attr(MPI.UNIVERSE_SIZE) (isn't relevant for local macs I think) ?

Copy link
Contributor

@IsaacWarren IsaacWarren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Scott!

Copy link
Collaborator

@ehsantn ehsantn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @scott-routledge2! Looks good to me.

@scott-routledge2 scott-routledge2 merged commit 3ea78ea into main Jan 28, 2026
52 of 53 checks passed
@scott-routledge2 scott-routledge2 deleted the scott/openmpi_mac branch January 28, 2026 18:21
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

Successfully merging this pull request may close these issues.

3 participants