Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 41 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,44 @@ jobs:
docker run --rm local-test-image:latest bash -c "\
python3 -m pip install pytest scipy && \
cd /dolfinx/python/test && \
python3 -m pytest -vs"
python3 -m pytest -vs"


- name: Verify MPI ABI Swap (Stubs -> MPICH)
run: |
docker run --rm local-test-image:latest bash -c "\
cat << 'EOF' > test_comm.cpp
#include <iostream>
#include <mpi.h>
int main(int argc, char **argv) {
MPI_Init(&argc, &argv);
int rank, size;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &size);
std::cout << \"Hello from rank \" << rank << \" of \" << size << std::endl;
MPI_Finalize();
return 0;
}
EOF

echo '--- Compiling with Stubs ---' && \
mpicxx -std=c++17 test_comm.cpp -o test_comm && \

echo '--- Running with Stubs ---' && \
mpiexec -n 1 ./test_comm && \

echo '--- Downloading & Building MPICH with ABI support ---' && \
MPICH_VERSION=4.3.2 && \
wget -q https://www.mpich.org/static/downloads/\${MPICH_VERSION}/mpich-\${MPICH_VERSION}.tar.gz && \
tar xfz mpich-\${MPICH_VERSION}.tar.gz && \
cd mpich-\${MPICH_VERSION} && \
./configure --enable-mpi-abi --prefix=/opt/mpich --disable-fortran --disable-cxx --disable-romio && \
make -j4 install && \
cd .. && \

echo '--- Checking Dynamic Linking (ldd) ---' && \
export LD_LIBRARY_PATH=/opt/mpich/lib:\$LD_LIBRARY_PATH && \
ldd test_comm && \

echo '--- Running with real MPICH ---' && \
/opt/mpich/bin/mpiexec -n 1 ./test_comm"
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ add_library(mpistub SHARED ${MPI_STUB_SOURCES})

# Force the output name to "mpi" to generate libmpi.so
set_target_properties(mpistub PROPERTIES
OUTPUT_NAME "mpi"
VERSION "1.0.0"
SOVERSION "12"
OUTPUT_NAME "mpi_abi"
VERSION 0.0.0
SOVERSION 0
C_STANDARD 11
C_STANDARD_REQUIRED YES
WINDOWS_EXPORT_ALL_SYMBOLS 1
)

# Setup include directories
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ RUN python3 -m venv ${VIRTUAL_ENV} && \
pip install --no-cache-dir cython numpy==${NUMPY_VERSION}

# Install mpi4py against our stub
RUN env MPICC="${STUBS_DIR}/bin/mpicc" \
RUN env MPI4PY_BUILD_MPIABI=1 MPICC="${STUBS_DIR}/bin/mpicc" \
pip install --no-cache-dir --no-build-isolation --no-binary mpi4py mpi4py

RUN python3 -c "from mpi4py import MPI; print(MPI.Get_version())" && \
Expand Down
Loading