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

Implement standard MPI ABI #43

Draft
wants to merge 141 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
5a3d8b5
Start rewrite
eschnett Nov 20, 2023
fa76422
Further development
eschnett Nov 20, 2023
d551fd7
Set up CI
eschnett Nov 20, 2023
e919835
CI: Debug
eschnett Nov 20, 2023
023962f
CI: Install OpenMPI 5.0
eschnett Nov 20, 2023
c901bf7
CI: Install OpenMPI 5.0
eschnett Nov 20, 2023
fa05502
CI: Simplify setup
eschnett Nov 20, 2023
16ececa
CI: Install OpenMPI 5.0
eschnett Nov 20, 2023
b47c1d0
CI: Install MPICH
eschnett Nov 20, 2023
7b01c0c
CI: Install OpenMPI 5.0
eschnett Nov 20, 2023
ac2bd48
CI: Correct cache setup
eschnett Nov 20, 2023
6fe38e8
CI: Correct cache setup
eschnett Nov 20, 2023
df78b1f
CI: Install OpenMPI statically
eschnett Nov 20, 2023
b34a8dd
mpiwrapper: Continue development
eschnett Nov 20, 2023
dcb4424
Begin to check for available MPI features
eschnett Nov 21, 2023
2916ab8
Further development
eschnett Nov 21, 2023
3c7f7be
Further development
eschnett Nov 21, 2023
bf5664a
More configure work
eschnett Nov 21, 2023
313e849
Create a module
eschnett Nov 21, 2023
8814ac4
CI: Disable OpenMPI
eschnett Nov 21, 2023
2536f08
Finish section A.3.4
eschnett Nov 21, 2023
aa16b3f
Optimize converting counts
eschnett Nov 21, 2023
7db6941
Introduce request actions
eschnett Nov 21, 2023
ea7ff9b
CI: Simplify and add test
eschnett Nov 21, 2023
1ef5903
CI: Simplify and add test
eschnett Nov 21, 2023
4f75ef3
CI: Add test
eschnett Nov 21, 2023
bc1504d
Add install instructions to cmake
eschnett Nov 21, 2023
4a4b92e
Correct test build instructions
eschnett Nov 21, 2023
ee5e30c
Add test program
eschnett Nov 21, 2023
2cf26eb
MPItrampoline: Load MPI symbols from MPIwrapper
eschnett Nov 21, 2023
a64db21
MPItrampoline: Load MPI symbols from MPIwrapper
eschnett Nov 21, 2023
4c24059
MPItrampoline: Load MPI symbols from MPIwrapper
eschnett Nov 21, 2023
1ee4aaf
MPItrampoline: Load MPI symbols from MPIwrapper
eschnett Nov 21, 2023
c0d0aca
MPItrampoline: Load MPI symbols from MPIwrapper
eschnett Nov 21, 2023
67fe2a1
MPItrampoline: Load MPI symbols from MPIwrapper
eschnett Nov 21, 2023
9114737
MPItrampoline: Load MPI symbols from MPIwrapper
eschnett Nov 21, 2023
2e5946b
MPItrampoline: Load MPI symbols from MPIwrapper
eschnett Nov 21, 2023
fa36185
MPItrampoline: Load MPI symbols from MPIwrapper
eschnett Nov 21, 2023
8aa1b79
More development
eschnett Nov 21, 2023
be06f25
CI: Disable broken test
eschnett Nov 21, 2023
2410b74
Implement MPIABI_Init
eschnett Nov 21, 2023
045008b
Set correct dlopen mode
eschnett Nov 21, 2023
f413b48
Correct naming confusion
eschnett Nov 21, 2023
84bd260
MPItrampoline: Set all function pointers
eschnett Nov 21, 2023
c0ea0bd
MPItrampoline: Set all function pointers
eschnett Nov 21, 2023
e75c636
MPItrampoline: Disable unimplemented functions
eschnett Nov 21, 2023
de5217c
MPItrampoline: Enable implemented functions
eschnett Nov 21, 2023
585b2bf
CI: Add test
eschnett Nov 21, 2023
9fcf371
CI: Correct build directory locations
eschnett Nov 21, 2023
525e921
CI: Correct MPI wrapper library location
eschnett Nov 21, 2023
5539916
MPItrampoline: require libdl
eschnett Nov 21, 2023
9f4f343
MPItrampoline: require libdl
eschnett Nov 21, 2023
6af2650
Test: Set rpath
eschnett Nov 22, 2023
f65dbca
Test: Set rpath
eschnett Nov 22, 2023
5972cd1
Implement section A.3.7
eschnett Nov 22, 2023
dabaf3d
Implement section A.3.10
eschnett Nov 22, 2023
1a213ec
Implement A.3.11
eschnett Nov 22, 2023
4c1b503
Begin to work on Fortran
eschnett Nov 22, 2023
e1283da
Begin to work on Fortran
eschnett Nov 22, 2023
72ba665
Create compiler wrappers
eschnett Nov 22, 2023
2387acc
Handle MPI_Status in Fortran
eschnett Nov 22, 2023
a50e500
Implement deprecated bindings
eschnett Nov 22, 2023
b537a8c
Correct some 32-bit wrapper functions
eschnett Nov 22, 2023
06e7d48
Set up 32-bit architectures correctly
eschnett Nov 22, 2023
1c00912
Check communicator size in tests
eschnett Nov 22, 2023
aa30606
Check communicator size in tests
eschnett Nov 22, 2023
39fa037
CI: Enable OpenMPI
eschnett Nov 23, 2023
ef0d468
Disable MPI standard version check
eschnett Nov 23, 2023
dd96aaf
Check for MPI_LB
eschnett Nov 23, 2023
6aab92a
Check for MPI_UB
eschnett Nov 23, 2023
20e4d69
Check for two-level namespaces on macOS; fake MPI4
eschnett Nov 23, 2023
994cbef
Fake MPI 4
eschnett Nov 23, 2023
524a0f5
Fake MPI 4
eschnett Nov 23, 2023
426c69b
CI: Allow oversubscribing CPUs
eschnett Nov 23, 2023
de8f30a
README: Add status badge
eschnett Nov 23, 2023
37d812d
Implement File I/O functions
eschnett Nov 23, 2023
025ac46
Implement File I/O functions
eschnett Nov 23, 2023
5e060fd
Define Fortran interface blocks
eschnett Nov 23, 2023
068c794
Ensure MPI handles don't conflict
eschnett Nov 23, 2023
f4ca85e
Test fixed form Fortran
eschnett Nov 23, 2023
bc1cd18
Test fixed form Fortran
eschnett Nov 23, 2023
d4ff89a
Update README
eschnett Nov 23, 2023
a5f6bf1
Update README
eschnett Nov 23, 2023
94208aa
Implement removed MPI bindings
eschnett Nov 23, 2023
f360d94
Correct some MPI constants
eschnett Nov 23, 2023
593f9ee
Implement MPI_Pack_size
eschnett Nov 23, 2023
5339caf
Convert keyvals
eschnett Nov 23, 2023
c018050
More translating
eschnett Nov 23, 2023
cdbc60c
More translating
eschnett Nov 23, 2023
df2a709
Add some backward compatibility
eschnett Nov 23, 2023
5df08d8
Add some backward compatibility
eschnett Nov 23, 2023
6c78516
Add some backward compatibility
eschnett Nov 23, 2023
3e79ffd
Debug Docker builds
eschnett Nov 23, 2023
6bbc6ca
Debug Docker builds
eschnett Nov 23, 2023
0f12b55
Debug Docker builds
eschnett Nov 23, 2023
e8dc31d
Debug Docker builds
eschnett Nov 23, 2023
bc18255
Finish Fortran MPI constants
eschnett Nov 24, 2023
f128df9
Finish Fortran MPI constants
eschnett Nov 24, 2023
128daba
Finish Fortran MPI constants
eschnett Nov 24, 2023
563ae11
Support `mpi.f90`
eschnett Nov 24, 2023
1e1c897
More Fortran support
eschnett Nov 25, 2023
b7df8ba
More Fortran functions
eschnett Nov 25, 2023
5379f56
Work around MPICH bug
eschnett Nov 25, 2023
cdd8d09
Work around MPICH bug
eschnett Nov 25, 2023
2794312
More Fortran functions
eschnett Nov 25, 2023
6a14584
More Fortran functions
eschnett Nov 25, 2023
b7b3186
More Fortran functions
eschnett Nov 26, 2023
3aa7677
More Fortran functions
eschnett Nov 27, 2023
7d35a4d
More Fortran functions
eschnett Nov 28, 2023
2d3298d
Correct cmake script for finding MPI
eschnett Nov 28, 2023
9ae85a2
Correct MPI datatype detection
eschnett Nov 28, 2023
c0417df
Correct checks in cmake file
eschnett Nov 28, 2023
8205eeb
Correct checks in cmake file
eschnett Nov 28, 2023
cb8ed47
CI: Specify MPI Fortran compiler
eschnett Nov 28, 2023
b425b3f
Correct Fortran MPI datatype tests
eschnett Nov 28, 2023
ba3aea7
Support building with MPI 4.0
eschnett Nov 28, 2023
a97f1c8
Support building with MPI 4.0
eschnett Nov 28, 2023
c11d4e3
Support building with MPI 4.0
eschnett Nov 28, 2023
43575d8
Support building with MPI 4.0
eschnett Nov 28, 2023
296684a
Ensure we're not using MPI 3
eschnett Nov 29, 2023
3b5fcdf
Add Fortran MPI 4.0 support
eschnett Nov 29, 2023
96b5f6c
Provide subroutine interfaces in mpif.h
eschnett Nov 29, 2023
b18659a
More Fortran support
eschnett Nov 30, 2023
461d6c7
Finish Fortran functions
eschnett Dec 1, 2023
9407f38
Implement Fortran 2008 bindings
eschnett Dec 1, 2023
7e73866
CI: Test Fortran 2008
eschnett Dec 1, 2023
18631c9
Add debug output
eschnett Dec 1, 2023
1d7527d
Add debug output
eschnett Dec 1, 2023
0f9321c
Convert status only if the status is defined
eschnett Dec 1, 2023
d58611e
Remove debug output
eschnett Dec 1, 2023
c2940f7
Rearrange source files
eschnett Dec 2, 2023
ff2d332
Handle `ignore_tkr` better
eschnett Dec 28, 2023
a9d19dd
Support Flang
eschnett Dec 28, 2023
8280d56
Correct a few errors. Now works with MPICH/OpenMPI, GCC/LLVM.
eschnett Dec 29, 2023
f34b342
Test RTLD_DEEPBIND
eschnett Jan 6, 2024
7842ce7
Use RTLD_DEEPBIND only when available
eschnett Jan 6, 2024
8f33237
Support FreeBSD
eschnett Jan 6, 2024
0a67195
Handle partial MPI 4 support
eschnett Jan 9, 2024
128010a
Add MPI 3.1 documentation
eschnett Jan 9, 2024
e1da1c0
Ignore log files
eschnett Jan 9, 2024
ade3865
Test musl
eschnett Jan 9, 2024
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
10 changes: 10 additions & 0 deletions .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
style = "blue"
indent = 4
margin = 132
always_for_in = true
whitespace_ops_in_indices = true
whitespace_typedefs = false
remove_extra_newlines = true
import_to_using = true
pipe_to_function_call = false
short_to_long_function_def = true
190 changes: 154 additions & 36 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,55 +10,173 @@ env:
BUILD_TYPE: Debug

jobs:
shellcheck:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: shellcheck
run: shellcheck --exclude SC2086 bin/*
build:
strategy:
matrix:
os: [ubuntu-22.04, macos-12]
fortran: [fortran-off, fortran-on]
# TODO: Build on macOS
# TODO: Build with Clang, Flang
os: [ubuntu-22.04]
mpi: [mpich, openmpi]
shared: [shared-off, shared-on]

runs-on: ${{matrix.os}}

steps:
- uses: actions/checkout@v4

- name: Configure
- name: Install ${{matrix.mpi}}
run: |
case "${{matrix.mpi}}" in
mpich)
sudo apt-get update
sudo apt-get install libmpich-dev
;;
openmpi)
sudo apt-get update
sudo apt-get install libopenmpi-dev
;;
esac

# - name: Restore dependencies
# id: cache
# uses: actions/cache/restore@v3
# with:
# path: /usr/local
# key: ${{runner.os}}-${{matrix.mpi}}-dependencies
#
# - name: Build ${{matrix.mpi}}
# if: steps.cache.outputs.cache-hit != 'true'
# run: |
# case "${{matrix.mpi}}" in
# mpich)
# ;;
# openmpi)
# ./.github/workflows/install-openmpi.sh
# ;;
# esac
#
# - name: Save dependencies
# uses: actions/cache/save@v3
# with:
# path: /usr/local
# key: ${{steps.cache.cache-primary-key}}

- name: Configure MPIwrapper
working-directory: ${{github.workspace}}/mpiwrapper
run: |
cmake \
-B build \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_COMPILER=mpicc \
-DCMAKE_Fortran_COMPILER=mpifort \
-DCMAKE_INSTALL_PREFIX=$HOME/mpiwrapper-${{matrix.mpi}}

- name: Build MPIwrapper
working-directory: ${{github.workspace}}/mpiwrapper
run: cmake --build build

# - name: Test
# working-directory: ${{github.workspace}}/build
# run: ctest -C ${{env.BUILD_TYPE}}

- name: Install MPIwrapper
working-directory: ${{github.workspace}}/mpiwrapper
run: cmake --install build

- name: Configure MPItrampoline
working-directory: ${{github.workspace}}/mpitrampoline
run: |
fortran=$(echo ${{matrix.fortran}} | sed -e 's/fortran-//')
shared=$(echo ${{matrix.shared}} | sed -e 's/shared-//')
case $RUNNER_OS in
Linux)
cmake -B ${{github.workspace}}/build \
-DENABLE_FORTRAN=${fortran} \
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-DBUILD_SHARED_LIBS=${shared} \
-DCMAKE_INSTALL_PREFIX=$HOME/mpitrampoline
;;
macOS)
# Use GCC-12 from Homebrew
cmake -B ${{github.workspace}}/build \
-DENABLE_FORTRAN=${fortran} \
-DCMAKE_C_COMPILER=gcc-12 \
-DCMAKE_CXX_COMPILER=g++-12 \
-DCMAKE_Fortran_COMPILER=gfortran-12 \
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-DBUILD_SHARED_LIBS=${shared} \
-DCMAKE_INSTALL_PREFIX=$HOME/mpitrampoline
;;
cmake \
-B build \
-DBUILD_SHARED_LIBS=${shared} \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX=$HOME/mpitrampoline

- name: Build MPItrampoline
working-directory: ${{github.workspace}}/mpitrampoline
run: cmake --build build

# - name: Test
# working-directory: ${{github.workspace}}/build,
# run: ctest -C ${{env.BUILD_TYPE}}

- name: Install MPItrampoline
working-directory: ${{github.workspace}}/mpitrampoline
run: cmake --install build

- name: Test C
working-directory: ${{github.workspace}}/test
run: |
$HOME/mpitrampoline/bin/mpicc -c hello-world-c.c
$HOME/mpitrampoline/bin/mpicc -o hello-world-c hello-world-c.o
export MPITRAMPOLINE_LIB=$HOME/mpiwrapper-${{matrix.mpi}}/lib/libmpiwrapper.so
case "${{matrix.mpi}}" in
mpich) mpiexec_options='';;
openmpi) mpiexec_options='--oversubscribe';;
esac
./hello-world-c 1
mpiexec $mpiexec_options -n 4 ./hello-world-c 4

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --verbose
- name: Test C++
working-directory: ${{github.workspace}}/test
run: |
$HOME/mpitrampoline/bin/mpicxx -c hello-world-cxx.cxx
$HOME/mpitrampoline/bin/mpicxx -o hello-world-cxx hello-world-cxx.o
export MPITRAMPOLINE_LIB=$HOME/mpiwrapper-${{matrix.mpi}}/lib/libmpiwrapper.so
case "${{matrix.mpi}}" in
mpich) mpiexec_options='';;
openmpi) mpiexec_options='--oversubscribe';;
esac
./hello-world-cxx 1
mpiexec $mpiexec_options -n 4 ./hello-world-cxx 4

- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}}
- name: Test fixed form Fortran
working-directory: ${{github.workspace}}/test
run: |
$HOME/mpitrampoline/bin/mpifc -c hello-world-f.f
$HOME/mpitrampoline/bin/mpifc -o hello-world-f hello-world-f.o
export MPITRAMPOLINE_LIB=$HOME/mpiwrapper-${{matrix.mpi}}/lib/libmpiwrapper.so
case "${{matrix.mpi}}" in
mpich) mpiexec_options='';;
openmpi) mpiexec_options='--oversubscribe';;
esac
./hello-world-f 1
mpiexec $mpiexec_options -n 4 ./hello-world-f 4

- name: Install
run: cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Test free form Fortran
working-directory: ${{github.workspace}}/test
run: |
$HOME/mpitrampoline/bin/mpifc -c hello-world-f90.f90
$HOME/mpitrampoline/bin/mpifc -o hello-world-f90 hello-world-f90.o
export MPITRAMPOLINE_LIB=$HOME/mpiwrapper-${{matrix.mpi}}/lib/libmpiwrapper.so
case "${{matrix.mpi}}" in
mpich) mpiexec_options='';;
openmpi) mpiexec_options='--oversubscribe';;
esac
./hello-world-f90 1
mpiexec $mpiexec_options -n 4 ./hello-world-f90 4
- name: Test Fortran 90
working-directory: ${{github.workspace}}/test
run: |
$HOME/mpitrampoline/bin/mpifc -c hello-world-fortran.f90
$HOME/mpitrampoline/bin/mpifc -o hello-world-fortran hello-world-fortran.o
export MPITRAMPOLINE_LIB=$HOME/mpiwrapper-${{matrix.mpi}}/lib/libmpiwrapper.so
case "${{matrix.mpi}}" in
mpich) mpiexec_options='';;
openmpi) mpiexec_options='--oversubscribe';;
esac
./hello-world-fortran 1
mpiexec $mpiexec_options -n 4 ./hello-world-fortran 4
- name: Test Fortran 2008
working-directory: ${{github.workspace}}/test
run: |
$HOME/mpitrampoline/bin/mpifc -c hello-world-fortran08.f90
$HOME/mpitrampoline/bin/mpifc -o hello-world-fortran08 hello-world-fortran08.o
export MPITRAMPOLINE_LIB=$HOME/mpiwrapper-${{matrix.mpi}}/lib/libmpiwrapper.so
case "${{matrix.mpi}}" in
mpich) mpiexec_options='';;
openmpi) mpiexec_options='--oversubscribe';;
esac
./hello-world-fortran08 1
mpiexec $mpiexec_options -n 4 ./hello-world-fortran08 4
11 changes: 11 additions & 0 deletions .github/workflows/install-openmpi.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

set -euxo pipefail

wget https://download.open-mpi.org/release/open-mpi/v5.0/openmpi-5.0.0.tar.bz2
tar xjf openmpi-5.0.0.tar.bz2
cd openmpi-5.0.0
# We don't want to deal with the `rpath` for the shared libraries
./configure --enable-shared=no --enable-static=yes
make -j$(nproc)
sudo make install
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
__pycache__
BUILD.sh
build
build-*
build.log
28 changes: 0 additions & 28 deletions .zenodo.json

This file was deleted.

38 changes: 0 additions & 38 deletions BUILD.md

This file was deleted.

10 changes: 0 additions & 10 deletions CITATION.cff

This file was deleted.

Loading