diff --git a/.github/workflows/Documenter.yml b/.github/workflows/Documenter.yml index dc0ff2b0c..d5db3e4c8 100644 --- a/.github/workflows/Documenter.yml +++ b/.github/workflows/Documenter.yml @@ -19,7 +19,13 @@ jobs: steps: - uses: actions/checkout@v2 - name: Install dependencies - run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate(); Pkg.build(;verbose=true)' + shell: julia --color=yes --project=docs/ {0} + run: | + using Pkg + Pkg.develop(PackageSpec(path="lib/MPIPreferences")) + Pkg.develop(PackageSpec(path=pwd())) + Pkg.instantiate() + Pkg.build(;verbose=true) - name: Build and deploy env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/UnitTests.yml b/.github/workflows/UnitTests.yml index 2578aff17..02d2def3d 100644 --- a/.github/workflows/UnitTests.yml +++ b/.github/workflows/UnitTests.yml @@ -17,7 +17,7 @@ on: - 'test/**' jobs: - test-jll: + test-default: timeout-minutes: 20 strategy: matrix: @@ -27,7 +27,7 @@ jobs: - windows-latest julia_version: - "1.6" - - "1.7" + - "1" - "nightly" julia_arch: [x64, x86] exclude: @@ -37,15 +37,49 @@ jobs: fail-fast: false runs-on: ${{ matrix.os }} - env: - JULIA_MPIEXEC_ARGS: ${{ matrix.mpiexec_args }} steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.4.0 + - name: Checkout + uses: actions/checkout@v2.2.0 + + - uses: julia-actions/setup-julia@latest with: - access_token: ${{ github.token }} + arch: ${{ matrix.julia_arch }} + version: ${{ matrix.julia_version }} + - uses: julia-actions/cache@v1 + + - name: add MPIPreferences + shell: julia --color=yes --project=. {0} + run: | + using Pkg + Pkg.develop(path="lib/MPIPreferences") + - uses: julia-actions/julia-runtest@latest + + test-openmpi-jll: + timeout-minutes: 20 + strategy: + matrix: + os: + - macos-latest + - ubuntu-latest + julia_version: + - "1.6" + - "1" + - "nightly" + julia_arch: [x64, x86] + exclude: + - os: macos-latest + julia_arch: x86 + + fail-fast: false + env: + JULIA_MPI_TEST_BINARY: OpenMPI_jll + JULIA_MPI_TEST_ABI: OpenMPI + + runs-on: ${{ matrix.os }} + + steps: - name: Checkout uses: actions/checkout@v2.2.0 @@ -53,51 +87,43 @@ jobs: with: arch: ${{ matrix.julia_arch }} version: ${{ matrix.julia_version }} + - uses: julia-actions/cache@v1 - # https://discourse.julialang.org/t/recommendation-cache-julia-artifacts-in-ci-services/35484 - - name: Cache artifacts - uses: actions/cache@v1 - env: - cache-name: cache-artifacts - with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} - restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- + - name: add MPIPreferences + shell: julia --color=yes --project=. {0} + run: | + using Pkg + Pkg.develop(path="lib/MPIPreferences") - - uses: julia-actions/julia-buildpkg@latest - - uses: julia-actions/julia-runtest@latest + - name: use OpenMPI_jll + shell: julia --color=yes --project=test {0} + run: | + using Pkg + Pkg.develop(path="lib/MPIPreferences") + using MPIPreferences + MPIPreferences.use_jll_binary("OpenMPI_jll", export_prefs=true) + rm("test/Manifest.toml") + - uses: julia-actions/julia-runtest@latest test-system-brew: timeout-minutes: 20 strategy: matrix: mpi: - #BROKEN - mpich + - mpich - openmpi julia_version: - - "1.6" - # We don't need to test all combinations - # - "1.7" - # - "nightly" + - "1" fail-fast: false runs-on: macos-latest - env: - JULIA_MPI_BINARY: system - JULIA_MPI_PATH: /usr/local + JULIA_MPI_TEST_BINARY: system + ZES_ENABLE_SYSMAN: 1 # https://github.com/open-mpi/ompi/issues/10142 steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.4.0 - with: - access_token: ${{ github.token }} - - name: Checkout uses: actions/checkout@v2.2.0 @@ -110,20 +136,22 @@ jobs: with: version: ${{ matrix.julia_version }} - # https://discourse.julialang.org/t/recommendation-cache-julia-artifacts-in-ci-services/35484 - - name: Cache artifacts - uses: actions/cache@v1 - env: - cache-name: cache-artifacts - with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} - restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- + - uses: julia-actions/cache@v1 + - name: add MPIPreferences + shell: julia --color=yes --project=. {0} + run: | + using Pkg + Pkg.develop(path="lib/MPIPreferences") + + - name: add MPIPreferences, use system + shell: julia --color=yes --project=test {0} + run: | + using Pkg + Pkg.develop(path="lib/MPIPreferences") + using MPIPreferences + MPIPreferences.use_system_binary(export_prefs=true) + rm("test/Manifest.toml") - - uses: julia-actions/julia-buildpkg@latest - uses: julia-actions/julia-runtest@latest env: # TODO: Only disable this test for MPICH. OpenMPI works fine. @@ -138,31 +166,24 @@ jobs: - libmpich-dev - libopenmpi-dev julia_version: - - "1.6" - # We don't need to test all combinations - # - "1.7" - # - "nightly" + - "1" fail-fast: false runs-on: ubuntu-20.04 env: - JULIA_MPI_BINARY: system - JULIA_MPI_PATH: /usr + JULIA_MPI_TEST_BINARY: system OMPI_MCA_btl_base_warn_component_unused: 0 steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.4.0 - with: - access_token: ${{ github.token }} - - name: Checkout uses: actions/checkout@v2.2.0 - name: Install MPI via apt - run: sudo apt-get install $MPI + run: | + sudo apt-get update + sudo apt-get install $MPI env: MPI: ${{ matrix.mpi }} @@ -170,47 +191,40 @@ jobs: with: version: ${{ matrix.julia_version }} - # https://discourse.julialang.org/t/recommendation-cache-julia-artifacts-in-ci-services/35484 - - name: Cache artifacts - uses: actions/cache@v1 - env: - cache-name: cache-artifacts - with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} - restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- + - uses: julia-actions/cache@v1 + - name: add MPIPreferences + shell: julia --color=yes --project=. {0} + run: | + using Pkg + Pkg.develop(path="lib/MPIPreferences") - - uses: julia-actions/julia-buildpkg@latest - - uses: julia-actions/julia-runtest@latest + - name: add MPIPreferences, use system + shell: julia --color=yes --project=test {0} + run: | + using Pkg + Pkg.develop(path="lib/MPIPreferences") + using MPIPreferences + MPIPreferences.use_system_binary(export_prefs=true) + rm("test/Manifest.toml") + - uses: julia-actions/julia-runtest@latest test-intel-linux: timeout-minutes: 20 strategy: matrix: julia_version: - - "1.6" - # We don't need to test all combinations - # - "1.7" - # - "nightly" + - "1" fail-fast: false runs-on: ubuntu-18.04 # 20.04 not supported env: - JULIA_MPI_BINARY: system - JULIA_MPI_PATH: /home/runner/intel/compilers_and_libraries_2020.4.304/linux/mpi/intel64 + JULIA_MPI_TEST_BINARY: system + JULIA_MPI_TEST_ABi: MPICH steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.4.0 - with: - access_token: ${{ github.token }} - - name: Checkout uses: actions/checkout@v2.2.0 @@ -226,7 +240,7 @@ jobs: run: wget https://registrationcenter-download.intel.com/akdlm/irc_nas/tec/17263/l_mpi_2019.9.304.tgz - name: Install Intel MPI - run: | + run: | tar -xzf l_mpi_2019.9.304.tgz pushd l_mpi_2019.9.304 cat << EOF > intel.conf @@ -245,24 +259,24 @@ jobs: with: version: ${{ matrix.julia_version }} - # https://discourse.julialang.org/t/recommendation-cache-julia-artifacts-in-ci-services/35484 - - name: Cache artifacts - uses: actions/cache@v1 - env: - cache-name: cache-artifacts - with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} - restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- + - uses: julia-actions/cache@v1 + - name: add MPIPreferences + shell: julia --color=yes --project=. {0} + run: | + using Pkg + Pkg.develop(path="lib/MPIPreferences") - # we can't use the usual actions here as we need to ensure the environment variables are set - - name: "Build package" + - name: add MPIPreferences, use system run: | source ${HOME}/intel/compilers_and_libraries/linux/mpi/intel64/bin/mpivars.sh release - julia --project -e 'using Pkg; Pkg.instantiate(verbose=true); Pkg.build(verbose=true)' + julia --color=yes --project=test -e ' + using Pkg + Pkg.develop(path="lib/MPIPreferences") + using MPIPreferences + MPIPreferences.use_system_binary(export_prefs=true) + rm("test/Manifest.toml")' + + # we can't use the usual actions here as we need to ensure the environment variables are set - name: "Run tests" run: | source ${HOME}/intel/compilers_and_libraries/linux/mpi/intel64/bin/mpivars.sh release @@ -274,25 +288,13 @@ jobs: strategy: matrix: julia_version: - - "1.6" - # We don't need to test all combinations - # - "1.7" - # - "nightly" + - "1" fail-fast: false runs-on: windows-latest - env: - JULIA_MPI_BINARY: system - JULIA_MPIEXEC: "C:\\Program Files\\Microsoft MPI\\Bin\\mpiexec" - steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.4.0 - with: - access_token: ${{ github.token }} - - name: Checkout uses: actions/checkout@v2.2.0 @@ -308,20 +310,25 @@ jobs: with: version: ${{ matrix.julia_version }} - # https://discourse.julialang.org/t/recommendation-cache-julia-artifacts-in-ci-services/35484 - - name: Cache artifacts - uses: actions/cache@v1 - env: - cache-name: cache-artifacts - with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} - restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- + - uses: julia-actions/cache@v1 + - name: add MPIPreferences + shell: julia --color=yes --project=. {0} + run: | + using Pkg + Pkg.develop(path="lib/MPIPreferences") + + - name: add MPIPreferences, use system + shell: julia --color=yes --project=test {0} + run: | + using Pkg + Pkg.develop(path="lib/MPIPreferences") + using MPIPreferences + MPIPreferences.use_system_binary(; + export_prefs=true, + mpiexec="C:\\Program Files\\Microsoft MPI\\Bin\\mpiexec" + ) + rm("test/Manifest.toml") - - uses: julia-actions/julia-buildpkg@latest - uses: julia-actions/julia-runtest@latest @@ -335,7 +342,7 @@ jobs: mpi: [mpitrampoline] julia_version: - "1.6" - - "1.7" + - "1" - "nightly" julia_arch: - x64 @@ -347,16 +354,11 @@ jobs: fail-fast: false runs-on: ${{ matrix.os }} - env: - JULIA_MPI_BINARY: MPItrampoline_jll + JULIA_MPI_TEST_BINARY: MPItrampoline_jll + JULIA_MPI_TEST_ABI: MPIwrapper steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.4.0 - with: - access_token: ${{ github.token }} - - name: Checkout uses: actions/checkout@v2.2.0 @@ -364,152 +366,24 @@ jobs: with: version: ${{ matrix.julia_version }} - # https://discourse.julialang.org/t/recommendation-cache-julia-artifacts-in-ci-services/35484 - - name: Cache artifacts - uses: actions/cache@v1 - env: - cache-name: cache-artifacts - with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} - restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- + - uses: julia-actions/cache@v1 - - uses: julia-actions/julia-buildpkg@latest - - uses: julia-actions/julia-runtest@latest + - name: add MPIPreferences + shell: julia --color=yes --project=. {0} + run: | + using Pkg + Pkg.develop(path="lib/MPIPreferences") + - name: use MPItrampoline_jll + shell: julia --color=yes --project=test {0} + run: | + using Pkg + Pkg.develop(path="lib/MPIPreferences") + using MPIPreferences + MPIPreferences.use_jll_binary("MPItrampoline_jll", export_prefs=true) + rm("test/Manifest.toml") -# It takes too long to build MPICH or OpenMPI from source. -# test-mpitrampoline-system-macos: -# timeout-minutes: 20 -# strategy: -# matrix: -# mpi: -# - mpich -# - openmpi -# julia_version: -# - "1.6" -# - "1.7" -# - "nightly" -# -# fail-fast: false -# -# runs-on: macos-latest -# -# env: -# JULIA_MPI_BINARY: MPItrampoline_jll -# MPITRAMPOLINE_VERBOSE: 1 #TODO -# MPITRAMPOLINE_LIB: /usr/local/lib/libmpiwrapper.so -# MPITRAMPOLINE_MPIEXEC: /usr/local/bin/mpiexec -# -# steps: -# - name: Cancel Previous Runs -# uses: styfle/cancel-workflow-action@0.4.0 -# with: -# access_token: ${{ github.token }} -# -# - name: Checkout -# uses: actions/checkout@v2.2.0 -# -# - name: Install Homebrew packages -# run: brew install autoconf automake -# env: -# MPI: ${{ matrix.mpi }} -# -# # We cannot install MPICH or OpenMPI via Homebrew or MacPorts, -# # since the MPI libraries there use a flat namespace, which means -# # that they cannot be loaded as plugin. We need to build the -# # libraries ourselves. -# - name: Install MPI -# run: | -# case ${{ matrix.mpi }} in -# mpich) -# # Install MPICH 4.0.b1 (a beta version) since 3.4.2 has a -# # bug in MPI_Reduce -# wget http://www.mpich.org/static/downloads/4.0b1/mpich-4.0b1.tar.gz -# tar xzf mpich-4.0b1.tar.gz -# cd mpich* -# ./configure \ -# --enable-two-level-namespace \ -# --prefix=/usr/local \ -# CC=gcc-11 \ -# CXX=g++-11 \ -# FC=gfortran-11 \ -# FFLAGS=-fallow-argument-mismatch \ -# FCFLAGS=-fallow-argument-mismatch -# make -j$(nproc) -# sudo make -j$(nproc) install -# ;; -# openmpi) -# wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.2.tar.gz -# tar xzf openmpi-4.1.2.tar.gz -# cd openmpi* -# find . -type f -print0 | xargs -0 perl -pi -e 's/-Wl,-flat_namespace//g' -# ./autogen.pl --force -# ./configure \ -# --prefix=/usr/local \ -# CC=gcc-11 \ -# CXX=g++-11 \ -# FC=gfortran-11 -# make -j$(nproc) -# sudo make -j$(nproc) install -# ;; -# esac -# env: -# MPI: ${{ matrix.mpi }} -# -# - name: Build MPIwrapper -# run: | -# wget https://github.com/eschnett/MPIwrapper/archive/refs/tags/v2.2.1.tar.gz -# tar xzf v2.2.1.tar.gz -# cd MPIwrapper-* -# cmake \ -# -DCMAKE_CXX_COMPILER=g++-11 \ -# -DCMAKE_Fortran_COMPILER=gfortran-11 \ -# -DMPIEXEC_EXECUTABLE=mpiexec \ -# -DCMAKE_BUILD_TYPE=Debug \ -# -DCMAKE_INSTALL_PREFIX=/usr/local \ -# . -# # cmake \ -# # -DCMAKE_CXX_COMPILER=g++-11 \ -# # -DCMAKE_Fortran_COMPILER=gfortran-11 \ -# # -DMPI_CXX_ADDITIONAL_INCLUDE_DIRS=/usr/local/include \ -# # -DMPI_CXX_ADDITIONAL_INCLUDE_DIRS=/usr/local/include \ -# # -DMPI_CXX_LIB_NAMES='mpi' \ -# # -DMPI_Fortran_ADDITIONAL_INCLUDE_DIRS='/usr/local/include;/usr/local/lib' \ -# # -DMPI_Fortran_LIB_NAMES='mpi_usempif08;mpi_usempi_ignore_tkr;mpi_mpifh;mpi' \ -# # -DMPI_mpi_LIBRARY=/usr/local/lib/libmpi.dylib \ -# # -DMPI_mpi_mpifh_LIBRARY=/usr/local/lib/libmpi_mpifh.dylib \ -# # -DMPI_mpi_usempi_ignore_tkr_LIBRARY=/usr/local/lib/libmpi_usempi_ignore_tkr.dylib \ -# # -DMPI_mpi_usempif08_LIBRARY=/usr/local/lib/libmpi_usempif08.dylib \ -# # -DMPIEXEC_EXECUTABLE=/usr/local/bin/mpiexec \ -# # -DCMAKE_BUILD_TYPE=Debug \ -# # -DCMAKE_INSTALL_PREFIX=/usr/local \ -# # . -# cmake --build . -# sudo cmake --install . -# -# - uses: julia-actions/setup-julia@latest -# with: -# version: ${{ matrix.julia_version }} -# -# # https://discourse.julialang.org/t/recommendation-cache-julia-artifacts-in-ci-services/35484 -# - name: Cache artifacts -# uses: actions/cache@v1 -# env: -# cache-name: cache-artifacts -# with: -# path: ~/.julia/artifacts -# key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} -# restore-keys: | -# ${{ runner.os }}-test-${{ env.cache-name }}- -# ${{ runner.os }}-test- -# ${{ runner.os }}- -# -# - uses: julia-actions/julia-buildpkg@latest -# - uses: julia-actions/julia-runtest@latest + - uses: julia-actions/julia-runtest@latest test-mpitrampoline-system-apt: @@ -520,62 +394,67 @@ jobs: - libmpich-dev - libopenmpi-dev julia_version: - - "1.6" + - "1" # We don't need to test all combinations # - "1.7" # - "nightly" + MPIWrapper: + - "2.3.2" fail-fast: false runs-on: ubuntu-20.04 env: - JULIA_MPI_BINARY: MPItrampoline_jll + JULIA_MPI_TEST_BINARY: MPItrampoline_jll + JULIA_MPI_TEST_ABI: MPIwrapper MPITRAMPOLINE_LIB: /usr/local/lib/libmpiwrapper.so MPITRAMPOLINE_MPIEXEC: /usr/bin/mpiexec OMPI_MCA_btl_base_warn_component_unused: 0 steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.4.0 - with: - access_token: ${{ github.token }} - - name: Checkout uses: actions/checkout@v2.2.0 - name: Install MPI via apt - run: sudo apt-get install $MPI + run: | + sudo apt-get update + sudo apt-get install $MPI env: MPI: ${{ matrix.mpi }} - name: Build MPIwrapper run: | - wget https://github.com/eschnett/MPIwrapper/archive/refs/tags/v2.2.1.tar.gz - tar xzf v2.2.1.tar.gz + wget https://github.com/eschnett/MPIwrapper/archive/refs/tags/v${MPIWrapper}.tar.gz + tar xzf v${MPIWrapper}.tar.gz cd MPIwrapper-* cmake -DMPIEXEC_EXECUTABLE=mpiexec -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr/local . cmake --build . sudo cmake --install . + env: + MPIWrapper: ${{matrix.MPIWrapper}} - uses: julia-actions/setup-julia@latest with: version: ${{ matrix.julia_version }} - # https://discourse.julialang.org/t/recommendation-cache-julia-artifacts-in-ci-services/35484 - - name: Cache artifacts - uses: actions/cache@v1 - env: - cache-name: cache-artifacts - with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} - restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- + - uses: julia-actions/cache@v1 + + - name: add MPIPreferences + shell: julia --color=yes --project=. {0} + run: | + using Pkg + Pkg.develop(path="lib/MPIPreferences") + + - name: use MPItrampoline_jll + shell: julia --color=yes --project=test {0} + run: | + using Pkg + Pkg.develop(path="lib/MPIPreferences") + using MPIPreferences + MPIPreferences.use_jll_binary("MPItrampoline_jll", export_prefs=true) + rm("test/Manifest.toml") - - uses: julia-actions/julia-buildpkg@latest - uses: julia-actions/julia-runtest@latest @@ -588,6 +467,8 @@ jobs: # We don't need to test all combinations # - "1.7" # - "nightly" + MPIWrapper: + - "2.3.2" fail-fast: false @@ -599,11 +480,6 @@ jobs: MPITRAMPOLINE_MPIEXEC: /home/runner/intel/compilers_and_libraries_2020.4.304/linux/mpi/intel64/bin/mpiexec steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.4.0 - with: - access_token: ${{ github.token }} - - name: Checkout uses: actions/checkout@v2.2.0 @@ -619,7 +495,7 @@ jobs: run: wget https://registrationcenter-download.intel.com/akdlm/irc_nas/tec/17263/l_mpi_2019.9.304.tgz - name: Install Intel MPI - run: | + run: | tar -xzf l_mpi_2019.9.304.tgz pushd l_mpi_2019.9.304 cat << EOF > intel.conf @@ -637,8 +513,8 @@ jobs: - name: Build MPIwrapper run: | source ${HOME}/intel/compilers_and_libraries/linux/mpi/intel64/bin/mpivars.sh release - wget https://github.com/eschnett/MPIwrapper/archive/refs/tags/v2.2.1.tar.gz - tar xzf v2.2.1.tar.gz + wget https://github.com/eschnett/MPIwrapper/archive/refs/tags/v${MPIWrapper}.tar.gz + tar xzf v${MPIWrapper}.tar.gz cd MPIwrapper-* cmake \ -DMPIEXEC_EXECUTABLE=mpiexec \ @@ -647,6 +523,8 @@ jobs: . cmake --build . sudo cmake --install . + env: + MPIWrapper: ${{matrix.MPIWrapper}} - uses: julia-actions/setup-julia@latest with: @@ -665,8 +543,14 @@ jobs: ${{ runner.os }}-test- ${{ runner.os }}- + - name: add MPIPreferences + shell: julia --color=yes --project=. {0} + run: | + using Pkg + Pkg.develop(path="lib/MPIPreferences") + # We can't use the usual actions here as we need to ensure the environment variables are set - - name: "Build package" + - name: "Build package" run: | source ${HOME}/intel/compilers_and_libraries/linux/mpi/intel64/bin/mpivars.sh release julia --project -e 'using Pkg; Pkg.instantiate(verbose=true); Pkg.build(verbose=true)' diff --git a/.gitignore b/.gitignore index 2fdbf4663..ddc4e8c78 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ libjuliampi.dylib *.mem *.so Manifest.toml +LocalPreferences.toml diff --git a/Project.toml b/Project.toml index 8492f3ab7..1ed57183e 100644 --- a/Project.toml +++ b/Project.toml @@ -8,11 +8,10 @@ Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b" DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" MPICH_jll = "7cb0a576-ebde-5e09-9194-50597f1243b4" +MPIPreferences = "3da0fdf6-3ccc-4f1b-acd9-58baa6c99267" MPItrampoline_jll = "f1f71cc9-e9ae-5b93-9b94-4fe0e1ad3748" MicrosoftMPI_jll = "9237b28f-5490-5468-be7b-bb81f5f5e6cf" OpenMPI_jll = "fe0851c0-eecd-5654-98d4-656369965a5c" -Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" -Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" Requires = "ae029012-a4dd-5104-9daa-d747884805df" Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b" Sockets = "6462fe0b-24de-5631-8697-dd941f90decc" @@ -21,11 +20,3 @@ Sockets = "6462fe0b-24de-5631-8697-dd941f90decc" DocStringExtensions = "0.8" Requires = "~0.5, 1.0" julia = "1.6" - -[extras] -CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" -DoubleFloats = "497a8b3b-efae-58df-a0af-a86822472b78" -Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" - -[targets] -test = ["CUDA", "DoubleFloats", "Test"] diff --git a/deps/.gitignore b/deps/.gitignore deleted file mode 100644 index a57b5a1c6..000000000 --- a/deps/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -deps.jl -build.log -generate_compile_time_mpi_constants -compile_time_mpi_constants.jl -load_time_mpi_constants.dylib -load_time_mpi_constants.so diff --git a/deps/MPIconstants-1.4.0/.github/workflows/CI.yml b/deps/MPIconstants-1.4.0/.github/workflows/CI.yml deleted file mode 100644 index 8279e42b9..000000000 --- a/deps/MPIconstants-1.4.0/.github/workflows/CI.yml +++ /dev/null @@ -1,164 +0,0 @@ -name: CI - -on: - push: - branches: [main] - pull_request: - branches: [main] - -env: - BUILD_TYPE: Debug - -jobs: - build: - strategy: - matrix: - os: - - ubuntu-20.04 - - macos-11 - #TODO - windows-2019 - mpi: [MPICH, OpenMPI, MSMPI] - exclude: - - os: ubuntu-20.04 - mpi: MSMPI - - os: macos-11 - mpi: MSMPI - - os: windows-2019 - mpi: MPICH - - os: windows-2019 - mpi: OpenMPI - - runs-on: ${{matrix.os}} - - steps: - - uses: actions/checkout@v2 - - - name: Install ${{matrix.mpi}} - shell: bash - run: | - case $RUNNER_OS in - Linux) - case "${{matrix.mpi}}" in - MPICH) packages=libmpich-dev;; - OpenMPI) packages=libopenmpi-dev;; - esac - sudo apt-get install $packages - ;; - macOS) - # The Homebrew MPICH doesn't have the `mpi-f08` Fortran - # module, but cmake insists on it. We thus use MacPorts - # instead. - - # case "${{matrix.mpi}}" in - # MPICH) packages=mpich;; - # OpenMPI) packages=open-mpi;; - # esac - # brew install $packages - - # Install MacPorts - wget https://github.com/macports/macports-base/releases/download/v2.7.1/MacPorts-2.7.1-11-BigSur.pkg - sudo /usr/sbin/installer -pkg MacPorts-2.7.1-11-BigSur.pkg -target / - rm MacPorts-2.7.1-11-BigSur.pkg - echo /opt/local/bin >> $GITHUB_PATH - echo /opt/local/sbin >> $GITHUB_PATH - export "PATH=/opt/local/bin:/opt/local/sbin:$PATH" - sudo port sync - - case "${{matrix.mpi}}" in - MPICH) packages='mpich-gcc10 +fortran';; - OpenMPI) packages='openmpi-gcc11 +fortran';; - esac - sudo port install $packages - ;; - Windows) - # wget https://download.microsoft.com/download/a/5/2/a5207ca5-1203-491a-8fb8-906fd68ae623/msmpisetup.exe - # See - # Should we use instead? - echo AAA - curl -L -O https://download.microsoft.com/download/a/5/2/a5207ca5-1203-491a-8fb8-906fd68ae623/msmpisetup.exe - echo BBB - ./msmpisetup.exe -unattend -force - echo CCC - Test-Path "C:/Program Files/Microsoft MPI/Bin/mpiexec.exe" -PathType leaf - echo DDD - echo "C:/Program Files/Microsoft MPI/Bin/" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - echo EEE - ;; - esac - - - name: Configure - shell: bash - run: | - case $RUNNER_OS in - Linux) - cmake -B ${{github.workspace}}/build \ - -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ - -DCMAKE_INSTALL_PREFIX=${HOME}/mpiconstants - ;; - macOS) - case ${{matrix.mpi}} in - MPICH) - # The compiler wrappers have non-standard names - cmake -B ${{github.workspace}}/build \ - -DCMAKE_C_COMPILER=mpicc-mpich-gcc10 \ - -DMPIEXEC_EXECUTABLE=/opt/local/bin/mpiexec-mpich-gcc10 \ - -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ - -DCMAKE_INSTALL_PREFIX=${HOME}/mpiconstants - ;; - OpenMPI) - # The compiler wrappers have non-standard names - cmake -B ${{github.workspace}}/build \ - -DCMAKE_C_COMPILER=mpicc-openmpi-gcc11 \ - -DMPIEXEC_EXECUTABLE=/opt/local/bin/mpiexec-openmpi-gcc11 \ - -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ - -DCMAKE_INSTALL_PREFIX=${HOME}/mpiconstants - ;; - esac - ;; - Windows) - cmake -B ${{github.workspace}}/build \ - -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ - -DCMAKE_INSTALL_PREFIX=${HOME}/mpiconstants - ;; - esac - - - name: Build - shell: bash - run: | - cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - - - name: Test - working-directory: ${{github.workspace}}/build - shell: bash - run: ctest -C ${{env.BUILD_TYPE}} - - - name: Install - shell: bash - run: cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - - - name: Test - shell: bash - run: | - # Test generating compile-time constants - ${HOME}/mpiconstants/bin/generate_compile_time_mpi_constants - test -f compile_time_mpi_constants.jl - grep -q 'MPI_MAX_LIBRARY_VERSION_STRING' compile_time_mpi_constants.jl - grep -q 'MPI_Status' compile_time_mpi_constants.jl - grep -q 'MPI_Comm' compile_time_mpi_constants.jl - # Examine load-time constants - if [ $(uname) = Darwin ]; then - dlsuffix='dylib' - symprefix='_' - symtype='[DS]' - else - dlsuffix='so' - symprefix='' - symtype='[BDR]' - fi - test -e ${HOME}/mpiconstants/lib/libload_time_mpi_constants.${dlsuffix} - nm ${HOME}/mpiconstants/lib/libload_time_mpi_constants.${dlsuffix} | - grep -q " ${symtype} ${symprefix}MPICONSTANTS_COMM_WORLD\$" - nm ${HOME}/mpiconstants/lib/libload_time_mpi_constants.${dlsuffix} | - grep -q " ${symtype} ${symprefix}MPICONSTANTS_INT\$" - nm ${HOME}/mpiconstants/lib/libload_time_mpi_constants.${dlsuffix} | - grep -q " ${symtype} ${symprefix}MPICONSTANTS_STATUS_IGNORE\$" diff --git a/deps/MPIconstants-1.4.0/CMakeLists.txt b/deps/MPIconstants-1.4.0/CMakeLists.txt deleted file mode 100644 index 9ae9f68e1..000000000 --- a/deps/MPIconstants-1.4.0/CMakeLists.txt +++ /dev/null @@ -1,31 +0,0 @@ -cmake_minimum_required(VERSION 3.12...3.20) -project( - MPIwrapper - VERSION 1.4.0 - DESCRIPTION "MPI constants" - LANGUAGES C - ) - -set(CMAKE_C_STANDARD 11) - -find_package(MPI REQUIRED) - -add_library(load_time_mpi_constants SHARED - load_time_mpi_constants.c - ) -target_link_libraries(load_time_mpi_constants PRIVATE MPI::MPI_C) -install( - TARGETS load_time_mpi_constants - LIBRARY - DESTINATION lib - ) - -add_executable(generate_compile_time_mpi_constants - generate_compile_time_mpi_constants.c - ) -target_link_libraries(generate_compile_time_mpi_constants PRIVATE MPI::MPI_C) -install( - TARGETS generate_compile_time_mpi_constants - RUNTIME - DESTINATION bin - ) diff --git a/deps/MPIconstants-1.4.0/LICENSE.md b/deps/MPIconstants-1.4.0/LICENSE.md deleted file mode 100644 index b6485213b..000000000 --- a/deps/MPIconstants-1.4.0/LICENSE.md +++ /dev/null @@ -1,7 +0,0 @@ -Copyright 2021 Erik Schnetter - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/MPIconstants-1.4.0/README.md b/deps/MPIconstants-1.4.0/README.md deleted file mode 100644 index 8b1541012..000000000 --- a/deps/MPIconstants-1.4.0/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# MPIconstants - -* [![GitHub - CI](https://github.com/eschnett/MPIconstants/actions/workflows/CI.yml/badge.svg)](https://github.com/eschnett/MPIconstants/actions) - -Extract compile-time and load-time constants from and MPI library. -This is useful for libraries or applications that are not written in -C, C++, or Fortran, and want to link against an MPI library as a -binary dependency. - -For the compile-time constants (e.g. `MPI_VERSION`), an executable -`generate_compile_time_mpi_constants` is created that outputs their -definitions. - -For the load-time constants (e.g. `MPI_COMM_WORLD`), a shared library -`libload_time_mpi_constants.so` is created that defines global -variables holding the respective values. - -Example output from `generate_compile_time_mpi_constants`: -```Julia - const MPI_VERSION_ = Cint(3) - const MPI_SUBVERSION_ = Cint(1) -``` -(This output is actually Julia code.) - -Example definition in `libload_time_mpi_constants.so`: -```C -const MPI_Comm MPICONSTANTS_COMM_NULL; -const MPI_Comm MPICONSTANTS_COMM_SELF; -const MPI_Comm MPICONSTANTS_COMM_WORLD; -``` -This shared library can be loaded via `dlopen`, and the constants -`MPICONSTANTS_COMM_NULL` etc. can be read to determine the respective -values. - -# Using `cmake` to build this library - -```sh -rm -rf build $HOME/src/c/MPIstuff/mpiconstants-openmpi -cmake -S . -B build -G Ninja -DMPIEXEC_EXECUTABLE=$(which mpiexec-openmpi-gcc11) -DCMAKE_C_COMPILER=mpicc-openmpi-gcc11 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$HOME/src/c/MPIstuff/mpiconstants-openmpi -cmake --build build -cmake --install build -``` diff --git a/deps/MPIconstants-1.4.0/generate_compile_time_mpi_constants.c b/deps/MPIconstants-1.4.0/generate_compile_time_mpi_constants.c deleted file mode 100644 index 17cae2b2c..000000000 --- a/deps/MPIconstants-1.4.0/generate_compile_time_mpi_constants.c +++ /dev/null @@ -1,144 +0,0 @@ -#include -#include -#include -#include - -#include - -// This should be defined in in C11, but some older compilers don't -#ifndef static_assert -#define static_assert(cond, msg) _Static_assert(cond, msg) -#endif - -int main(int argc, char **argv) { - MPI_Init(&argc, &argv); - - FILE *file = fopen("compile_time_mpi_constants.jl", "w"); - - fprintf(file, "# This file has been generated automatically by " - "`generate_compile_time_mpi_constants`.\n"); - fprintf(file, "# Do not edit.\n"); - fprintf(file, "\n"); - - fprintf( - file, - "# MPI library version (for reference only; this is not a constant)\n"); - int len; - char library_version[MPI_MAX_LIBRARY_VERSION_STRING]; - MPI_Get_library_version(library_version, &len); - fprintf(file, "const MPI_LIBRARY_VERSION_ = \""); - for (const char *restrict p = library_version; *p; ++p) { - switch (*p) { - case '\t': - fprintf(file, "\\t"); - break; - case '\n': - fprintf(file, "\\n"); - break; - case '"': - case '$': - case '\\': - fprintf(file, "\\%c", *p); - break; - default: - // Omit non-printable characters for safety - if (isprint(*p)) - fprintf(file, "%c", *p); - } - } - fprintf(file, "\"\n"); - fprintf(file, "\n"); - - fprintf(file, "# Compile-time constants\n"); - fprintf(file, "\n"); - fprintf(file, "# Version:\n"); - fprintf(file, - "# (We add an underscore to avoid a name conflict with `MPI.jl`)\n"); - fprintf(file, "const MPI_VERSION_ = Cint(%d)\n", MPI_VERSION); - fprintf(file, "const MPI_SUBVERSION_ = Cint(%d)\n", MPI_SUBVERSION); - fprintf(file, "\n"); - fprintf(file, "# Implementation limits:\n"); - fprintf(file, "const MPI_MAX_DATAREP_STRING = Cint(%d)\n", - MPI_MAX_DATAREP_STRING); - fprintf(file, "const MPI_MAX_ERROR_STRING = Cint(%d)\n", - MPI_MAX_ERROR_STRING); - fprintf(file, "const MPI_MAX_INFO_KEY = Cint(%d)\n", MPI_MAX_INFO_KEY); - fprintf(file, "const MPI_MAX_INFO_VAL = Cint(%d)\n", MPI_MAX_INFO_VAL); - fprintf(file, "const MPI_MAX_LIBRARY_VERSION_STRING = Cint(%d)\n", - MPI_MAX_LIBRARY_VERSION_STRING); - fprintf(file, "const MPI_MAX_OBJECT_NAME = Cint(%d)\n", MPI_MAX_OBJECT_NAME); - fprintf(file, "const MPI_MAX_PORT_NAME = Cint(%d)\n", MPI_MAX_PORT_NAME); - fprintf(file, "const MPI_MAX_PROCESSOR_NAME = Cint(%d)\n", - MPI_MAX_PROCESSOR_NAME); - - fprintf(file, "\n"); - fprintf(file, "# Types\n"); - fprintf(file, "\n"); - fprintf(file, "# Various (signed) integer types:\n"); - fprintf(file, "const MPI_Aint = Int%zu\n", 8 * sizeof(MPI_Aint)); - fprintf(file, "const MPI_Count = Int%zu\n", 8 * sizeof(MPI_Count)); - fprintf(file, "const MPI_Fint = Int%zu\n", 8 * sizeof(MPI_Fint)); - fprintf(file, "const MPI_Offset = Int%zu\n", 8 * sizeof(MPI_Offset)); - fprintf(file, "\n"); - fprintf(file, "# Status:\n"); - static_assert(sizeof(MPI_Status) % sizeof(int) == 0, - "MPI_Status is not made of `int` fields"); - static_assert(offsetof(MPI_Status, MPI_ERROR) % sizeof(int) == 0, - "MPI_Status field MPI_ERROR is not aligned to `int`"); - static_assert(offsetof(MPI_Status, MPI_SOURCE) % sizeof(int) == 0, - "MPI_Status field MPI_SOURCE is not aligned to `int`"); - static_assert(offsetof(MPI_Status, MPI_TAG) % sizeof(int) == 0, - "MPI_Status field MPI_TAG is not aligned to `int`"); - fprintf(file, "struct MPI_Status\n"); - for (size_t n = 0; n < sizeof(MPI_Status) / sizeof(int); ++n) { - if (n == offsetof(MPI_Status, MPI_ERROR) / sizeof(int)) - fprintf(file, " MPI_ERROR::Cint\n"); - else if (n == offsetof(MPI_Status, MPI_SOURCE) / sizeof(int)) - fprintf(file, " MPI_SOURCE::Cint\n"); - else if (n == offsetof(MPI_Status, MPI_TAG) / sizeof(int)) - fprintf(file, " MPI_TAG::Cint\n"); - else - fprintf(file, " private%zu::Cint\n", n); - } - fprintf(file, "end\n"); - fprintf(file, "\n"); - fprintf(file, "# Opaque handles:\n"); - fprintf(file, "const MPI_Comm = UInt%zu\n", 8 * sizeof(MPI_Comm)); - fprintf(file, "const MPI_Datatype = UInt%zu\n", 8 * sizeof(MPI_Datatype)); - fprintf(file, "const MPI_Errhandler = UInt%zu\n", 8 * sizeof(MPI_Errhandler)); - fprintf(file, "const MPI_File = UInt%zu\n", 8 * sizeof(MPI_File)); - fprintf(file, "const MPI_Group = UInt%zu\n", 8 * sizeof(MPI_Group)); - fprintf(file, "const MPI_Info = UInt%zu\n", 8 * sizeof(MPI_Info)); - fprintf(file, "const MPI_Message = UInt%zu\n", 8 * sizeof(MPI_Message)); - fprintf(file, "const MPI_Op = UInt%zu\n", 8 * sizeof(MPI_Op)); - fprintf(file, "const MPI_Request = UInt%zu\n", 8 * sizeof(MPI_Request)); - fprintf(file, "const MPI_Win = UInt%zu\n", 8 * sizeof(MPI_Win)); - fprintf(file, "\n"); - fprintf(file, "# Function pointers:\n"); - fprintf(file, "const MPI_Comm_copy_attr_function = Ptr{Cvoid}\n"); - fprintf(file, "const MPI_Comm_delete_attr_function = Ptr{Cvoid}\n"); - fprintf(file, "const MPI_Comm_errhandler_function = Ptr{Cvoid}\n"); - fprintf(file, - "const MPI_Comm_errhandler_fn = MPI_Comm_errhandler_function\n"); - fprintf(file, "const MPI_Copy_function = MPI_Comm_copy_attr_function\n"); - fprintf(file, "const MPI_Datarep_conversion_function = Ptr{Cvoid}\n"); - fprintf(file, "const MPI_Datarep_extent_function = Ptr{Cvoid}\n"); - fprintf(file, "const MPI_Delete_function = Ptr{Cvoid}\n"); - fprintf(file, "const MPI_File_errhandler_function = Ptr{Cvoid}\n"); - fprintf(file, "const MPI_File_errhandler_fn = Ptr{Cvoid}\n"); - fprintf(file, "const MPI_Grequest_cancel_function = Ptr{Cvoid}\n"); - fprintf(file, "const MPI_Grequest_free_function = Ptr{Cvoid}\n"); - fprintf(file, "const MPI_Grequest_query_function = Ptr{Cvoid}\n"); - fprintf(file, "const MPI_Type_copy_attr_function = Ptr{Cvoid}\n"); - fprintf(file, "const MPI_Type_delete_attr_function = Ptr{Cvoid}\n"); - fprintf(file, "const MPI_User_function = Ptr{Cvoid}\n"); - fprintf(file, "const MPI_Win_copy_attr_function = Ptr{Cvoid}\n"); - fprintf(file, "const MPI_Win_delete_attr_function = Ptr{Cvoid}\n"); - fprintf(file, "const MPI_Win_errhandler_function = Ptr{Cvoid}\n"); - fprintf(file, "const MPI_Win_errhandler_fn = MPI_Win_errhandler_function\n"); - - fclose(file); - - MPI_Finalize(); - return 0; -} diff --git a/deps/MPIconstants-1.4.0/load_time_mpi_constants.c b/deps/MPIconstants-1.4.0/load_time_mpi_constants.c deleted file mode 100644 index a00e45649..000000000 --- a/deps/MPIconstants-1.4.0/load_time_mpi_constants.c +++ /dev/null @@ -1,536 +0,0 @@ -#include - -// Load-time constants -int MPICONSTANTS_ANY_SOURCE; -int MPICONSTANTS_ANY_TAG; -int MPICONSTANTS_PROC_NULL; -int MPICONSTANTS_ROOT; -int MPICONSTANTS_CART; -int MPICONSTANTS_DIST_GRAPH; -int MPICONSTANTS_GRAPH; -int MPICONSTANTS_CONGRUENT; -int MPICONSTANTS_IDENT; -int MPICONSTANTS_SIMILAR; -int MPICONSTANTS_UNEQUAL; -int MPICONSTANTS_BSEND_OVERHEAD; -int MPICONSTANTS_KEYVAL_INVALID; -int MPICONSTANTS_UNDEFINED; -int MPICONSTANTS_APPNUM; -int MPICONSTANTS_HOST; -int MPICONSTANTS_IO; -int MPICONSTANTS_LASTUSEDCODE; -int MPICONSTANTS_TAG_UB; -int MPICONSTANTS_UNIVERSE_SIZE; -int MPICONSTANTS_WIN_BASE; -int MPICONSTANTS_WIN_CREATE_FLAVOR; -int MPICONSTANTS_WIN_DISP_UNIT; -int MPICONSTANTS_WIN_MODEL; -int MPICONSTANTS_WIN_SIZE; -int MPICONSTANTS_WTIME_IS_GLOBAL; -int MPICONSTANTS_COMBINER_CONTIGUOUS; -int MPICONSTANTS_COMBINER_DARRAY; -int MPICONSTANTS_COMBINER_DUP; -int MPICONSTANTS_COMBINER_F90_COMPLEX; -int MPICONSTANTS_COMBINER_F90_INTEGER; -int MPICONSTANTS_COMBINER_F90_REAL; -int MPICONSTANTS_COMBINER_HINDEXED; -int MPICONSTANTS_COMBINER_HINDEXED_BLOCK; -int MPICONSTANTS_COMBINER_HVECTOR; -int MPICONSTANTS_COMBINER_INDEXED; -int MPICONSTANTS_COMBINER_INDEXED_BLOCK; -int MPICONSTANTS_COMBINER_NAMED; -int MPICONSTANTS_COMBINER_RESIZED; -int MPICONSTANTS_COMBINER_STRUCT; -int MPICONSTANTS_COMBINER_SUBARRAY; -int MPICONSTANTS_COMBINER_VECTOR; -int MPICONSTANTS_COMM_TYPE_SHARED; -int MPICONSTANTS_DISTRIBUTE_BLOCK; -int MPICONSTANTS_DISTRIBUTE_CYCLIC; -int MPICONSTANTS_DISTRIBUTE_NONE; -int MPICONSTANTS_ERR_ACCESS; -int MPICONSTANTS_ERR_AMODE; -int MPICONSTANTS_ERR_ARG; -int MPICONSTANTS_ERR_ASSERT; -int MPICONSTANTS_ERR_BAD_FILE; -int MPICONSTANTS_ERR_BASE; -int MPICONSTANTS_ERR_BUFFER; -int MPICONSTANTS_ERR_COMM; -int MPICONSTANTS_ERR_CONVERSION; -int MPICONSTANTS_ERR_COUNT; -int MPICONSTANTS_ERR_DIMS; -int MPICONSTANTS_ERR_DISP; -int MPICONSTANTS_ERR_DUP_DATAREP; -int MPICONSTANTS_ERR_FILE; -int MPICONSTANTS_ERR_FILE_EXISTS; -int MPICONSTANTS_ERR_FILE_IN_USE; -int MPICONSTANTS_ERR_GROUP; -int MPICONSTANTS_ERR_INFO; -int MPICONSTANTS_ERR_INFO_KEY; -int MPICONSTANTS_ERR_INFO_NOKEY; -int MPICONSTANTS_ERR_INFO_VALUE; -int MPICONSTANTS_ERR_INTERN; -int MPICONSTANTS_ERR_IN_STATUS; -int MPICONSTANTS_ERR_IO; -int MPICONSTANTS_ERR_KEYVAL; -int MPICONSTANTS_ERR_LASTCODE; -int MPICONSTANTS_ERR_LOCKTYPE; -int MPICONSTANTS_ERR_NAME; -int MPICONSTANTS_ERR_NOT_SAME; -int MPICONSTANTS_ERR_NO_MEM; -int MPICONSTANTS_ERR_NO_SPACE; -int MPICONSTANTS_ERR_NO_SUCH_FILE; -int MPICONSTANTS_ERR_OP; -int MPICONSTANTS_ERR_OTHER; -int MPICONSTANTS_ERR_PENDING; -int MPICONSTANTS_ERR_PORT; -int MPICONSTANTS_ERR_QUOTA; -int MPICONSTANTS_ERR_RANK; -int MPICONSTANTS_ERR_READ_ONLY; -int MPICONSTANTS_ERR_REQUEST; -#if MPI_VERSION >= 3 -int MPICONSTANTS_ERR_RMA_ATTACH; -#endif -int MPICONSTANTS_ERR_RMA_CONFLICT; -#if MPI_VERSION >= 3 -int MPICONSTANTS_ERR_RMA_FLAVOR; -int MPICONSTANTS_ERR_RMA_RANGE; -int MPICONSTANTS_ERR_RMA_SHARED; -#endif -int MPICONSTANTS_ERR_RMA_SYNC; -int MPICONSTANTS_ERR_ROOT; -int MPICONSTANTS_ERR_SERVICE; -int MPICONSTANTS_ERR_SIZE; -int MPICONSTANTS_ERR_SPAWN; -int MPICONSTANTS_ERR_TAG; -int MPICONSTANTS_ERR_TOPOLOGY; -int MPICONSTANTS_ERR_TRUNCATE; -int MPICONSTANTS_ERR_TYPE; -int MPICONSTANTS_ERR_UNKNOWN; -int MPICONSTANTS_ERR_UNSUPPORTED_DATAREP; -int MPICONSTANTS_ERR_UNSUPPORTED_OPERATION; -int MPICONSTANTS_ERR_WIN; -int MPICONSTANTS_SUCCESS; -int MPICONSTANTS_LOCK_EXCLUSIVE; -int MPICONSTANTS_LOCK_SHARED; -int MPICONSTANTS_MODE_APPEND; -int MPICONSTANTS_MODE_CREATE; -int MPICONSTANTS_MODE_DELETE_ON_CLOSE; -int MPICONSTANTS_MODE_EXCL; -int MPICONSTANTS_MODE_NOCHECK; -int MPICONSTANTS_MODE_NOPRECEDE; -int MPICONSTANTS_MODE_NOPUT; -int MPICONSTANTS_MODE_NOSTORE; -int MPICONSTANTS_MODE_NOSUCCEED; -int MPICONSTANTS_MODE_RDONLY; -int MPICONSTANTS_MODE_RDWR; -int MPICONSTANTS_MODE_SEQUENTIAL; -int MPICONSTANTS_MODE_UNIQUE_OPEN; -int MPICONSTANTS_MODE_WRONLY; -int MPICONSTANTS_ORDER_C; -int MPICONSTANTS_ORDER_FORTRAN; -int MPICONSTANTS_SEEK_CUR; -int MPICONSTANTS_SEEK_END; -int MPICONSTANTS_SEEK_SET; -int MPICONSTANTS_THREAD_SINGLE; -int MPICONSTANTS_THREAD_FUNNELED; -int MPICONSTANTS_THREAD_SERIALIZED; -int MPICONSTANTS_THREAD_MULTIPLE; -int MPICONSTANTS_TYPECLASS_COMPLEX; -int MPICONSTANTS_TYPECLASS_INTEGER; -int MPICONSTANTS_TYPECLASS_REAL; - -char **MPICONSTANTS_ARGV_NULL; -char ***MPICONSTANTS_ARGVS_NULL; -// int *MPICONSTANTS_UNWEIGHTED ; -// int *MPICONSTANTS_WEIGHTS_EMPTY ; -void *MPICONSTANTS_BOTTOM; -void *MPICONSTANTS_IN_PLACE; - -MPI_Comm MPICONSTANTS_COMM_NULL; -MPI_Comm MPICONSTANTS_COMM_SELF; -MPI_Comm MPICONSTANTS_COMM_WORLD; -MPI_Comm_copy_attr_function *MPICONSTANTS_COMM_DUP_FN; -MPI_Comm_copy_attr_function *MPICONSTANTS_COMM_NULL_COPY_FN; -MPI_Comm_delete_attr_function *MPICONSTANTS_COMM_NULL_DELETE_FN; -MPI_Copy_function *MPICONSTANTS_NULL_COPY_FN; -MPI_Datatype MPICONSTANTS_2DOUBLE_PRECISION; -MPI_Datatype MPICONSTANTS_2INT; -MPI_Datatype MPICONSTANTS_2INTEGER; -MPI_Datatype MPICONSTANTS_2REAL; -MPI_Datatype MPICONSTANTS_AINT; -MPI_Datatype MPICONSTANTS_BYTE; -MPI_Datatype MPICONSTANTS_CHAR; -MPI_Datatype MPICONSTANTS_CHARACTER; -MPI_Datatype MPICONSTANTS_COMPLEX; -MPI_Datatype MPICONSTANTS_COMPLEX16; -#ifdef MPI_COMPLEX32 -MPI_Datatype MPICONSTANTS_COMPLEX32; -#endif -MPI_Datatype MPICONSTANTS_COMPLEX8; -MPI_Datatype MPICONSTANTS_COUNT; -#if MPI_VERSION >= 3 -MPI_Datatype MPICONSTANTS_CXX_BOOL; -MPI_Datatype MPICONSTANTS_CXX_DOUBLE_COMPLEX; -MPI_Datatype MPICONSTANTS_CXX_FLOAT_COMPLEX; -MPI_Datatype MPICONSTANTS_CXX_LONG_DOUBLE_COMPLEX; -#endif -MPI_Datatype MPICONSTANTS_C_BOOL; -MPI_Datatype MPICONSTANTS_C_COMPLEX; -MPI_Datatype MPICONSTANTS_C_DOUBLE_COMPLEX; -MPI_Datatype MPICONSTANTS_C_FLOAT_COMPLEX; -MPI_Datatype MPICONSTANTS_C_LONG_DOUBLE_COMPLEX; -MPI_Datatype MPICONSTANTS_DATATYPE_NULL; -MPI_Datatype MPICONSTANTS_DOUBLE; -MPI_Datatype MPICONSTANTS_DOUBLE_COMPLEX; -MPI_Datatype MPICONSTANTS_DOUBLE_INT; -MPI_Datatype MPICONSTANTS_DOUBLE_PRECISION; -MPI_Datatype MPICONSTANTS_FLOAT; -MPI_Datatype MPICONSTANTS_FLOAT_INT; -MPI_Datatype MPICONSTANTS_INT; -MPI_Datatype MPICONSTANTS_INT16_T; -MPI_Datatype MPICONSTANTS_INT32_T; -MPI_Datatype MPICONSTANTS_INT64_T; -MPI_Datatype MPICONSTANTS_INT8_T; -MPI_Datatype MPICONSTANTS_INTEGER; -MPI_Datatype MPICONSTANTS_INTEGER1; -MPI_Datatype MPICONSTANTS_INTEGER2; -MPI_Datatype MPICONSTANTS_INTEGER4; -MPI_Datatype MPICONSTANTS_INTEGER8; -MPI_Datatype MPICONSTANTS_LOGICAL; -MPI_Datatype MPICONSTANTS_LONG; -MPI_Datatype MPICONSTANTS_LONG_DOUBLE; -MPI_Datatype MPICONSTANTS_LONG_DOUBLE_INT; -MPI_Datatype MPICONSTANTS_LONG_INT; -MPI_Datatype MPICONSTANTS_LONG_LONG; -MPI_Datatype MPICONSTANTS_LONG_LONG_INT; -MPI_Datatype MPICONSTANTS_OFFSET; -MPI_Datatype MPICONSTANTS_PACKED; -MPI_Datatype MPICONSTANTS_REAL; -#ifdef MPI_REAL16 -MPI_Datatype MPICONSTANTS_REAL16; -#endif -MPI_Datatype MPICONSTANTS_REAL4; -MPI_Datatype MPICONSTANTS_REAL8; -MPI_Datatype MPICONSTANTS_SHORT; -MPI_Datatype MPICONSTANTS_SHORT_INT; -MPI_Datatype MPICONSTANTS_SIGNED_CHAR; -MPI_Datatype MPICONSTANTS_UINT16_T; -MPI_Datatype MPICONSTANTS_UINT32_T; -MPI_Datatype MPICONSTANTS_UINT64_T; -MPI_Datatype MPICONSTANTS_UINT8_T; -MPI_Datatype MPICONSTANTS_UNSIGNED; -MPI_Datatype MPICONSTANTS_UNSIGNED_CHAR; -MPI_Datatype MPICONSTANTS_UNSIGNED_LONG; -MPI_Datatype MPICONSTANTS_UNSIGNED_LONG_LONG; -MPI_Datatype MPICONSTANTS_UNSIGNED_SHORT; -MPI_Datatype MPICONSTANTS_WCHAR; -MPI_Delete_function *MPICONSTANTS_NULL_DELETE_FN; -MPI_Errhandler MPICONSTANTS_ERRHANDLER_NULL; -MPI_Errhandler MPICONSTANTS_ERRORS_ARE_FATAL; -MPI_Errhandler MPICONSTANTS_ERRORS_RETURN; -MPI_File MPICONSTANTS_FILE_NULL; -MPI_Group MPICONSTANTS_GROUP_EMPTY; -MPI_Group MPICONSTANTS_GROUP_NULL; -#if MPI_VERSION >= 3 -MPI_Info MPICONSTANTS_INFO_ENV; -#endif -MPI_Info MPICONSTANTS_INFO_NULL; -MPI_Message MPICONSTANTS_MESSAGE_NO_PROC; -MPI_Message MPICONSTANTS_MESSAGE_NULL; -MPI_Offset MPICONSTANTS_DISPLACEMENT_CURRENT; -MPI_Op MPICONSTANTS_BAND; -MPI_Op MPICONSTANTS_BOR; -MPI_Op MPICONSTANTS_BXOR; -MPI_Op MPICONSTANTS_LAND; -MPI_Op MPICONSTANTS_LOR; -MPI_Op MPICONSTANTS_LXOR; -MPI_Op MPICONSTANTS_MAX; -MPI_Op MPICONSTANTS_MAXLOC; -MPI_Op MPICONSTANTS_MIN; -MPI_Op MPICONSTANTS_MINLOC; -MPI_Op MPICONSTANTS_NO_OP; -MPI_Op MPICONSTANTS_OP_NULL; -MPI_Op MPICONSTANTS_PROD; -MPI_Op MPICONSTANTS_REPLACE; -MPI_Op MPICONSTANTS_SUM; -MPI_Request MPICONSTANTS_REQUEST_NULL; -MPI_Status *MPICONSTANTS_STATUS_IGNORE; -MPI_Status *MPICONSTANTS_STATUSES_IGNORE; -MPI_Type_copy_attr_function *MPICONSTANTS_TYPE_DUP_FN; -MPI_Type_copy_attr_function *MPICONSTANTS_TYPE_NULL_COPY_FN; -MPI_Type_delete_attr_function *MPICONSTANTS_TYPE_NULL_DELETE_FN; -MPI_Win MPICONSTANTS_WIN_NULL; -MPI_Win_copy_attr_function *MPICONSTANTS_WIN_DUP_FN; -MPI_Win_copy_attr_function *MPICONSTANTS_WIN_NULL_COPY_FN; -MPI_Win_delete_attr_function *MPICONSTANTS_WIN_NULL_DELETE_FN; - -#ifdef __APPLE__ -#define CONSTRUCTOR_PRIORITY -#else -#define CONSTRUCTOR_PRIORITY (1000) -#endif -static void __attribute__((__constructor__ CONSTRUCTOR_PRIORITY)) -mpiconstants_init() { - MPICONSTANTS_ANY_SOURCE = MPI_ANY_SOURCE; - MPICONSTANTS_ANY_TAG = MPI_ANY_TAG; - MPICONSTANTS_PROC_NULL = MPI_PROC_NULL; - MPICONSTANTS_ROOT = MPI_ROOT; - MPICONSTANTS_CART = MPI_CART; - MPICONSTANTS_DIST_GRAPH = MPI_DIST_GRAPH; - MPICONSTANTS_GRAPH = MPI_GRAPH; - MPICONSTANTS_CONGRUENT = MPI_CONGRUENT; - MPICONSTANTS_IDENT = MPI_IDENT; - MPICONSTANTS_SIMILAR = MPI_SIMILAR; - MPICONSTANTS_UNEQUAL = MPI_UNEQUAL; - MPICONSTANTS_BSEND_OVERHEAD = MPI_BSEND_OVERHEAD; - MPICONSTANTS_KEYVAL_INVALID = MPI_KEYVAL_INVALID; - MPICONSTANTS_UNDEFINED = MPI_UNDEFINED; - MPICONSTANTS_APPNUM = MPI_APPNUM; - MPICONSTANTS_HOST = MPI_HOST; - MPICONSTANTS_IO = MPI_IO; - MPICONSTANTS_LASTUSEDCODE = MPI_LASTUSEDCODE; - MPICONSTANTS_TAG_UB = MPI_TAG_UB; - MPICONSTANTS_UNIVERSE_SIZE = MPI_UNIVERSE_SIZE; - MPICONSTANTS_WIN_BASE = MPI_WIN_BASE; - MPICONSTANTS_WIN_CREATE_FLAVOR = MPI_WIN_CREATE_FLAVOR; - MPICONSTANTS_WIN_DISP_UNIT = MPI_WIN_DISP_UNIT; - MPICONSTANTS_WIN_MODEL = MPI_WIN_MODEL; - MPICONSTANTS_WIN_SIZE = MPI_WIN_SIZE; - MPICONSTANTS_WTIME_IS_GLOBAL = MPI_WTIME_IS_GLOBAL; - MPICONSTANTS_COMBINER_CONTIGUOUS = MPI_COMBINER_CONTIGUOUS; - MPICONSTANTS_COMBINER_DARRAY = MPI_COMBINER_DARRAY; - MPICONSTANTS_COMBINER_DUP = MPI_COMBINER_DUP; - MPICONSTANTS_COMBINER_F90_COMPLEX = MPI_COMBINER_F90_COMPLEX; - MPICONSTANTS_COMBINER_F90_INTEGER = MPI_COMBINER_F90_INTEGER; - MPICONSTANTS_COMBINER_F90_REAL = MPI_COMBINER_F90_REAL; - MPICONSTANTS_COMBINER_HINDEXED = MPI_COMBINER_HINDEXED; - MPICONSTANTS_COMBINER_HINDEXED_BLOCK = MPI_COMBINER_HINDEXED_BLOCK; - MPICONSTANTS_COMBINER_HVECTOR = MPI_COMBINER_HVECTOR; - MPICONSTANTS_COMBINER_INDEXED = MPI_COMBINER_INDEXED; - MPICONSTANTS_COMBINER_INDEXED_BLOCK = MPI_COMBINER_INDEXED_BLOCK; - MPICONSTANTS_COMBINER_NAMED = MPI_COMBINER_NAMED; - MPICONSTANTS_COMBINER_RESIZED = MPI_COMBINER_RESIZED; - MPICONSTANTS_COMBINER_STRUCT = MPI_COMBINER_STRUCT; - MPICONSTANTS_COMBINER_SUBARRAY = MPI_COMBINER_SUBARRAY; - MPICONSTANTS_COMBINER_VECTOR = MPI_COMBINER_VECTOR; - MPICONSTANTS_COMM_TYPE_SHARED = MPI_COMM_TYPE_SHARED; - MPICONSTANTS_DISTRIBUTE_BLOCK = MPI_DISTRIBUTE_BLOCK; - MPICONSTANTS_DISTRIBUTE_CYCLIC = MPI_DISTRIBUTE_CYCLIC; - MPICONSTANTS_DISTRIBUTE_NONE = MPI_DISTRIBUTE_NONE; - MPICONSTANTS_ERR_ACCESS = MPI_ERR_ACCESS; - MPICONSTANTS_ERR_AMODE = MPI_ERR_AMODE; - MPICONSTANTS_ERR_ARG = MPI_ERR_ARG; - MPICONSTANTS_ERR_ASSERT = MPI_ERR_ASSERT; - MPICONSTANTS_ERR_BAD_FILE = MPI_ERR_BAD_FILE; - MPICONSTANTS_ERR_BASE = MPI_ERR_BASE; - MPICONSTANTS_ERR_BUFFER = MPI_ERR_BUFFER; - MPICONSTANTS_ERR_COMM = MPI_ERR_COMM; - MPICONSTANTS_ERR_CONVERSION = MPI_ERR_CONVERSION; - MPICONSTANTS_ERR_COUNT = MPI_ERR_COUNT; - MPICONSTANTS_ERR_DIMS = MPI_ERR_DIMS; - MPICONSTANTS_ERR_DISP = MPI_ERR_DISP; - MPICONSTANTS_ERR_DUP_DATAREP = MPI_ERR_DUP_DATAREP; - MPICONSTANTS_ERR_FILE = MPI_ERR_FILE; - MPICONSTANTS_ERR_FILE_EXISTS = MPI_ERR_FILE_EXISTS; - MPICONSTANTS_ERR_FILE_IN_USE = MPI_ERR_FILE_IN_USE; - MPICONSTANTS_ERR_GROUP = MPI_ERR_GROUP; - MPICONSTANTS_ERR_INFO = MPI_ERR_INFO; - MPICONSTANTS_ERR_INFO_KEY = MPI_ERR_INFO_KEY; - MPICONSTANTS_ERR_INFO_NOKEY = MPI_ERR_INFO_NOKEY; - MPICONSTANTS_ERR_INFO_VALUE = MPI_ERR_INFO_VALUE; - MPICONSTANTS_ERR_INTERN = MPI_ERR_INTERN; - MPICONSTANTS_ERR_IN_STATUS = MPI_ERR_IN_STATUS; - MPICONSTANTS_ERR_IO = MPI_ERR_IO; - MPICONSTANTS_ERR_KEYVAL = MPI_ERR_KEYVAL; - MPICONSTANTS_ERR_LASTCODE = MPI_ERR_LASTCODE; - MPICONSTANTS_ERR_LOCKTYPE = MPI_ERR_LOCKTYPE; - MPICONSTANTS_ERR_NAME = MPI_ERR_NAME; - MPICONSTANTS_ERR_NOT_SAME = MPI_ERR_NOT_SAME; - MPICONSTANTS_ERR_NO_MEM = MPI_ERR_NO_MEM; - MPICONSTANTS_ERR_NO_SPACE = MPI_ERR_NO_SPACE; - MPICONSTANTS_ERR_NO_SUCH_FILE = MPI_ERR_NO_SUCH_FILE; - MPICONSTANTS_ERR_OP = MPI_ERR_OP; - MPICONSTANTS_ERR_OTHER = MPI_ERR_OTHER; - MPICONSTANTS_ERR_PENDING = MPI_ERR_PENDING; - MPICONSTANTS_ERR_PORT = MPI_ERR_PORT; - MPICONSTANTS_ERR_QUOTA = MPI_ERR_QUOTA; - MPICONSTANTS_ERR_RANK = MPI_ERR_RANK; - MPICONSTANTS_ERR_READ_ONLY = MPI_ERR_READ_ONLY; - MPICONSTANTS_ERR_REQUEST = MPI_ERR_REQUEST; -#if MPI_VERSION >= 3 - MPICONSTANTS_ERR_RMA_ATTACH = MPI_ERR_RMA_ATTACH; -#endif - MPICONSTANTS_ERR_RMA_CONFLICT = MPI_ERR_RMA_CONFLICT; -#if MPI_VERSION >= 3 - MPICONSTANTS_ERR_RMA_FLAVOR = MPI_ERR_RMA_FLAVOR; - MPICONSTANTS_ERR_RMA_RANGE = MPI_ERR_RMA_RANGE; - MPICONSTANTS_ERR_RMA_SHARED = MPI_ERR_RMA_SHARED; -#endif - MPICONSTANTS_ERR_RMA_SYNC = MPI_ERR_RMA_SYNC; - MPICONSTANTS_ERR_ROOT = MPI_ERR_ROOT; - MPICONSTANTS_ERR_SERVICE = MPI_ERR_SERVICE; - MPICONSTANTS_ERR_SIZE = MPI_ERR_SIZE; - MPICONSTANTS_ERR_SPAWN = MPI_ERR_SPAWN; - MPICONSTANTS_ERR_TAG = MPI_ERR_TAG; - MPICONSTANTS_ERR_TOPOLOGY = MPI_ERR_TOPOLOGY; - MPICONSTANTS_ERR_TRUNCATE = MPI_ERR_TRUNCATE; - MPICONSTANTS_ERR_TYPE = MPI_ERR_TYPE; - MPICONSTANTS_ERR_UNKNOWN = MPI_ERR_UNKNOWN; - MPICONSTANTS_ERR_UNSUPPORTED_DATAREP = MPI_ERR_UNSUPPORTED_DATAREP; - MPICONSTANTS_ERR_UNSUPPORTED_OPERATION = MPI_ERR_UNSUPPORTED_OPERATION; - MPICONSTANTS_ERR_WIN = MPI_ERR_WIN; - MPICONSTANTS_SUCCESS = MPI_SUCCESS; - MPICONSTANTS_LOCK_EXCLUSIVE = MPI_LOCK_EXCLUSIVE; - MPICONSTANTS_LOCK_SHARED = MPI_LOCK_SHARED; - MPICONSTANTS_MODE_APPEND = MPI_MODE_APPEND; - MPICONSTANTS_MODE_CREATE = MPI_MODE_CREATE; - MPICONSTANTS_MODE_DELETE_ON_CLOSE = MPI_MODE_DELETE_ON_CLOSE; - MPICONSTANTS_MODE_EXCL = MPI_MODE_EXCL; - MPICONSTANTS_MODE_NOCHECK = MPI_MODE_NOCHECK; - MPICONSTANTS_MODE_NOPRECEDE = MPI_MODE_NOPRECEDE; - MPICONSTANTS_MODE_NOPUT = MPI_MODE_NOPUT; - MPICONSTANTS_MODE_NOSTORE = MPI_MODE_NOSTORE; - MPICONSTANTS_MODE_NOSUCCEED = MPI_MODE_NOSUCCEED; - MPICONSTANTS_MODE_RDONLY = MPI_MODE_RDONLY; - MPICONSTANTS_MODE_RDWR = MPI_MODE_RDWR; - MPICONSTANTS_MODE_SEQUENTIAL = MPI_MODE_SEQUENTIAL; - MPICONSTANTS_MODE_UNIQUE_OPEN = MPI_MODE_UNIQUE_OPEN; - MPICONSTANTS_MODE_WRONLY = MPI_MODE_WRONLY; - MPICONSTANTS_ORDER_C = MPI_ORDER_C; - MPICONSTANTS_ORDER_FORTRAN = MPI_ORDER_FORTRAN; - MPICONSTANTS_SEEK_CUR = MPI_SEEK_CUR; - MPICONSTANTS_SEEK_END = MPI_SEEK_END; - MPICONSTANTS_SEEK_SET = MPI_SEEK_SET; - MPICONSTANTS_THREAD_SINGLE = MPI_THREAD_SINGLE; - MPICONSTANTS_THREAD_FUNNELED = MPI_THREAD_FUNNELED; - MPICONSTANTS_THREAD_SERIALIZED = MPI_THREAD_SERIALIZED; - MPICONSTANTS_THREAD_MULTIPLE = MPI_THREAD_MULTIPLE; - MPICONSTANTS_TYPECLASS_COMPLEX = MPI_TYPECLASS_COMPLEX; - MPICONSTANTS_TYPECLASS_INTEGER = MPI_TYPECLASS_INTEGER; - MPICONSTANTS_TYPECLASS_REAL = MPI_TYPECLASS_REAL; - - MPICONSTANTS_ARGV_NULL = MPI_ARGV_NULL; - MPICONSTANTS_ARGVS_NULL = MPI_ARGVS_NULL; - // MPICONSTANTS_UNWEIGHTED = MPI_UNWEIGHTED; - // MPICONSTANTS_WEIGHTS_EMPTY = MPI_WEIGHTS_EMPTY; - MPICONSTANTS_BOTTOM = MPI_BOTTOM; - MPICONSTANTS_IN_PLACE = MPI_IN_PLACE; - - MPICONSTANTS_COMM_NULL = MPI_COMM_NULL; - MPICONSTANTS_COMM_SELF = MPI_COMM_SELF; - MPICONSTANTS_COMM_WORLD = MPI_COMM_WORLD; - MPICONSTANTS_COMM_DUP_FN = MPI_COMM_DUP_FN; - MPICONSTANTS_COMM_NULL_COPY_FN = MPI_COMM_NULL_COPY_FN; - MPICONSTANTS_COMM_NULL_DELETE_FN = MPI_COMM_NULL_DELETE_FN; - MPICONSTANTS_NULL_COPY_FN = MPI_NULL_COPY_FN; - MPICONSTANTS_2DOUBLE_PRECISION = MPI_2DOUBLE_PRECISION; - MPICONSTANTS_2INT = MPI_2INT; - MPICONSTANTS_2INTEGER = MPI_2INTEGER; - MPICONSTANTS_2REAL = MPI_2REAL; - MPICONSTANTS_AINT = MPI_AINT; - MPICONSTANTS_BYTE = MPI_BYTE; - MPICONSTANTS_CHAR = MPI_CHAR; - MPICONSTANTS_CHARACTER = MPI_CHARACTER; - MPICONSTANTS_COMPLEX = MPI_COMPLEX; - MPICONSTANTS_COMPLEX16 = MPI_COMPLEX16; -#ifdef MPI_COMPLEX32 - MPICONSTANTS_COMPLEX32 = MPI_COMPLEX32; -#endif - MPICONSTANTS_COMPLEX8 = MPI_COMPLEX8; - MPICONSTANTS_COUNT = MPI_COUNT; -#if MPI_VERSION >= 3 - MPICONSTANTS_CXX_BOOL = MPI_CXX_BOOL; - MPICONSTANTS_CXX_DOUBLE_COMPLEX = MPI_CXX_DOUBLE_COMPLEX; - MPICONSTANTS_CXX_FLOAT_COMPLEX = MPI_CXX_FLOAT_COMPLEX; - MPICONSTANTS_CXX_LONG_DOUBLE_COMPLEX = MPI_CXX_LONG_DOUBLE_COMPLEX; -#endif - MPICONSTANTS_C_BOOL = MPI_C_BOOL; - MPICONSTANTS_C_COMPLEX = MPI_C_COMPLEX; - MPICONSTANTS_C_DOUBLE_COMPLEX = MPI_C_DOUBLE_COMPLEX; - MPICONSTANTS_C_FLOAT_COMPLEX = MPI_C_FLOAT_COMPLEX; - MPICONSTANTS_C_LONG_DOUBLE_COMPLEX = MPI_C_LONG_DOUBLE_COMPLEX; - MPICONSTANTS_DATATYPE_NULL = MPI_DATATYPE_NULL; - MPICONSTANTS_DOUBLE = MPI_DOUBLE; - MPICONSTANTS_DOUBLE_COMPLEX = MPI_DOUBLE_COMPLEX; - MPICONSTANTS_DOUBLE_INT = MPI_DOUBLE_INT; - MPICONSTANTS_DOUBLE_PRECISION = MPI_DOUBLE_PRECISION; - MPICONSTANTS_FLOAT = MPI_FLOAT; - MPICONSTANTS_FLOAT_INT = MPI_FLOAT_INT; - MPICONSTANTS_INT = MPI_INT; - MPICONSTANTS_INT16_T = MPI_INT16_T; - MPICONSTANTS_INT32_T = MPI_INT32_T; - MPICONSTANTS_INT64_T = MPI_INT64_T; - MPICONSTANTS_INT8_T = MPI_INT8_T; - MPICONSTANTS_INTEGER = MPI_INTEGER; - MPICONSTANTS_INTEGER1 = MPI_INTEGER1; - MPICONSTANTS_INTEGER2 = MPI_INTEGER2; - MPICONSTANTS_INTEGER4 = MPI_INTEGER4; - MPICONSTANTS_INTEGER8 = MPI_INTEGER8; - MPICONSTANTS_LOGICAL = MPI_LOGICAL; - MPICONSTANTS_LONG = MPI_LONG; - MPICONSTANTS_LONG_DOUBLE = MPI_LONG_DOUBLE; - MPICONSTANTS_LONG_DOUBLE_INT = MPI_LONG_DOUBLE_INT; - MPICONSTANTS_LONG_INT = MPI_LONG_INT; - MPICONSTANTS_LONG_LONG = MPI_LONG_LONG; - MPICONSTANTS_LONG_LONG_INT = MPI_LONG_LONG_INT; - MPICONSTANTS_OFFSET = MPI_OFFSET; - MPICONSTANTS_PACKED = MPI_PACKED; - MPICONSTANTS_REAL = MPI_REAL; -#ifdef MPI_REAL16 - MPICONSTANTS_REAL16 = MPI_REAL16; -#endif - MPICONSTANTS_REAL4 = MPI_REAL4; - MPICONSTANTS_REAL8 = MPI_REAL8; - MPICONSTANTS_SHORT = MPI_SHORT; - MPICONSTANTS_SHORT_INT = MPI_SHORT_INT; - MPICONSTANTS_SIGNED_CHAR = MPI_SIGNED_CHAR; - MPICONSTANTS_UINT16_T = MPI_UINT16_T; - MPICONSTANTS_UINT32_T = MPI_UINT32_T; - MPICONSTANTS_UINT64_T = MPI_UINT64_T; - MPICONSTANTS_UINT8_T = MPI_UINT8_T; - MPICONSTANTS_UNSIGNED = MPI_UNSIGNED; - MPICONSTANTS_UNSIGNED_CHAR = MPI_UNSIGNED_CHAR; - MPICONSTANTS_UNSIGNED_LONG = MPI_UNSIGNED_LONG; - MPICONSTANTS_UNSIGNED_LONG_LONG = MPI_UNSIGNED_LONG_LONG; - MPICONSTANTS_UNSIGNED_SHORT = MPI_UNSIGNED_SHORT; - MPICONSTANTS_WCHAR = MPI_WCHAR; - MPICONSTANTS_NULL_DELETE_FN = MPI_NULL_DELETE_FN; - MPICONSTANTS_ERRHANDLER_NULL = MPI_ERRHANDLER_NULL; - MPICONSTANTS_ERRORS_ARE_FATAL = MPI_ERRORS_ARE_FATAL; - MPICONSTANTS_ERRORS_RETURN = MPI_ERRORS_RETURN; - MPICONSTANTS_FILE_NULL = MPI_FILE_NULL; - MPICONSTANTS_GROUP_EMPTY = MPI_GROUP_EMPTY; - MPICONSTANTS_GROUP_NULL = MPI_GROUP_NULL; -#if MPI_VERSION >= 3 - MPICONSTANTS_INFO_ENV = MPI_INFO_ENV; -#endif - MPICONSTANTS_INFO_NULL = MPI_INFO_NULL; - MPICONSTANTS_MESSAGE_NO_PROC = MPI_MESSAGE_NO_PROC; - MPICONSTANTS_MESSAGE_NULL = MPI_MESSAGE_NULL; - MPICONSTANTS_DISPLACEMENT_CURRENT = MPI_DISPLACEMENT_CURRENT; - MPICONSTANTS_BAND = MPI_BAND; - MPICONSTANTS_BOR = MPI_BOR; - MPICONSTANTS_BXOR = MPI_BXOR; - MPICONSTANTS_LAND = MPI_LAND; - MPICONSTANTS_LOR = MPI_LOR; - MPICONSTANTS_LXOR = MPI_LXOR; - MPICONSTANTS_MAX = MPI_MAX; - MPICONSTANTS_MAXLOC = MPI_MAXLOC; - MPICONSTANTS_MIN = MPI_MIN; - MPICONSTANTS_MINLOC = MPI_MINLOC; - MPICONSTANTS_NO_OP = MPI_NO_OP; - MPICONSTANTS_OP_NULL = MPI_OP_NULL; - MPICONSTANTS_PROD = MPI_PROD; - MPICONSTANTS_REPLACE = MPI_REPLACE; - MPICONSTANTS_SUM = MPI_SUM; - MPICONSTANTS_REQUEST_NULL = MPI_REQUEST_NULL; - MPICONSTANTS_STATUS_IGNORE = MPI_STATUS_IGNORE; - MPICONSTANTS_STATUSES_IGNORE = MPI_STATUSES_IGNORE; - MPICONSTANTS_TYPE_DUP_FN = MPI_TYPE_DUP_FN; - MPICONSTANTS_TYPE_NULL_COPY_FN = MPI_TYPE_NULL_COPY_FN; - MPICONSTANTS_TYPE_NULL_DELETE_FN = MPI_TYPE_NULL_DELETE_FN; - MPICONSTANTS_WIN_NULL = MPI_WIN_NULL; - MPICONSTANTS_WIN_DUP_FN = MPI_WIN_DUP_FN; - MPICONSTANTS_WIN_NULL_COPY_FN = MPI_WIN_NULL_COPY_FN; - MPICONSTANTS_WIN_NULL_DELETE_FN = MPI_WIN_NULL_DELETE_FN; -} diff --git a/deps/build.jl b/deps/build.jl deleted file mode 100644 index 92ed8bf2b..000000000 --- a/deps/build.jl +++ /dev/null @@ -1,281 +0,0 @@ -using Pkg.TOML, Libdl - -config_toml = joinpath(first(DEPOT_PATH), "prefs", "MPI.toml") -mkpath(dirname(config_toml)) - -if !isfile(config_toml) - touch(config_toml) -end - -# This file contains code that runs at three different occasions: -# -# 1. When `build MPI` is called. At this time, `MPI.jl` has not yet -# been loaded. This code runs essentially as a script. However, it -# calls the MPI function `MPI_Get_library_version`, which means -# that the MPI library must be callable. (`MPI_Init` is not -# called.) The result of this call is saved, to ensure that the MPI -# library doesn't accidentally change at a later time (e.g. when -# the wrong set of modules is loaded), which could lead to -# segfaults that are difficult to debug. -# -# 2. When `MPI.jl` is precompiled. Most things should be initialized -# at that time. -# -# 3. When `MPI.jl` is loaded, i.e. when its `__init__` function is -# run. Some information is only available at load time, e.g. -# certatin MPI constants such as `MPI_COMM_DUP_FN`. This might be -# function pointers whose value is only known at load time. Another -# reason to run code at this time would be to set environment -# variables; their values are not captured while precompiling. -# -# Generally, this file `build.jl` is run at stage (1). It creates a -# file `deps.jl` that is run at stage (2), and which also defines a -# function `__init__deps` that is run at stage (3). Certain actions -# need to happen at two or all three stages. - -config = TOML.parsefile(config_toml) -update_config = false - - -# MPI.toml has 4 keys -# binary = "" (default) | "system" | "MPICH_jll" | "MPItrampoline_jll" | "OpenMPI_jll" | "MicrosoftMPI_jll" -# path = "" (default) | top-level directory location -# library = "" (default) | library name/path | list of library names/paths -# mpiexec = "" (default) | executable name/path | [executable name/path, extra args...] - - -# 1. check if environment variables have changed -if haskey(ENV, "JULIA_MPI_BINARY") - config["binary"] = ENV["JULIA_MPI_BINARY"] - update_config = true -elseif haskey(ENV, "JULIA_MPI_LIBRARY") || haskey(ENV, "JULIA_MPI_PATH") - config["binary"] = "system" -end - -if haskey(ENV, "JULIA_MPI_PATH") - config["path"] = ENV["JULIA_MPI_PATH"] - update_config = true -end - -if haskey(ENV, "JULIA_MPI_LIBRARY") - config["library"] = ENV["JULIA_MPI_LIBRARY"] - update_config = true -end - -if haskey(ENV, "JULIA_MPIEXEC") - if ENV["JULIA_MPIEXEC"] == "" - delete!(config, "mpiexec") - else - config["mpiexec"] = ENV["JULIA_MPIEXEC"] - end - update_config = true -end - -if update_config - open(config_toml, write=true) do f - TOML.print(f, config) - end -end - -binary = get(config, "binary", "") - -# 2. generate deps.jl -if binary == "system" - - @info "using system MPI" - library = get(config, "library", "") - if library == "" - library = ["libmpi", "libmpi_ibm", "msmpi", "libmpich", "libmpitrampoline"] - end - path = get(config, "path", "") - mpiexec = get(config, "mpiexec", path == "" ? "mpiexec" : joinpath(path, "bin", "mpiexec")) - - const libmpi = find_library(library, path == "" ? [] : [joinpath(path, "lib"), joinpath(path, "lib64")]) - if libmpi == "" - error("libmpi could not be found") - end - - const mpiexec_cmd = Cmd(mpiexec isa String ? [mpiexec] : mpiexec) - - _doc_external(fname) = "" - - include(joinpath("..", "src", "implementations.jl")) - - @info "using implementation" libmpi mpiexec_cmd MPI_LIBRARY_VERSION_STRING - - include("prepare_mpi_constants.jl") - - deps = quote - const libmpi = $libmpi - const libmpiconstants = joinpath(dirname(@__DIR__), "deps", "libload_time_mpi_constants.so") - const mpiexec_cmd = $mpiexec_cmd - const mpiexec_path = mpiexec_cmd[1] - _mpiexec(fn) = fn(mpiexec_cmd) - - using Requires - - function __init__deps() - if Get_library_version() != $MPI_LIBRARY_VERSION_STRING - error("MPI library has changed, please re-run `Pkg.build(\"MPI\")`.") - end - - # error if a jll is loaded. - @require(MPICH_jll = "7cb0a576-ebde-5e09-9194-50597f1243b4", - error("MPICH_jll cannot be loaded: MPI.jl is configured to use the system MPI library")) - @require(MPItrampoline_jll = "f1f71cc9-e9ae-5b93-9b94-4fe0e1ad3748", - error("MPItrampoline_jll cannot be loaded: MPI.jl is configured to use the system MPI library")) - @require(MicrosoftMPI_jll = "9237b28f-5490-5468-be7b-bb81f5f5e6cf", - error("MicrosoftMPI_jll cannot be loaded: MPI.jl is configured to use the system MPI library")) - @require(OpenMPI_jll = "fe0851c0-eecd-5654-98d4-656369965a5c", - error("OpenMPI_jll cannot be loaded: MPI.jl is configured to use the system MPI library")) - end - end - -elseif binary == "" - - @info "using default MPI jll" - - if Sys.iswindows() - using MicrosoftMPI_jll - # run(MicrosoftMPI_jll.generate_compile_time_mpi_constants()) - cp("compile_time_mpi_constants_msmpi_$(Sys.ARCH).jl", "compile_time_mpi_constants.jl"; force=true) - else - using MPICH_jll - run(MPICH_jll.generate_compile_time_mpi_constants()) - end - - deps = quote - if Sys.iswindows() - using MicrosoftMPI_jll - const libmpiconstants = MicrosoftMPI_jll.libload_time_mpi_constants - const _mpiexec = MicrosoftMPI_jll.mpiexec - const mpiexec_path = MicrosoftMPI_jll.mpiexec_path - else - using MPICH_jll - const libmpiconstants = MPICH_jll.libload_time_mpi_constants - const _mpiexec = MPICH_jll.mpiexec - const mpiexec_path = MPICH_jll.mpiexec_path - end - - function __init__deps() - if (haskey(ENV, "SLURM_JOBID") || haskey(ENV, "PBS_JOBID") || haskey(ENV, "LSB_JOBID")) && - get(ENV, "JULIA_MPI_CLUSTER_WARN", "") != "n" - @warn """ - You appear to be using MPI.jl with the default MPI binary on a cluster. - We recommend using the system-provided MPI, see the Configuration section of the MPI.jl docs. - """ - end - end - end - -elseif binary == "MPICH_jll" - - @info "using MPICH_jll" - - using MPICH_jll - run(MPICH_jll.generate_compile_time_mpi_constants()) - - deps = quote - using MPICH_jll - const libmpiconstants = MPICH_jll.libload_time_mpi_constants - const _mpiexec = MPICH_jll.mpiexec - const mpiexec_path = MPICH_jll.mpiexec_path - - __init__deps() = nothing - end - -elseif binary == "MPItrampoline_jll" - - @info "using MPItrampoline_jll" - using MPItrampoline_jll - @assert MPItrampoline_jll.is_available() - run(MPItrampoline_jll.generate_compile_time_mpi_constants()) - - deps = quote - @info "using MPItrampoline_jll" - using MPItrampoline_jll - @assert MPItrampoline_jll.is_available() - mpiexec_path = get(ENV, "MPITRAMPOLINE_MPIEXEC", nothing) - if mpiexec_path === nothing - if "MPITRAMPOLINE_LIB" ∉ keys(ENV) - @info "[MPI] Using built-in MPICH with MPItrampoline" - # In principle, MPItrampoline_jll.mpiwrapperexec should - # forward to MPItrampoline_jll.mpich_mpiexec. However, - # there is no mechanism to update the path to where the - # Julia artifact is installed, so we forward manually - # here. - const _mpiexec = MPItrampoline_jll.mpich_mpiexec - mpiexec_path = MPItrampoline_jll.mpich_mpiexec_path - else - const _mpiexec = MPItrampoline_jll.mpiwrapperexec - mpiexec_path = MPItrampoline_jll.mpiwrapperexec_path - end - else - const mpiexec_cmd = Cmd([mpiexec_path]) - _mpiexec(fn) = fn(mpiexec_cmd) - end - const libmpiconstants = MPItrampoline_jll.libload_time_mpi_constants_path - - __init__deps() = nothing - end - -elseif binary == "OpenMPI_jll" - - @info "using OpenMPI_jll" - - using OpenMPI_jll - run(OpenMPI_jll.generate_compile_time_mpi_constants()) - - deps = quote - using OpenMPI_jll - const _mpiexec = OpenMPI_jll.mpiexec - const mpiexec_path = OpenMPI_jll.mpiexec_path - - __init__deps() = nothing - end - -elseif binary == "MicrosoftMPI_jll" - - @info "using MicrosoftMPI_jll" - - using MicrosoftMPI_jll - # run(MicrosoftMPI_jll.generate_compile_time_mpi_constants()) - cp("compile_time_mpi_constants_msmpi_$(Sys.ARCH).jl", "compile_time_mpi_constants.jl"; force=true) - - deps = quote - using MicrosoftMPI_jll - const libmpiconstants = MicrosoftMPI_jll.libload_time_mpi_constants - const _mpiexec = MicrosoftMPI_jll.mpiexec - const mpiexec_path = MicrosoftMPI_jll.mpiexec_path - - __init__deps() = nothing - end - -else - error("Unknown binary $binary") -end - -remove_line_numbers(x) = x -function remove_line_numbers(ex::Expr) - if ex.head == :macrocall - ex.args[2] = nothing - else - ex.args = [remove_line_numbers(arg) for arg in ex.args if !(arg isa LineNumberNode)] - end - return ex -end - -# Only update deps.jl if it has changed. -# This allows users to call Pkg.build("MPI") without triggering another round of precompilation. -deps_str = - """ - # This file has been generated automatically. - # It will be overwritten the next time `Pkg.build("MPI")` is called. - """ * - string(remove_line_numbers(deps)) * - """ - """ - -if !isfile("deps.jl") || deps_str != read("deps.jl", String) - write("deps.jl", deps_str) -end diff --git a/deps/compile_time_mpi_constants_msmpi_i686.jl b/deps/compile_time_mpi_constants_msmpi_i686.jl deleted file mode 100644 index 6b23e10e8..000000000 --- a/deps/compile_time_mpi_constants_msmpi_i686.jl +++ /dev/null @@ -1,73 +0,0 @@ -# This file has been generated automatically by `generate_compile_time_mpi_constants`. -# Do not edit. - -# MPI library version (for reference only; this is not a constant) -const MPI_LIBRARY_VERSION_ = "Microsoft MPI i686" - -# Compile-time constants - -# Version: -# (We add an underscore to avoid a name conflict with `MPI.jl`) -const MPI_VERSION_ = Cint(2) -const MPI_SUBVERSION_ = Cint(0) - -# Implementation limits: -const MPI_MAX_DATAREP_STRING = Cint(128) -const MPI_MAX_ERROR_STRING = Cint(512) -const MPI_MAX_INFO_KEY = Cint(255) -const MPI_MAX_INFO_VAL = Cint(1024) -const MPI_MAX_LIBRARY_VERSION_STRING = Cint(8192) -const MPI_MAX_OBJECT_NAME = Cint(128) -const MPI_MAX_PORT_NAME = Cint(256) -const MPI_MAX_PROCESSOR_NAME = Cint(128) - -# Types - -# Various (signed) integer types: -const MPI_Aint = Int32 -const MPI_Count = Int64 -const MPI_Fint = Int32 -const MPI_Offset = Int64 - -# Status: -struct MPI_Status - private0::Cint - private1::Cint - MPI_SOURCE::Cint - MPI_TAG::Cint - MPI_ERROR::Cint -end - -# Opaque handles: -const MPI_Comm = UInt32 -const MPI_Datatype = UInt32 -const MPI_Errhandler = UInt32 -const MPI_File = UInt32 -const MPI_Group = UInt32 -const MPI_Info = UInt32 -const MPI_Message = UInt32 -const MPI_Op = UInt32 -const MPI_Request = UInt32 -const MPI_Win = UInt32 - -# Function pointers: -const MPI_Comm_copy_attr_function = Ptr{Cvoid} -const MPI_Comm_delete_attr_function = Ptr{Cvoid} -const MPI_Comm_errhandler_function = Ptr{Cvoid} -const MPI_Comm_errhandler_fn = MPI_Comm_errhandler_function -const MPI_Copy_function = MPI_Comm_copy_attr_function -const MPI_Datarep_conversion_function = Ptr{Cvoid} -const MPI_Datarep_extent_function = Ptr{Cvoid} -const MPI_Delete_function = Ptr{Cvoid} -const MPI_File_errhandler_function = Ptr{Cvoid} -const MPI_File_errhandler_fn = Ptr{Cvoid} -const MPI_Grequest_cancel_function = Ptr{Cvoid} -const MPI_Grequest_free_function = Ptr{Cvoid} -const MPI_Grequest_query_function = Ptr{Cvoid} -const MPI_Type_copy_attr_function = Ptr{Cvoid} -const MPI_Type_delete_attr_function = Ptr{Cvoid} -const MPI_User_function = Ptr{Cvoid} -const MPI_Win_copy_attr_function = Ptr{Cvoid} -const MPI_Win_delete_attr_function = Ptr{Cvoid} -const MPI_Win_errhandler_function = Ptr{Cvoid} -const MPI_Win_errhandler_fn = MPI_Win_errhandler_function diff --git a/deps/compile_time_mpi_constants_msmpi_x86_64.jl b/deps/compile_time_mpi_constants_msmpi_x86_64.jl deleted file mode 100644 index b7243fb18..000000000 --- a/deps/compile_time_mpi_constants_msmpi_x86_64.jl +++ /dev/null @@ -1,73 +0,0 @@ -# This file has been generated automatically by `generate_compile_time_mpi_constants`. -# Do not edit. - -# MPI library version (for reference only; this is not a constant) -const MPI_LIBRARY_VERSION_ = "Microsoft MPI x86_64" - -# Compile-time constants - -# Version: -# (We add an underscore to avoid a name conflict with `MPI.jl`) -const MPI_VERSION_ = Cint(2) -const MPI_SUBVERSION_ = Cint(0) - -# Implementation limits: -const MPI_MAX_DATAREP_STRING = Cint(128) -const MPI_MAX_ERROR_STRING = Cint(512) -const MPI_MAX_INFO_KEY = Cint(255) -const MPI_MAX_INFO_VAL = Cint(1024) -const MPI_MAX_LIBRARY_VERSION_STRING = Cint(8192) -const MPI_MAX_OBJECT_NAME = Cint(128) -const MPI_MAX_PORT_NAME = Cint(256) -const MPI_MAX_PROCESSOR_NAME = Cint(128) - -# Types - -# Various (signed) integer types: -const MPI_Aint = Int64 -const MPI_Count = Int64 -const MPI_Fint = Int32 -const MPI_Offset = Int64 - -# Status: -struct MPI_Status - private0::Cint - private1::Cint - MPI_SOURCE::Cint - MPI_TAG::Cint - MPI_ERROR::Cint -end - -# Opaque handles: -const MPI_Comm = UInt32 -const MPI_Datatype = UInt32 -const MPI_Errhandler = UInt32 -const MPI_File = UInt64 -const MPI_Group = UInt32 -const MPI_Info = UInt32 -const MPI_Message = UInt32 -const MPI_Op = UInt32 -const MPI_Request = UInt32 -const MPI_Win = UInt32 - -# Function pointers: -const MPI_Comm_copy_attr_function = Ptr{Cvoid} -const MPI_Comm_delete_attr_function = Ptr{Cvoid} -const MPI_Comm_errhandler_function = Ptr{Cvoid} -const MPI_Comm_errhandler_fn = MPI_Comm_errhandler_function -const MPI_Copy_function = MPI_Comm_copy_attr_function -const MPI_Datarep_conversion_function = Ptr{Cvoid} -const MPI_Datarep_extent_function = Ptr{Cvoid} -const MPI_Delete_function = Ptr{Cvoid} -const MPI_File_errhandler_function = Ptr{Cvoid} -const MPI_File_errhandler_fn = Ptr{Cvoid} -const MPI_Grequest_cancel_function = Ptr{Cvoid} -const MPI_Grequest_free_function = Ptr{Cvoid} -const MPI_Grequest_query_function = Ptr{Cvoid} -const MPI_Type_copy_attr_function = Ptr{Cvoid} -const MPI_Type_delete_attr_function = Ptr{Cvoid} -const MPI_User_function = Ptr{Cvoid} -const MPI_Win_copy_attr_function = Ptr{Cvoid} -const MPI_Win_delete_attr_function = Ptr{Cvoid} -const MPI_Win_errhandler_function = Ptr{Cvoid} -const MPI_Win_errhandler_fn = MPI_Win_errhandler_function diff --git a/deps/prepare_mpi_constants.jl b/deps/prepare_mpi_constants.jl deleted file mode 100644 index 233add43e..000000000 --- a/deps/prepare_mpi_constants.jl +++ /dev/null @@ -1,33 +0,0 @@ -if !Sys.iswindows() - - libdir = dirname(dlpath(libmpi)) - - mpidir = get(ENV, "JULIA_MPI_PATH", joinpath(libdir, "..")) - incdir = get(ENV, "JULIA_INCLUDE_PATH", joinpath(mpidir, "include")) - mpicc = get(ENV, "JULIA_MPICC", joinpath(mpidir, "bin", "mpicc")) - - # `cflags` includes libraries and needs to be listed at the end of the - # compile/link command - if haskey(ENV, "JULIA_MPI_CFLAGS") - cflags = Base.shell_split(ENV["JULIA_MPI_CFLAGS"]) - else - libfilename = basename(libmpi) - libbasename, = splitext(libfilename) - libname = replace(libbasename, r"^lib" => s"") - cflags = `-I$incdir -L$libdir -Wl,-rpath,$libdir -l$libname` - end - - # We expect the subdirectory `MPIconstants-1.4.0` to contain a copy of - # - srcdir = "MPIconstants-1.4.0" - - run(`$mpicc -o generate_compile_time_mpi_constants $(joinpath(srcdir, "generate_compile_time_mpi_constants.c")) $cflags`) - run(`./generate_compile_time_mpi_constants`) - - run(`$mpicc -fPIC -shared -o libload_time_mpi_constants.so $(joinpath(srcdir, "load_time_mpi_constants.c")) $cflags`) - -else - - cp("compile_time_mpi_constants_msmpi_$(Sys.ARCH).jl", "compile_time_mpi_constants.jl"; force=true) - -end diff --git a/docs/src/knownissues.md b/docs/src/knownissues.md index e09c33129..afabf6b08 100644 --- a/docs/src/knownissues.md +++ b/docs/src/knownissues.md @@ -34,6 +34,12 @@ This can be worked around be either: 2. Launching julia with the `--compiled-modules=no` option. This can result in much longer package load times. +## Open MPI + +### Segmentation fault + +When attempting to use a system-provided Open MPI implementation, you may encounter a segmentation fault. This can be fixed by setting the environment variable `ZES_ENABLE_SYSMAN=1`. See [Open MPI issue #10142](https://github.com/open-mpi/ompi/issues/10142). + ## UCX [UCX](https://www.openucx.org/) is a communication framework used by several MPI implementations. diff --git a/lib/MPIPreferences/Project.toml b/lib/MPIPreferences/Project.toml new file mode 100644 index 000000000..5b8dab7b3 --- /dev/null +++ b/lib/MPIPreferences/Project.toml @@ -0,0 +1,12 @@ +name = "MPIPreferences" +uuid = "3da0fdf6-3ccc-4f1b-acd9-58baa6c99267" +authors = [] +version = "0.1.0" + +[deps] +Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" +Preferences = "21216c6a-2e73-6563-6e65-726566657250" + +[compat] +julia = "1.6" +Preferences = "1" diff --git a/lib/MPIPreferences/UNLICENSE b/lib/MPIPreferences/UNLICENSE new file mode 100644 index 000000000..6d9eabbb7 --- /dev/null +++ b/lib/MPIPreferences/UNLICENSE @@ -0,0 +1,25 @@ +This is free and unencumbered software released into the public +domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to diff --git a/lib/MPIPreferences/src/MPIPreferences.jl b/lib/MPIPreferences/src/MPIPreferences.jl new file mode 100644 index 000000000..af60b1af0 --- /dev/null +++ b/lib/MPIPreferences/src/MPIPreferences.jl @@ -0,0 +1,181 @@ +module MPIPreferences + +using Preferences, Libdl + +const binary = @load_preference("binary", Sys.iswindows() ? "MicrosoftMPI_jll" : "MPICH_jll") + +const abi = if binary == "system" + @load_preference("abi") +elseif binary == "MicrosoftMPI_jll" + "MicrosoftMPI" +elseif binary == "MPICH_jll" + "MPICH" +elseif binary == "OpenMPI_jll" + "OpenMPI" +elseif binary == "MPItrampoline_jll" + "MPIwrapper" +else + error("Unknown binary: $binary") +end + +module System + export libmpi, mpiexec + using Preferences + const libmpi = @load_preference("libmpi") + const mpiexec_path = @load_preference("mpiexec") + mpiexec() = `$mpiexec_path` + mpiexec(f) = f(`$mpiexec_path`) +end + +function use_jll_binary(binary = Sys.iswindows() ? "MicrosoftMPI_jll" : "MPICH_jll";export_prefs=false, force=true) + binary in ["MicrosoftMPI_jll", "MPICH_jll", "OpenMPI_jll", "MPItrampoline_jll"] || + error("Unknown jll: $binary") + set_preferences!(MPIPreferences, + "binary" => binary, + "libmpi" => nothing, + "abi" => nothing, + "mpiexec" => nothing; + export_prefs=export_prefs, + force=force + ) +end + +function use_system_binary(; + library_names=["libmpi", "libmpi_ibm", "msmpi", "libmpich", "libmpitrampoline"], + mpiexec="mpiexec", + abi=nothing, + export_prefs=false, + force=true, + ) + + libmpi = find_library(library_names) + if libmpi == "" + error("MPI library could not be found") + end + if isnothing(abi) + abi = identify_abi(libmpi) + end + if mpiexec isa Cmd + mpiexec = collect(mpiexec) + end + set_preferences!(MPIPreferences, + "binary" => "system", + "libmpi" => libmpi, + "abi" => abi, + "mpiexec" => mpiexec, + export_prefs=export_prefs, + force=force + ) +end + + +""" + identify_abi(libmpi) + +Identify the MPI implementation from the library version string +""" +function identify_abi(libmpi) + # 1) query MPI_Get_version + # There is no way to query at runtime what the length of the buffer should be. + # https://github.com/mpi-forum/mpi-issues/issues/159 + # 8192 is the maximum value of MPI_MAX_LIBRARY_VERSION_STRING across known + # implementations. + buf = Array{UInt8}(undef, 8192) + buflen = Ref{Cint}() + dlopen(libmpi) do hdl + ptr = dlsym(hdl, :MPI_Get_library_version) + ccall(ptr, Cint, (Ptr{UInt8}, Ref{Cint}), buf, buflen) + end + + @assert buflen[] < 8192 + resize!(buf, buflen[]) + version_string = String(buf) + + # 2) try to identify the MPI implementation + impl = "unknown" + version = v"0" + + if startswith(version_string, "MPICH") + impl = "MPICH" + # "MPICH Version:\t%s\n" / "MPICH2 Version:\t%s\n" + if (m = match(r"^MPICH2? Version:\t(\d+.\d+(?:.\d+)?\w*)\n", version_string)) !== nothing + version = VersionNumber(m.captures[1]) + end + + elseif startswith(version_string, "Open MPI") + # Open MPI / Spectrum MPI + impl = occursin("IBM Spectrum MPI", version_string) ? "IBMSpectrumMPI" : "OpenMPI" + + if (m = match(r"^Open MPI v(\d+.\d+.\d+\w*)", version_string)) !== nothing + version = VersionNumber(m.captures[1]) + end + + elseif startswith(version_string, "Microsoft MPI") + impl = "MicrosoftMPI" + # "Microsoft MPI %u.%u.%u.%u%S" + # ignore last 2 (build numbers) + if (m = match(r"^Microsoft MPI (\d+.\d+)", version_string)) !== nothing + version = VersionNumber(m.captures[1]) + end + + elseif startswith(version_string, "Intel") + impl = "IntelMPI" + + # "Intel(R) MPI Library 2019 Update 4 for Linux* OS" + if (m = match(r"^Intel\(R\) MPI Library (\d+)(?: Update (\d+))?", version_string)) !== nothing + if m.captures[2] === nothing + version = VersionNumber(m.captures[1]) + else + version = VersionNumber(m.captures[1]*"."*m.captures[2]) + end + end + + elseif startswith(version_string, "MVAPICH2") + impl = "MVAPICH" + # "MVAPICH2 Version :\t%s\n") + if (m = match(r"^MVAPICH2? Version\s*:\t(\S*)\n", version_string)) !== nothing + version = VersionNumber(m.captures[1]) + end + + elseif occursin("CRAY MPICH", version_string) + impl = "CrayMPICH" + # "MPI VERSION : CRAY MPICH version 7.7.10 (ANL base 3.2)\n" + if (m = match(r"CRAY MPICH version (\d+.\d+.\d+)", version_string)) !== nothing + version = VersionNumber(m.captures[1]) + end + elseif startswith(version_string, "FUJITSU MPI") + impl = "FujitsuMPI" + # "FUJITSU MPI Library 4.0.0 (4.0.1fj4.0.0)\0" + if (m = match(r"^FUJITSU MPI Library (\d+.\d+.\d+)", version_string)) !== nothing + version = VersionNumber(m.captures[1]) + end + elseif startswith(version_string, "MPIwrapper") + impl = "MPIwrapper" + # MPIwrapper 2.2.2 + if (m = match(r"^MPIwrapper Version:\t(\d+.\d+.\d+\w*)", version_string)) !== nothing + version = VersionNumber(m.captures[1]) + end + end + # 3) determine the abi from the implementation + version + if (impl == "MPICH" && version >= v"3.1" || + impl == "IntelMPI" && version > v"2014" || + impl == "MVAPICH" && version >= v"2" || + impl == "CrayMPICH" && version >= v"7") + # https://www.mpich.org/abi/ + abi = "MPICH" + elseif impl == "OpenMPI" || impl == "IBMSpectrumMPI" || impl == "FujitsuMPI" + abi = "OpenMPI" + elseif impl == "MicrosoftMPI" + abi = "MicrosoftMPI" + elseif impl == "MPIwrapper" + abi = "MPIwrapper" + else + abi = "unknown" + end + + @info "MPI implementation" libmpi version_string impl version abi + + return abi +end + +end # module diff --git a/src/MPI.jl b/src/MPI.jl index 3c502b26c..ac6bfd8cc 100644 --- a/src/MPI.jl +++ b/src/MPI.jl @@ -33,14 +33,49 @@ function _doc_external(fname) """ end -try - include(joinpath(dirname(@__DIR__), "deps", "deps.jl")) - include(joinpath(dirname(@__DIR__), "deps", "compile_time_mpi_constants.jl")) -catch e - error("MPI.jl not properly configured, please run `Pkg.build(\"MPI\")`.") + +import MPIPreferences + +if MPIPreferences.binary == "MPICH_jll" + import MPICH_jll: libmpi, mpiexec + const libmpiconstants = nothing +elseif MPIPreferences.binary == "OpenMPI_jll" + import OpenMPI_jll: libmpi, mpiexec + const libmpiconstants = nothing +elseif MPIPreferences.binary == "MicrosoftMPI_jll" + import MicrosoftMPI_jll: libmpi, mpiexec + const libmpiconstants = nothing +elseif MPIPreferences.binary == "MPItrampoline_jll" + import MPItrampoline_jll: MPItrampoline_jll, libmpi, mpiexec + const libmpiconstants = MPItrampoline_jll.libload_time_mpi_constants_path +elseif MPIPreferences.binary == "system" + import MPIPreferences.System: libmpi, mpiexec + const libmpiconstants = nothing +else + error("Unknown MPI binary: $(MPIPreferences.binary)") +end + +include("consts/consts.jl") +using .Consts + +# These functions are run after reading the values of the constants above) +const _mpi_load_time_hooks = Any[] +const _finished_loading = Ref(false) +function add_load_time_hook!(f) + @assert !_finished_loading[] + push!(_mpi_load_time_hooks, f) end -include("define_load_time_mpi_constants.jl") -include("read_load_time_mpi_constants.jl") +function run_load_time_hooks() + @assert !_finished_loading[] + _finished_loading[] = true + for hook in _mpi_load_time_hooks + hook() + end + empty!(_mpi_load_time_hooks) + nothing +end + + include("implementations.jl") include("error.jl") include("info.jl") @@ -75,10 +110,6 @@ function __init__() Libdl.dlopen(libmpi, Libdl.RTLD_LAZY | Libdl.RTLD_GLOBAL) end - __init__deps() - - read_load_time_mpi_constants() - # disable UCX memory cache, since it doesn't work correctly # https://github.com/openucx/ucx/issues/5061 if !haskey(ENV, "UCX_MEMTYPE_CACHE") @@ -93,6 +124,12 @@ function __init__() ENV["UCX_ERROR_SIGNALS"] = "SIGILL,SIGBUS,SIGFPE" end + if MPIPreferences.binary == "MPItrampoline_jll" && !haskey(ENV, "MPITRAMPOLINE_MPIEXEC") + ENV["MPITRAMPOLINE_MPIEXEC"] = MPItrampoline_jll.mpich_mpiexec_path + end + + run_load_time_hooks() + @require CUDA="052768ef-5323-5732-b1bb-66c8b64840ba" include("cuda.jl") end diff --git a/src/consts/consts.jl b/src/consts/consts.jl new file mode 100644 index 000000000..bf0570cb4 --- /dev/null +++ b/src/consts/consts.jl @@ -0,0 +1,46 @@ +module Consts + +export MPI_Aint, MPI_Count, MPI_Offset, MPI_Status, + MPI_Comm, MPI_Datatype, MPI_Errhandler, MPI_File, MPI_Group, + MPI_Info, MPI_Message, MPI_Op, MPI_Request, MPI_Win + +import MPIPreferences +import ..libmpi, ..libmpiconstants + +const initexprs = Any[] + +""" + @const_ref name T expr + +Defines an constant binding +```julia +const name = Ref{T}() +``` +and adds a hook to execute +```julia +name[] = expr +``` +at module initialization time. +""" +macro const_ref(name, T, expr) + push!(initexprs, :($name[] = $expr)) + :(const $(esc(name)) = Ref{$T}()) +end + +@static if MPIPreferences.abi == "MPICH" + include("mpich.jl") +elseif MPIPreferences.abi == "OpenMPI" + include("openmpi.jl") +elseif MPIPreferences.abi == "MicrosoftMPI" + include("microsoftmpi.jl") +elseif MPIPreferences.abi == "MPIwrapper" + include("mpiwrapper.jl") +else + error("Unknown MPI ABI $(MPIPreferences.abi)") +end + +@eval function __init__() + $(Expr(:block, initexprs...)) +end + +end diff --git a/src/consts/microsoftmpi.jl b/src/consts/microsoftmpi.jl new file mode 100644 index 000000000..7245a5f64 --- /dev/null +++ b/src/consts/microsoftmpi.jl @@ -0,0 +1,334 @@ +# Compile-time constants + +# Implementation limits: +const MPI_MAX_DATAREP_STRING = Cint(128) +const MPI_MAX_ERROR_STRING = Cint(512) +const MPI_MAX_INFO_KEY = Cint(255) +const MPI_MAX_INFO_VAL = Cint(1024) +const MPI_MAX_LIBRARY_VERSION_STRING = Cint(8192) +const MPI_MAX_OBJECT_NAME = Cint(128) +const MPI_MAX_PORT_NAME = Cint(256) +const MPI_MAX_PROCESSOR_NAME = Cint(128) + +# Types + +# Various (signed) integer types: +const MPI_Aint = Int +const MPI_Fint = Int32 +const MPI_Count = Int64 +const MPI_Offset = Int64 + +# Status: +struct MPI_Status + _private0::Cint + _private1::Cint + MPI_SOURCE::Cint + MPI_TAG::Cint + MPI_ERROR::Cint +end + +# Opaque handles: +const MPI_Comm = UInt32 +const MPI_Datatype = UInt32 +const MPI_Errhandler = UInt32 +const MPI_File = UInt +const MPI_Group = UInt32 +const MPI_Info = UInt32 +const MPI_Message = UInt32 +const MPI_Op = UInt32 +const MPI_Request = UInt32 +const MPI_Win = UInt32 + +# Function pointers: +const MPI_Comm_copy_attr_function = Ptr{Cvoid} +const MPI_Comm_delete_attr_function = Ptr{Cvoid} +const MPI_Comm_errhandler_function = Ptr{Cvoid} +const MPI_Comm_errhandler_fn = MPI_Comm_errhandler_function +const MPI_Copy_function = MPI_Comm_copy_attr_function +const MPI_Datarep_conversion_function = Ptr{Cvoid} +const MPI_Datarep_extent_function = Ptr{Cvoid} +const MPI_Delete_function = Ptr{Cvoid} +const MPI_File_errhandler_function = Ptr{Cvoid} +const MPI_File_errhandler_fn = Ptr{Cvoid} +const MPI_Grequest_cancel_function = Ptr{Cvoid} +const MPI_Grequest_free_function = Ptr{Cvoid} +const MPI_Grequest_query_function = Ptr{Cvoid} +const MPI_Type_copy_attr_function = Ptr{Cvoid} +const MPI_Type_delete_attr_function = Ptr{Cvoid} +const MPI_User_function = Ptr{Cvoid} +const MPI_Win_copy_attr_function = Ptr{Cvoid} +const MPI_Win_delete_attr_function = Ptr{Cvoid} +const MPI_Win_errhandler_function = Ptr{Cvoid} +const MPI_Win_errhandler_fn = MPI_Win_errhandler_function + + +# Run-time constants + +@const_ref MPI_ANY_SOURCE Cint -2 +@const_ref MPI_ANY_TAG Cint -1 +@const_ref MPI_PROC_NULL Cint -1 +@const_ref MPI_ROOT Cint -3 + +@const_ref MPI_GRAPH Cint 1 +@const_ref MPI_CART Cint 2 +@const_ref MPI_DIST_GRAPH Cint 3 + +@const_ref MPI_IDENT Cint 0 +@const_ref MPI_CONGRUENT Cint 1 +@const_ref MPI_SIMILAR Cint 2 +@const_ref MPI_UNEQUAL Cint 3 + +@const_ref MPI_KEYVAL_INVALID Cint 0x24000000 +@const_ref MPI_UNDEFINED Cint -32766 + +@const_ref MPI_TAG_UB Cint 0x64400001 +@const_ref MPI_HOST Cint 0x64400003 +@const_ref MPI_IO Cint 0x64400005 +@const_ref MPI_WTIME_IS_GLOBAL Cint 0x64400007 +@const_ref MPI_UNIVERSE_SIZE Cint 0x64400009 +@const_ref MPI_LASTUSEDCODE Cint 0x6440000b +@const_ref MPI_APPNUM Cint 0x6440000d + +@const_ref MPI_WIN_BASE Cint 0x66000001 +@const_ref MPI_WIN_SIZE Cint 0x66000003 +@const_ref MPI_WIN_DISP_UNIT Cint 0x66000005 +@const_ref MPI_WIN_CREATE_FLAVOR Cint 0x66000007 +@const_ref MPI_WIN_MODEL Cint 0x66000009 + +@const_ref MPI_COMBINER_NAMED Cint 1 +@const_ref MPI_COMBINER_DUP Cint 2 +@const_ref MPI_COMBINER_CONTIGUOUS Cint 3 +@const_ref MPI_COMBINER_VECTOR Cint 4 +@const_ref MPI_COMBINER_HVECTOR_INTEGER Cint 5 +@const_ref MPI_COMBINER_HVECTOR Cint 6 +@const_ref MPI_COMBINER_INDEXED Cint 7 +@const_ref MPI_COMBINER_HINDEXED_INTEGER Cint 8 +@const_ref MPI_COMBINER_HINDEXED Cint 9 +@const_ref MPI_COMBINER_INDEXED_BLOCK Cint 10 +@const_ref MPI_COMBINER_STRUCT_INTEGER Cint 11 +@const_ref MPI_COMBINER_STRUCT Cint 12 +@const_ref MPI_COMBINER_SUBARRAY Cint 13 +@const_ref MPI_COMBINER_DARRAY Cint 14 +@const_ref MPI_COMBINER_F90_REAL Cint 15 +@const_ref MPI_COMBINER_F90_COMPLEX Cint 16 +@const_ref MPI_COMBINER_F90_INTEGER Cint 17 +@const_ref MPI_COMBINER_RESIZED Cint 18 +@const_ref MPI_COMBINER_HINDEXED_BLOCK Cint 19 + +@const_ref MPI_COMM_TYPE_SHARED Cint 1 + +@const_ref MPI_DISTRIBUTE_BLOCK Cint 121 +@const_ref MPI_DISTRIBUTE_CYCLIC Cint 122 +@const_ref MPI_DISTRIBUTE_NONE Cint 123 + +@const_ref MPI_SUCCESS Cint 0 +@const_ref MPI_ERR_BUFFER Cint 1 +@const_ref MPI_ERR_COUNT Cint 2 +@const_ref MPI_ERR_TYPE Cint 3 +@const_ref MPI_ERR_TAG Cint 4 +@const_ref MPI_ERR_COMM Cint 5 +@const_ref MPI_ERR_RANK Cint 6 +@const_ref MPI_ERR_ROOT Cint 7 +@const_ref MPI_ERR_TRUNCATE Cint 14 +@const_ref MPI_ERR_GROUP Cint 8 +@const_ref MPI_ERR_OP Cint 9 +@const_ref MPI_ERR_REQUEST Cint 19 +@const_ref MPI_ERR_TOPOLOGY Cint 10 +@const_ref MPI_ERR_DIMS Cint 11 +@const_ref MPI_ERR_ARG Cint 12 +@const_ref MPI_ERR_OTHER Cint 15 +@const_ref MPI_ERR_UNKNOWN Cint 13 +@const_ref MPI_ERR_INTERN Cint 16 +@const_ref MPI_ERR_IN_STATUS Cint 17 +@const_ref MPI_ERR_PENDING Cint 18 +@const_ref MPI_ERR_ACCESS Cint 20 +@const_ref MPI_ERR_AMODE Cint 21 +@const_ref MPI_ERR_BAD_FILE Cint 22 +@const_ref MPI_ERR_CONVERSION Cint 23 +@const_ref MPI_ERR_DUP_DATAREP Cint 24 +@const_ref MPI_ERR_FILE_EXISTS Cint 25 +@const_ref MPI_ERR_FILE_IN_USE Cint 26 +@const_ref MPI_ERR_FILE Cint 27 +@const_ref MPI_ERR_IO Cint 32 +@const_ref MPI_ERR_NO_SPACE Cint 36 +@const_ref MPI_ERR_NO_SUCH_FILE Cint 37 +@const_ref MPI_ERR_READ_ONLY Cint 40 +@const_ref MPI_ERR_UNSUPPORTED_DATAREP Cint 43 +@const_ref MPI_ERR_INFO Cint 28 +@const_ref MPI_ERR_INFO_KEY Cint 29 +@const_ref MPI_ERR_INFO_VALUE Cint 30 +@const_ref MPI_ERR_INFO_NOKEY Cint 31 +@const_ref MPI_ERR_NAME Cint 33 +@const_ref MPI_ERR_NO_MEM Cint 34 +@const_ref MPI_ERR_NOT_SAME Cint 35 +@const_ref MPI_ERR_PORT Cint 38 +@const_ref MPI_ERR_QUOTA Cint 39 +@const_ref MPI_ERR_SERVICE Cint 41 +@const_ref MPI_ERR_SPAWN Cint 42 +@const_ref MPI_ERR_UNSUPPORTED_OPERATION Cint 44 +@const_ref MPI_ERR_WIN Cint 45 +@const_ref MPI_ERR_BASE Cint 46 +@const_ref MPI_ERR_LOCKTYPE Cint 47 +@const_ref MPI_ERR_KEYVAL Cint 48 +@const_ref MPI_ERR_RMA_CONFLICT Cint 49 +@const_ref MPI_ERR_RMA_SYNC Cint 50 +@const_ref MPI_ERR_SIZE Cint 51 +@const_ref MPI_ERR_DISP Cint 52 +@const_ref MPI_ERR_ASSERT Cint 53 + + +@const_ref MPI_LOCK_EXCLUSIVE Cint 234 +@const_ref MPI_LOCK_SHARED Cint 235 + + +@const_ref MPI_MODE_CREATE Cint 0x00000001 +@const_ref MPI_MODE_RDONLY Cint 0x00000002 +@const_ref MPI_MODE_WRONLY Cint 0x00000004 +@const_ref MPI_MODE_RDWR Cint 0x00000008 +@const_ref MPI_MODE_DELETE_ON_CLOSE Cint 0x00000010 +@const_ref MPI_MODE_UNIQUE_OPEN Cint 0x00000020 +@const_ref MPI_MODE_EXCL Cint 0x00000040 +@const_ref MPI_MODE_APPEND Cint 0x00000080 +@const_ref MPI_MODE_SEQUENTIAL Cint 0x00000100 + + +@const_ref MPI_MODE_NOCHECK Cint 1024 +@const_ref MPI_MODE_NOSTORE Cint 2048 +@const_ref MPI_MODE_NOPUT Cint 4096 +@const_ref MPI_MODE_NOPRECEDE Cint 8192 +@const_ref MPI_MODE_NOSUCCEED Cint 16384 + +@const_ref MPI_ORDER_C Cint 56 +@const_ref MPI_ORDER_FORTRAN Cint 57 + + +@const_ref MPI_SEEK_SET Cint 600 +@const_ref MPI_SEEK_CUR Cint 602 +@const_ref MPI_SEEK_END Cint 604 + +@const_ref MPI_THREAD_SINGLE Cint 0 +@const_ref MPI_THREAD_FUNNELED Cint 1 +@const_ref MPI_THREAD_SERIALIZED Cint 2 +@const_ref MPI_THREAD_MULTIPLE Cint 3 + +@const_ref MPI_TYPECLASS_REAL Cint 1 +@const_ref MPI_TYPECLASS_INTEGER Cint 2 +@const_ref MPI_TYPECLASS_COMPLEX Cint 3 + +@const_ref MPI_ARGV_NULL Ptr{Cvoid} C_NULL +@const_ref MPI_ARGVS_NULL Ptr{Cvoid} C_NULL + +@const_ref MPI_UNWEIGHTED Ptr{Cvoid} 1 +@const_ref MPI_WEIGHTS_EMPTY Ptr{Cvoid} 2 +@const_ref MPI_BOTTOM Ptr{Cvoid} 0 +@const_ref MPI_IN_PLACE Ptr{Cvoid} -1 + +@const_ref MPI_COMM_NULL MPI_Comm 0x04000000 +@const_ref MPI_COMM_SELF MPI_Comm 0x44000001 +@const_ref MPI_COMM_WORLD MPI_Comm 0x44000000 + +@const_ref MPI_COMM_DUP_FN MPI_Comm_copy_attr_function cglobal((:MPIR_Dup_fn, libmpi), MPI_Comm_copy_attr_function) +@const_ref MPI_COMM_NULL_COPY_FN MPI_Comm_copy_attr_function C_NULL +@const_ref MPI_COMM_NULL_DELETE_FN MPI_Comm_delete_attr_function C_NULL + +@const_ref MPI_DATATYPE_NULL MPI_Datatype 0x0c000000 + +# Only define C constants, as we don't need the Fortran or C++ ones (and Fortran ones are compiler-dependent). + +@const_ref MPI_CHAR MPI_Datatype 0x4c000101 +@const_ref MPI_UNSIGNED_CHAR MPI_Datatype 0x4c000102 +@const_ref MPI_SHORT MPI_Datatype 0x4c000203 +@const_ref MPI_UNSIGNED_SHORT MPI_Datatype 0x4c000204 +@const_ref MPI_INT MPI_Datatype 0x4c000405 +@const_ref MPI_UNSIGNED MPI_Datatype 0x4c000406 +@const_ref MPI_LONG MPI_Datatype 0x4c000407 +@const_ref MPI_UNSIGNED_LONG MPI_Datatype 0x4c000408 +@const_ref MPI_LONG_LONG_INT MPI_Datatype 0x4c000809 +const MPI_LONG_LONG = MPI_LONG_LONG_INT +@const_ref MPI_FLOAT MPI_Datatype 0x4c00040a +@const_ref MPI_DOUBLE MPI_Datatype 0x4c00080b +@const_ref MPI_LONG_DOUBLE MPI_Datatype 0x4c00080c +@const_ref MPI_BYTE MPI_Datatype 0x4c00010d +@const_ref MPI_WCHAR MPI_Datatype 0x4c00020e + +@const_ref MPI_PACKED MPI_Datatype 0x4c00010f +@const_ref MPI_LB MPI_Datatype 0x4c000010 +@const_ref MPI_UB MPI_Datatype 0x4c000011 + +@const_ref MPI_C_COMPLEX MPI_Datatype 0x4c000812 +@const_ref MPI_C_FLOAT_COMPLEX MPI_Datatype 0x4c000813 +@const_ref MPI_C_DOUBLE_COMPLEX MPI_Datatype 0x4c001014 +@const_ref MPI_C_LONG_DOUBLE_COMPLEX MPI_Datatype 0x4c001015 + +@const_ref MPI_2INT MPI_Datatype 0x4c000816 +@const_ref MPI_C_BOOL MPI_Datatype 0x4c000117 +@const_ref MPI_SIGNED_CHAR MPI_Datatype 0x4c000118 +@const_ref MPI_UNSIGNED_LONG_LONG MPI_Datatype 0x4c000819 + +@const_ref MPI_INT8_T MPI_Datatype 0x4c000133 +@const_ref MPI_INT16_T MPI_Datatype 0x4c000234 +@const_ref MPI_INT32_T MPI_Datatype 0x4c000435 +@const_ref MPI_INT64_T MPI_Datatype 0x4c000836 +@const_ref MPI_UINT8_T MPI_Datatype 0x4c000137 +@const_ref MPI_UINT16_T MPI_Datatype 0x4c000238 +@const_ref MPI_UINT32_T MPI_Datatype 0x4c000439 +@const_ref MPI_UINT64_T MPI_Datatype 0x4c00083a + +@const_ref MPI_AINT MPI_Datatype MPI_Aint == Int64 ? 0x4c00083b : 0x4c00043b +@const_ref MPI_OFFSET MPI_Datatype 0x4c00083c +@const_ref MPI_COUNT MPI_Datatype 0x4c00083d + +@const_ref MPI_FLOAT_INT MPI_Datatype 0x8c000000 +@const_ref MPI_DOUBLE_INT MPI_Datatype 0x8c000001 +@const_ref MPI_LONG_INT MPI_Datatype 0x8c000002 +@const_ref MPI_SHORT_INT MPI_Datatype 0x8c000003 +@const_ref MPI_LONG_DOUBLE_INT MPI_Datatype 0x8c000004 + +@const_ref MPI_ERRHANDLER_NULL MPI_Errhandler 0x14000000 +@const_ref MPI_ERRORS_ARE_FATAL MPI_Errhandler 0x54000000 +@const_ref MPI_ERRORS_RETURN MPI_Errhandler 0x54000001 +#@const_ref MPI_ERRORS_ABORT MPI_Errhandler 0x54000003 + +@const_ref MPI_FILE_NULL MPI_File 0 + +@const_ref MPI_GROUP_EMPTY MPI_Group 0x48000000 +@const_ref MPI_GROUP_NULL MPI_Group 0x08000000 + +# @const_ref MPI_INFO_ENV MPI_Info 0x5c00000 +@const_ref MPI_INFO_NULL MPI_Info 0x1c000000 + +@const_ref MPI_MESSAGE_NULL MPI_Message 0x30000000 +@const_ref MPI_MESSAGE_NO_PROC MPI_Message 0x70000000 + +@const_ref MPI_DISPLACEMENT_CURRENT MPI_Offset -54278278 + +@const_ref MPI_OP_NULL MPI_Op 0x18000000 +@const_ref MPI_MAX MPI_Op 0x58000001 +@const_ref MPI_MIN MPI_Op 0x58000002 +@const_ref MPI_SUM MPI_Op 0x58000003 +@const_ref MPI_PROD MPI_Op 0x58000004 +@const_ref MPI_LAND MPI_Op 0x58000005 +@const_ref MPI_BAND MPI_Op 0x58000006 +@const_ref MPI_LOR MPI_Op 0x58000007 +@const_ref MPI_BOR MPI_Op 0x58000008 +@const_ref MPI_LXOR MPI_Op 0x58000009 +@const_ref MPI_BXOR MPI_Op 0x5800000a +@const_ref MPI_MINLOC MPI_Op 0x5800000b +@const_ref MPI_MAXLOC MPI_Op 0x5800000c +@const_ref MPI_REPLACE MPI_Op 0x5800000d +@const_ref MPI_NO_OP MPI_Op 0x5800000e + +@const_ref MPI_REQUEST_NULL MPI_Request 0x2c000000 + +@const_ref MPI_STATUS_IGNORE Ptr{Cvoid} 1 +@const_ref MPI_STATUSES_IGNORE Ptr{Cvoid} 1 + +@const_ref MPI_TYPE_DUP_FN MPI_Comm_copy_attr_function cglobal((:MPIR_Dup_fn, libmpi), MPI_Comm_copy_attr_function) +@const_ref MPI_TYPE_NULL_COPY_FN MPI_Type_copy_attr_function C_NULL +@const_ref MPI_TYPE_NULL_DELETE_FN MPI_Type_delete_attr_function C_NULL + +@const_ref MPI_WIN_NULL MPI_Win 0x20000000 + +@const_ref MPI_WIN_DUP_FN MPI_Win_copy_attr_function cglobal((:MPIR_Dup_fn, libmpi), MPI_Win_copy_attr_function) +@const_ref MPI_WIN_NULL_COPY_FN MPI_Win_copy_attr_function C_NULL +@const_ref MPI_WIN_NULL_DELETE_FN MPI_Win_delete_attr_function C_NULL diff --git a/src/consts/mpich.jl b/src/consts/mpich.jl new file mode 100644 index 000000000..7778580a8 --- /dev/null +++ b/src/consts/mpich.jl @@ -0,0 +1,341 @@ +# Compile-time constants +# logic derived from +# https://github.com/pmodels/mpich/blob/main/configure.ac +# https://github.com/pmodels/mpich/blob/main/src/include/mpi.h.in +# https://github.com/pmodels/mpich/blob/main/src/mpi/romio/include/mpio.h.in + +# Implementation limits: +const MPI_MAX_DATAREP_STRING = Cint(128) +const MPI_MAX_ERROR_STRING = Cint(512) +const MPI_MAX_INFO_KEY = Cint(255) +const MPI_MAX_INFO_VAL = Cint(1024) +const MPI_MAX_LIBRARY_VERSION_STRING = Cint(8192) +const MPI_MAX_OBJECT_NAME = Cint(128) +const MPI_MAX_PORT_NAME = Cint(256) +const MPI_MAX_PROCESSOR_NAME = Cint(128) + +# Types + +# Various (signed) integer types: +const MPI_Aint = Int +const MPI_Fint = Int32 +const MPI_Count = Int64 +const MPI_Offset = Int64 + +# Status: +struct MPI_Status + _private0::Cint + _private1::Cint + MPI_SOURCE::Cint + MPI_TAG::Cint + MPI_ERROR::Cint +end + +# Opaque handles: +const MPI_Comm = UInt32 +const MPI_Datatype = UInt32 +const MPI_Errhandler = UInt32 +const MPI_File = Ptr{Cvoid} +const MPI_Group = UInt32 +const MPI_Info = UInt32 +const MPI_Message = UInt32 +const MPI_Op = UInt32 +const MPI_Request = UInt32 +const MPI_Win = UInt32 + +# Function pointers: +const MPI_Comm_copy_attr_function = Ptr{Cvoid} +const MPI_Comm_delete_attr_function = Ptr{Cvoid} +const MPI_Comm_errhandler_function = Ptr{Cvoid} +const MPI_Comm_errhandler_fn = MPI_Comm_errhandler_function +const MPI_Copy_function = MPI_Comm_copy_attr_function +const MPI_Datarep_conversion_function = Ptr{Cvoid} +const MPI_Datarep_extent_function = Ptr{Cvoid} +const MPI_Delete_function = Ptr{Cvoid} +const MPI_File_errhandler_function = Ptr{Cvoid} +const MPI_File_errhandler_fn = Ptr{Cvoid} +const MPI_Grequest_cancel_function = Ptr{Cvoid} +const MPI_Grequest_free_function = Ptr{Cvoid} +const MPI_Grequest_query_function = Ptr{Cvoid} +const MPI_Type_copy_attr_function = Ptr{Cvoid} +const MPI_Type_delete_attr_function = Ptr{Cvoid} +const MPI_User_function = Ptr{Cvoid} +const MPI_Win_copy_attr_function = Ptr{Cvoid} +const MPI_Win_delete_attr_function = Ptr{Cvoid} +const MPI_Win_errhandler_function = Ptr{Cvoid} +const MPI_Win_errhandler_fn = MPI_Win_errhandler_function + +# Run-time constants + +@const_ref MPI_ANY_SOURCE Cint -2 +@const_ref MPI_ANY_TAG Cint -1 +@const_ref MPI_PROC_NULL Cint -1 +@const_ref MPI_ROOT Cint -3 + +@const_ref MPI_GRAPH Cint 1 +@const_ref MPI_CART Cint 2 +@const_ref MPI_DIST_GRAPH Cint 3 + +@const_ref MPI_IDENT Cint 0 +@const_ref MPI_CONGRUENT Cint 1 +@const_ref MPI_SIMILAR Cint 2 +@const_ref MPI_UNEQUAL Cint 3 + +@const_ref MPI_KEYVAL_INVALID Cint 0x24000000 +@const_ref MPI_UNDEFINED Cint -32766 + +@const_ref MPI_TAG_UB Cint 0x64400001 +@const_ref MPI_HOST Cint 0x64400003 +@const_ref MPI_IO Cint 0x64400005 +@const_ref MPI_WTIME_IS_GLOBAL Cint 0x64400007 +@const_ref MPI_UNIVERSE_SIZE Cint 0x64400009 +@const_ref MPI_LASTUSEDCODE Cint 0x6440000b +@const_ref MPI_APPNUM Cint 0x6440000d + +@const_ref MPI_WIN_BASE Cint 0x66000001 +@const_ref MPI_WIN_SIZE Cint 0x66000003 +@const_ref MPI_WIN_DISP_UNIT Cint 0x66000005 +@const_ref MPI_WIN_CREATE_FLAVOR Cint 0x66000007 +@const_ref MPI_WIN_MODEL Cint 0x66000009 + +@const_ref MPI_COMBINER_NAMED Cint 1 +@const_ref MPI_COMBINER_DUP Cint 2 +@const_ref MPI_COMBINER_CONTIGUOUS Cint 3 +@const_ref MPI_COMBINER_VECTOR Cint 4 +@const_ref MPI_COMBINER_HVECTOR_INTEGER Cint 5 +@const_ref MPI_COMBINER_HVECTOR Cint 6 +@const_ref MPI_COMBINER_INDEXED Cint 7 +@const_ref MPI_COMBINER_HINDEXED_INTEGER Cint 8 +@const_ref MPI_COMBINER_HINDEXED Cint 9 +@const_ref MPI_COMBINER_INDEXED_BLOCK Cint 10 +@const_ref MPI_COMBINER_STRUCT_INTEGER Cint 11 +@const_ref MPI_COMBINER_STRUCT Cint 12 +@const_ref MPI_COMBINER_SUBARRAY Cint 13 +@const_ref MPI_COMBINER_DARRAY Cint 14 +@const_ref MPI_COMBINER_F90_REAL Cint 15 +@const_ref MPI_COMBINER_F90_COMPLEX Cint 16 +@const_ref MPI_COMBINER_F90_INTEGER Cint 17 +@const_ref MPI_COMBINER_RESIZED Cint 18 +@const_ref MPI_COMBINER_HINDEXED_BLOCK Cint 19 + +@const_ref MPI_COMM_TYPE_SHARED Cint 1 + +@const_ref MPI_DISTRIBUTE_BLOCK Cint 121 +@const_ref MPI_DISTRIBUTE_CYCLIC Cint 122 +@const_ref MPI_DISTRIBUTE_NONE Cint 123 + +@const_ref MPI_SUCCESS Cint 0 +@const_ref MPI_ERR_BUFFER Cint 1 +@const_ref MPI_ERR_COUNT Cint 2 +@const_ref MPI_ERR_TYPE Cint 3 +@const_ref MPI_ERR_TAG Cint 4 +@const_ref MPI_ERR_COMM Cint 5 +@const_ref MPI_ERR_RANK Cint 6 +@const_ref MPI_ERR_ROOT Cint 7 +@const_ref MPI_ERR_TRUNCATE Cint 14 +@const_ref MPI_ERR_GROUP Cint 8 +@const_ref MPI_ERR_OP Cint 9 +@const_ref MPI_ERR_REQUEST Cint 19 +@const_ref MPI_ERR_TOPOLOGY Cint 10 +@const_ref MPI_ERR_DIMS Cint 11 +@const_ref MPI_ERR_ARG Cint 12 +@const_ref MPI_ERR_OTHER Cint 15 +@const_ref MPI_ERR_UNKNOWN Cint 13 +@const_ref MPI_ERR_INTERN Cint 16 +@const_ref MPI_ERR_IN_STATUS Cint 17 +@const_ref MPI_ERR_PENDING Cint 18 +@const_ref MPI_ERR_ACCESS Cint 20 +@const_ref MPI_ERR_AMODE Cint 21 +@const_ref MPI_ERR_BAD_FILE Cint 22 +@const_ref MPI_ERR_CONVERSION Cint 23 +@const_ref MPI_ERR_DUP_DATAREP Cint 24 +@const_ref MPI_ERR_FILE_EXISTS Cint 25 +@const_ref MPI_ERR_FILE_IN_USE Cint 26 +@const_ref MPI_ERR_FILE Cint 27 +@const_ref MPI_ERR_IO Cint 32 +@const_ref MPI_ERR_NO_SPACE Cint 36 +@const_ref MPI_ERR_NO_SUCH_FILE Cint 37 +@const_ref MPI_ERR_READ_ONLY Cint 40 +@const_ref MPI_ERR_UNSUPPORTED_DATAREP Cint 43 +@const_ref MPI_ERR_INFO Cint 28 +@const_ref MPI_ERR_INFO_KEY Cint 29 +@const_ref MPI_ERR_INFO_VALUE Cint 30 +@const_ref MPI_ERR_INFO_NOKEY Cint 31 +@const_ref MPI_ERR_NAME Cint 33 +@const_ref MPI_ERR_NO_MEM Cint 34 +@const_ref MPI_ERR_NOT_SAME Cint 35 +@const_ref MPI_ERR_PORT Cint 38 +@const_ref MPI_ERR_QUOTA Cint 39 +@const_ref MPI_ERR_SERVICE Cint 41 +@const_ref MPI_ERR_SPAWN Cint 42 +@const_ref MPI_ERR_UNSUPPORTED_OPERATION Cint 44 +@const_ref MPI_ERR_WIN Cint 45 +@const_ref MPI_ERR_BASE Cint 46 +@const_ref MPI_ERR_LOCKTYPE Cint 47 +@const_ref MPI_ERR_KEYVAL Cint 48 +@const_ref MPI_ERR_RMA_CONFLICT Cint 49 +@const_ref MPI_ERR_RMA_SYNC Cint 50 +@const_ref MPI_ERR_SIZE Cint 51 +@const_ref MPI_ERR_DISP Cint 52 +@const_ref MPI_ERR_ASSERT Cint 53 +@const_ref MPI_ERR_RMA_RANGE Cint 55 +@const_ref MPI_ERR_RMA_ATTACH Cint 56 +@const_ref MPI_ERR_RMA_SHARED Cint 57 +@const_ref MPI_ERR_RMA_FLAVOR Cint 58 + + +@const_ref MPI_LOCK_EXCLUSIVE Cint 234 +@const_ref MPI_LOCK_SHARED Cint 235 + + +@const_ref MPI_MODE_RDONLY Cint 2 +@const_ref MPI_MODE_RDWR Cint 8 +@const_ref MPI_MODE_WRONLY Cint 4 +@const_ref MPI_MODE_CREATE Cint 1 +@const_ref MPI_MODE_EXCL Cint 64 +@const_ref MPI_MODE_DELETE_ON_CLOSE Cint 16 +@const_ref MPI_MODE_UNIQUE_OPEN Cint 32 +@const_ref MPI_MODE_APPEND Cint 128 +@const_ref MPI_MODE_SEQUENTIAL Cint 256 + +@const_ref MPI_MODE_NOCHECK Cint 1024 +@const_ref MPI_MODE_NOSTORE Cint 2048 +@const_ref MPI_MODE_NOPUT Cint 4096 +@const_ref MPI_MODE_NOPRECEDE Cint 8192 +@const_ref MPI_MODE_NOSUCCEED Cint 16384 + +@const_ref MPI_ORDER_C Cint 56 +@const_ref MPI_ORDER_FORTRAN Cint 57 + + +@const_ref MPI_SEEK_SET Cint 600 +@const_ref MPI_SEEK_CUR Cint 602 +@const_ref MPI_SEEK_END Cint 604 + +@const_ref MPI_THREAD_SINGLE Cint 0 +@const_ref MPI_THREAD_FUNNELED Cint 1 +@const_ref MPI_THREAD_SERIALIZED Cint 2 +@const_ref MPI_THREAD_MULTIPLE Cint 3 + +@const_ref MPI_TYPECLASS_REAL Cint 1 +@const_ref MPI_TYPECLASS_INTEGER Cint 2 +@const_ref MPI_TYPECLASS_COMPLEX Cint 3 + +@const_ref MPI_ARGV_NULL Ptr{Cvoid} C_NULL +@const_ref MPI_ARGVS_NULL Ptr{Cvoid} C_NULL + +@const_ref MPI_UNWEIGHTED Ptr{Cvoid} cglobal((:MPI_UNWEIGHTED, libmpi), Ptr{Cvoid}) +@const_ref MPI_WEIGHTS_EMPTY Ptr{Cvoid} cglobal((:MPI_WEIGHTS_EMPTY, libmpi), Ptr{Cvoid}) +@const_ref MPI_BOTTOM Ptr{Cvoid} C_NULL +@const_ref MPI_IN_PLACE Ptr{Cvoid} -1 + +@const_ref MPI_COMM_NULL MPI_Comm 0x04000000 +@const_ref MPI_COMM_SELF MPI_Comm 0x44000001 +@const_ref MPI_COMM_WORLD MPI_Comm 0x44000000 + +@const_ref MPI_COMM_DUP_FN MPI_Comm_copy_attr_function cglobal((:MPIR_Dup_fn, libmpi), MPI_Comm_copy_attr_function) +@const_ref MPI_COMM_NULL_COPY_FN MPI_Comm_copy_attr_function C_NULL +@const_ref MPI_COMM_NULL_DELETE_FN MPI_Comm_delete_attr_function C_NULL + +@const_ref MPI_DATATYPE_NULL MPI_Datatype 0x0c000000 + +# Only define C constants, as we don't need the Fortran or C++ ones (and Fortran ones are compiler-dependent). +@const_ref MPI_CHAR MPI_Datatype 0x4c000001 + 0x100 * sizeof(Cchar) +@const_ref MPI_UNSIGNED_CHAR MPI_Datatype 0x4c000002 + 0x100 * sizeof(Cuchar) +@const_ref MPI_SHORT MPI_Datatype 0x4c000003 + 0x100 * sizeof(Cshort) +@const_ref MPI_UNSIGNED_SHORT MPI_Datatype 0x4c000004 + 0x100 * sizeof(Cushort) +@const_ref MPI_INT MPI_Datatype 0x4c000005 + 0x100 * sizeof(Cint) +@const_ref MPI_UNSIGNED MPI_Datatype 0x4c000006 + 0x100 * sizeof(Cuint) +@const_ref MPI_LONG MPI_Datatype 0x4c000007 + 0x100 * sizeof(Clong) +@const_ref MPI_UNSIGNED_LONG MPI_Datatype 0x4c000008 + 0x100 * sizeof(Culong) +@const_ref MPI_LONG_LONG_INT MPI_Datatype 0x4c000009 + 0x100 * sizeof(Clonglong) +@const_ref MPI_FLOAT MPI_Datatype 0x4c00000a + 0x100 * sizeof(Cfloat) +@const_ref MPI_DOUBLE MPI_Datatype 0x4c00000b + 0x100 * sizeof(Cdouble) +# @const_ref MPI_LONG_DOUBLE MPI_Datatype 0x4c00000c + 0x100 * sizeof(Clongdouble) +@const_ref MPI_BYTE MPI_Datatype 0x4c00000d + 0x100 * 1 +@const_ref MPI_WCHAR MPI_Datatype 0x4c00000e + 0x100 * sizeof(Cwchar_t) +@const_ref MPI_PACKED MPI_Datatype 0x4c00000f + 0x100 * 1 + +@const_ref MPI_LB MPI_Datatype 0x4c000010 +@const_ref MPI_UB MPI_Datatype 0x4c000011 + +@const_ref MPI_FLOAT_INT MPI_Datatype 0x8c000000 +@const_ref MPI_DOUBLE_INT MPI_Datatype 0x8c000001 +@const_ref MPI_LONG_INT MPI_Datatype 0x8c000002 +@const_ref MPI_SHORT_INT MPI_Datatype 0x8c000003 +@const_ref MPI_LONG_DOUBLE_INT MPI_Datatype 0x8c000004 + +@const_ref MPI_2INT MPI_Datatype 0x4c000016 + +@const_ref MPI_SIGNED_CHAR MPI_Datatype 0x4c000018 + 0x100 * sizeof(Cchar) +@const_ref MPI_UNSIGNED_LONG_LONG MPI_Datatype 0x4c000019 + 0x100 * sizeof(Culonglong) + +@const_ref MPI_INT8_T MPI_Datatype 0x4c000037 + 0x100 * sizeof(Int8) +@const_ref MPI_INT16_T MPI_Datatype 0x4c000038 + 0x100 * sizeof(Int16) +@const_ref MPI_INT32_T MPI_Datatype 0x4c000039 + 0x100 * sizeof(Int32) +@const_ref MPI_INT64_T MPI_Datatype 0x4c00003a + 0x100 * sizeof(Int64) +@const_ref MPI_UINT8_T MPI_Datatype 0x4c00003b + 0x100 * sizeof(UInt8) +@const_ref MPI_UINT16_T MPI_Datatype 0x4c00003c + 0x100 * sizeof(UInt16) +@const_ref MPI_UINT32_T MPI_Datatype 0x4c00003d + 0x100 * sizeof(UInt32) +@const_ref MPI_UINT64_T MPI_Datatype 0x4c00003e + 0x100 * sizeof(UInt64) +@const_ref MPI_C_BOOL MPI_Datatype 0x4c00003f + 0x100 * sizeof(UInt8) +@const_ref MPI_C_FLOAT_COMPLEX MPI_Datatype 0x4c000040 + 0x100 * sizeof(Complex{Cfloat}) +@const_ref MPI_C_DOUBLE_COMPLEX MPI_Datatype 0x4c000041 + 0x100 * sizeof(Complex{Cdouble}) +# @const_ref MPI_C_LONG_DOUBLE_COMPLEX MPI_Datatype 0x4c000042 + 0x100 * sizeof(Complex{Clongdouble}) +@const_ref MPI_AINT MPI_Datatype 0x4c000043 + 0x100 * sizeof(MPI_Aint) +@const_ref MPI_OFFSET MPI_Datatype 0x4c000044 + 0x100 * sizeof(MPI_Offset) +@const_ref MPI_COUNT MPI_Datatype 0x4c000045 + 0x100 * sizeof(MPI_Count) +@const_ref MPIX_C_FLOAT16 MPI_Datatype 0x4c000046 + 0x100 * sizeof(Float16) + +# aliases +const MPI_LONG_LONG = MPI_LONG_LONG_INT +const MPI_C_COMPLEX = MPI_C_FLOAT_COMPLEX + +@const_ref MPI_ERRHANDLER_NULL MPI_Errhandler 0x14000000 +@const_ref MPI_ERRORS_ARE_FATAL MPI_Errhandler 0x54000000 +@const_ref MPI_ERRORS_RETURN MPI_Errhandler 0x54000001 +@const_ref MPI_ERRORS_ABORT MPI_Errhandler 0x54000003 + +@const_ref MPI_FILE_NULL MPI_File C_NULL + +@const_ref MPI_GROUP_EMPTY MPI_Group 0x48000000 +@const_ref MPI_GROUP_NULL MPI_Group 0x08000000 + +@const_ref MPI_INFO_ENV MPI_Info 0x5c000001 +@const_ref MPI_INFO_NULL MPI_Info 0x1c000000 + +@const_ref MPI_MESSAGE_NO_PROC MPI_Message 0x6c000000 +@const_ref MPI_MESSAGE_NULL MPI_Message 0x2c000000 + +@const_ref MPI_DISPLACEMENT_CURRENT MPI_Offset -54278278 + +@const_ref MPI_OP_NULL MPI_Op 0x18000000 +@const_ref MPI_MAX MPI_Op 0x58000001 +@const_ref MPI_MIN MPI_Op 0x58000002 +@const_ref MPI_SUM MPI_Op 0x58000003 +@const_ref MPI_PROD MPI_Op 0x58000004 +@const_ref MPI_LAND MPI_Op 0x58000005 +@const_ref MPI_BAND MPI_Op 0x58000006 +@const_ref MPI_LOR MPI_Op 0x58000007 +@const_ref MPI_BOR MPI_Op 0x58000008 +@const_ref MPI_LXOR MPI_Op 0x58000009 +@const_ref MPI_BXOR MPI_Op 0x5800000a +@const_ref MPI_MINLOC MPI_Op 0x5800000b +@const_ref MPI_MAXLOC MPI_Op 0x5800000c +@const_ref MPI_REPLACE MPI_Op 0x5800000d +@const_ref MPI_NO_OP MPI_Op 0x5800000e + +@const_ref MPI_REQUEST_NULL MPI_Request 0x2c000000 + +@const_ref MPI_STATUS_IGNORE Ptr{Cvoid} 1 +@const_ref MPI_STATUSES_IGNORE Ptr{Cvoid} 1 + +@const_ref MPI_TYPE_DUP_FN MPI_Comm_copy_attr_function cglobal((:MPIR_Dup_fn, libmpi), MPI_Comm_copy_attr_function) +@const_ref MPI_TYPE_NULL_COPY_FN MPI_Type_copy_attr_function C_NULL +@const_ref MPI_TYPE_NULL_DELETE_FN MPI_Type_delete_attr_function C_NULL + +@const_ref MPI_WIN_NULL MPI_Win 0x20000000 + +@const_ref MPI_WIN_DUP_FN MPI_Win_copy_attr_function cglobal((:MPIR_Dup_fn, libmpi), MPI_Win_copy_attr_function) +@const_ref MPI_WIN_NULL_COPY_FN MPI_Win_copy_attr_function C_NULL +@const_ref MPI_WIN_NULL_DELETE_FN MPI_Win_delete_attr_function C_NULL diff --git a/src/consts/mpiwrapper.jl b/src/consts/mpiwrapper.jl new file mode 100644 index 000000000..7e5063c41 --- /dev/null +++ b/src/consts/mpiwrapper.jl @@ -0,0 +1,334 @@ +# Compile-time constants + +# Implementation limits: +const MPI_MAX_DATAREP_STRING = Cint(128) +const MPI_MAX_ERROR_STRING = Cint(1024) +const MPI_MAX_INFO_KEY = Cint(256) +const MPI_MAX_INFO_VAL = Cint(1024) +const MPI_MAX_LIBRARY_VERSION_STRING = Cint(8192) +const MPI_MAX_OBJECT_NAME = Cint(128) +const MPI_MAX_PORT_NAME = Cint(1024) +const MPI_MAX_PROCESSOR_NAME = Cint(256) + +# Types + +# Various (signed) integer types: +const MPI_Aint = Int64 +const MPI_Count = Int64 +const MPI_Fint = Int32 +const MPI_Offset = Int64 + +# Status: +struct MPI_Status + _private0::Cint + _private1::Cint + _private2::Cint + _private3::Cint + _private4::Csize_t + MPI_SOURCE::Cint + MPI_TAG::Cint + MPI_ERROR::Cint +end + +# Opaque handles: +const MPI_Comm = UInt +const MPI_Datatype = UInt +const MPI_Errhandler = UInt +const MPI_File = UInt +const MPI_Group = UInt +const MPI_Info = UInt +const MPI_Message = UInt +const MPI_Op = UInt +const MPI_Request = UInt +const MPI_Win = UInt + +# Function pointers: +const MPI_Comm_copy_attr_function = Ptr{Cvoid} +const MPI_Comm_delete_attr_function = Ptr{Cvoid} +const MPI_Comm_errhandler_function = Ptr{Cvoid} +const MPI_Comm_errhandler_fn = MPI_Comm_errhandler_function +const MPI_Copy_function = MPI_Comm_copy_attr_function +const MPI_Datarep_conversion_function = Ptr{Cvoid} +const MPI_Datarep_extent_function = Ptr{Cvoid} +const MPI_Delete_function = Ptr{Cvoid} +const MPI_File_errhandler_function = Ptr{Cvoid} +const MPI_File_errhandler_fn = Ptr{Cvoid} +const MPI_Grequest_cancel_function = Ptr{Cvoid} +const MPI_Grequest_free_function = Ptr{Cvoid} +const MPI_Grequest_query_function = Ptr{Cvoid} +const MPI_Type_copy_attr_function = Ptr{Cvoid} +const MPI_Type_delete_attr_function = Ptr{Cvoid} +const MPI_User_function = Ptr{Cvoid} +const MPI_Win_copy_attr_function = Ptr{Cvoid} +const MPI_Win_delete_attr_function = Ptr{Cvoid} +const MPI_Win_errhandler_function = Ptr{Cvoid} +const MPI_Win_errhandler_fn = MPI_Win_errhandler_function + + +@const_ref MPI_ANY_SOURCE Cint unsafe_load(cglobal((:MPICONSTANTS_ANY_SOURCE, libmpiconstants), Cint)) +@const_ref MPI_ANY_TAG Cint unsafe_load(cglobal((:MPICONSTANTS_ANY_TAG, libmpiconstants), Cint)) +@const_ref MPI_PROC_NULL Cint unsafe_load(cglobal((:MPICONSTANTS_PROC_NULL, libmpiconstants), Cint)) +@const_ref MPI_ROOT Cint unsafe_load(cglobal((:MPICONSTANTS_ROOT, libmpiconstants), Cint)) +@const_ref MPI_CART Cint unsafe_load(cglobal((:MPICONSTANTS_CART, libmpiconstants), Cint)) +@const_ref MPI_DIST_GRAPH Cint unsafe_load(cglobal((:MPICONSTANTS_DIST_GRAPH, libmpiconstants), Cint)) +@const_ref MPI_GRAPH Cint unsafe_load(cglobal((:MPICONSTANTS_GRAPH, libmpiconstants), Cint)) +@const_ref MPI_CONGRUENT Cint unsafe_load(cglobal((:MPICONSTANTS_CONGRUENT, libmpiconstants), Cint)) +@const_ref MPI_IDENT Cint unsafe_load(cglobal((:MPICONSTANTS_IDENT, libmpiconstants), Cint)) +@const_ref MPI_SIMILAR Cint unsafe_load(cglobal((:MPICONSTANTS_SIMILAR, libmpiconstants), Cint)) +@const_ref MPI_UNEQUAL Cint unsafe_load(cglobal((:MPICONSTANTS_UNEQUAL, libmpiconstants), Cint)) +@const_ref MPI_KEYVAL_INVALID Cint unsafe_load(cglobal((:MPICONSTANTS_KEYVAL_INVALID, libmpiconstants), Cint)) +@const_ref MPI_UNDEFINED Cint unsafe_load(cglobal((:MPICONSTANTS_UNDEFINED, libmpiconstants), Cint)) +@const_ref MPI_APPNUM Cint unsafe_load(cglobal((:MPICONSTANTS_APPNUM, libmpiconstants), Cint)) +@const_ref MPI_HOST Cint unsafe_load(cglobal((:MPICONSTANTS_HOST, libmpiconstants), Cint)) +@const_ref MPI_IO Cint unsafe_load(cglobal((:MPICONSTANTS_IO, libmpiconstants), Cint)) +@const_ref MPI_LASTUSEDCODE Cint unsafe_load(cglobal((:MPICONSTANTS_LASTUSEDCODE, libmpiconstants), Cint)) +@const_ref MPI_TAG_UB Cint unsafe_load(cglobal((:MPICONSTANTS_TAG_UB, libmpiconstants), Cint)) +@const_ref MPI_UNIVERSE_SIZE Cint unsafe_load(cglobal((:MPICONSTANTS_UNIVERSE_SIZE, libmpiconstants), Cint)) +@const_ref MPI_WIN_BASE Cint unsafe_load(cglobal((:MPICONSTANTS_WIN_BASE, libmpiconstants), Cint)) +@const_ref MPI_WIN_CREATE_FLAVOR Cint unsafe_load(cglobal((:MPICONSTANTS_WIN_CREATE_FLAVOR, libmpiconstants), Cint)) +@const_ref MPI_WIN_DISP_UNIT Cint unsafe_load(cglobal((:MPICONSTANTS_WIN_DISP_UNIT, libmpiconstants), Cint)) +@const_ref MPI_WIN_MODEL Cint unsafe_load(cglobal((:MPICONSTANTS_WIN_MODEL, libmpiconstants), Cint)) +@const_ref MPI_WIN_SIZE Cint unsafe_load(cglobal((:MPICONSTANTS_WIN_SIZE, libmpiconstants), Cint)) +@const_ref MPI_WTIME_IS_GLOBAL Cint unsafe_load(cglobal((:MPICONSTANTS_WTIME_IS_GLOBAL, libmpiconstants), Cint)) +@const_ref MPI_COMBINER_CONTIGUOUS Cint unsafe_load(cglobal((:MPICONSTANTS_COMBINER_CONTIGUOUS, libmpiconstants), Cint)) +@const_ref MPI_COMBINER_DARRAY Cint unsafe_load(cglobal((:MPICONSTANTS_COMBINER_DARRAY, libmpiconstants), Cint)) +@const_ref MPI_COMBINER_DUP Cint unsafe_load(cglobal((:MPICONSTANTS_COMBINER_DUP, libmpiconstants), Cint)) +@const_ref MPI_COMBINER_F90_COMPLEX Cint unsafe_load(cglobal((:MPICONSTANTS_COMBINER_F90_COMPLEX, libmpiconstants), Cint)) +@const_ref MPI_COMBINER_F90_INTEGER Cint unsafe_load(cglobal((:MPICONSTANTS_COMBINER_F90_INTEGER, libmpiconstants), Cint)) +@const_ref MPI_COMBINER_F90_REAL Cint unsafe_load(cglobal((:MPICONSTANTS_COMBINER_F90_REAL, libmpiconstants), Cint)) +@const_ref MPI_COMBINER_HINDEXED Cint unsafe_load(cglobal((:MPICONSTANTS_COMBINER_HINDEXED, libmpiconstants), Cint)) +@const_ref MPI_COMBINER_HINDEXED_BLOCK Cint unsafe_load(cglobal((:MPICONSTANTS_COMBINER_HINDEXED_BLOCK, libmpiconstants), Cint)) +@const_ref MPI_COMBINER_HVECTOR Cint unsafe_load(cglobal((:MPICONSTANTS_COMBINER_HVECTOR, libmpiconstants), Cint)) +@const_ref MPI_COMBINER_INDEXED Cint unsafe_load(cglobal((:MPICONSTANTS_COMBINER_INDEXED, libmpiconstants), Cint)) +@const_ref MPI_COMBINER_INDEXED_BLOCK Cint unsafe_load(cglobal((:MPICONSTANTS_COMBINER_INDEXED_BLOCK, libmpiconstants), Cint)) +@const_ref MPI_COMBINER_NAMED Cint unsafe_load(cglobal((:MPICONSTANTS_COMBINER_NAMED, libmpiconstants), Cint)) +@const_ref MPI_COMBINER_RESIZED Cint unsafe_load(cglobal((:MPICONSTANTS_COMBINER_RESIZED, libmpiconstants), Cint)) +@const_ref MPI_COMBINER_STRUCT Cint unsafe_load(cglobal((:MPICONSTANTS_COMBINER_STRUCT, libmpiconstants), Cint)) +@const_ref MPI_COMBINER_SUBARRAY Cint unsafe_load(cglobal((:MPICONSTANTS_COMBINER_SUBARRAY, libmpiconstants), Cint)) +@const_ref MPI_COMBINER_VECTOR Cint unsafe_load(cglobal((:MPICONSTANTS_COMBINER_VECTOR, libmpiconstants), Cint)) +@const_ref MPI_COMM_TYPE_SHARED Cint unsafe_load(cglobal((:MPICONSTANTS_COMM_TYPE_SHARED, libmpiconstants), Cint)) +@const_ref MPI_DISTRIBUTE_BLOCK Cint unsafe_load(cglobal((:MPICONSTANTS_DISTRIBUTE_BLOCK, libmpiconstants), Cint)) +@const_ref MPI_DISTRIBUTE_CYCLIC Cint unsafe_load(cglobal((:MPICONSTANTS_DISTRIBUTE_CYCLIC, libmpiconstants), Cint)) +@const_ref MPI_DISTRIBUTE_NONE Cint unsafe_load(cglobal((:MPICONSTANTS_DISTRIBUTE_NONE, libmpiconstants), Cint)) +@const_ref MPI_ERR_ACCESS Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_ACCESS, libmpiconstants), Cint)) +@const_ref MPI_ERR_AMODE Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_AMODE, libmpiconstants), Cint)) +@const_ref MPI_ERR_ARG Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_ARG, libmpiconstants), Cint)) +@const_ref MPI_ERR_ASSERT Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_ASSERT, libmpiconstants), Cint)) +@const_ref MPI_ERR_BAD_FILE Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_BAD_FILE, libmpiconstants), Cint)) +@const_ref MPI_ERR_BASE Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_BASE, libmpiconstants), Cint)) +@const_ref MPI_ERR_BUFFER Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_BUFFER, libmpiconstants), Cint)) +@const_ref MPI_ERR_COMM Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_COMM, libmpiconstants), Cint)) +@const_ref MPI_ERR_CONVERSION Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_CONVERSION, libmpiconstants), Cint)) +@const_ref MPI_ERR_COUNT Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_COUNT, libmpiconstants), Cint)) +@const_ref MPI_ERR_DIMS Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_DIMS, libmpiconstants), Cint)) +@const_ref MPI_ERR_DISP Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_DISP, libmpiconstants), Cint)) +@const_ref MPI_ERR_DUP_DATAREP Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_DUP_DATAREP, libmpiconstants), Cint)) +@const_ref MPI_ERR_FILE Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_FILE, libmpiconstants), Cint)) +@const_ref MPI_ERR_FILE_EXISTS Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_FILE_EXISTS, libmpiconstants), Cint)) +@const_ref MPI_ERR_FILE_IN_USE Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_FILE_IN_USE, libmpiconstants), Cint)) +@const_ref MPI_ERR_GROUP Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_GROUP, libmpiconstants), Cint)) +@const_ref MPI_ERR_INFO Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_INFO, libmpiconstants), Cint)) +@const_ref MPI_ERR_INFO_KEY Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_INFO_KEY, libmpiconstants), Cint)) +@const_ref MPI_ERR_INFO_NOKEY Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_INFO_NOKEY, libmpiconstants), Cint)) +@const_ref MPI_ERR_INFO_VALUE Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_INFO_VALUE, libmpiconstants), Cint)) +@const_ref MPI_ERR_INTERN Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_INTERN, libmpiconstants), Cint)) +@const_ref MPI_ERR_IN_STATUS Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_IN_STATUS, libmpiconstants), Cint)) +@const_ref MPI_ERR_IO Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_IO, libmpiconstants), Cint)) +@const_ref MPI_ERR_KEYVAL Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_KEYVAL, libmpiconstants), Cint)) +@const_ref MPI_ERR_LASTCODE Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_LASTCODE, libmpiconstants), Cint)) +@const_ref MPI_ERR_LOCKTYPE Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_LOCKTYPE, libmpiconstants), Cint)) +@const_ref MPI_ERR_NAME Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_NAME, libmpiconstants), Cint)) +@const_ref MPI_ERR_NOT_SAME Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_NOT_SAME, libmpiconstants), Cint)) +@const_ref MPI_ERR_NO_MEM Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_NO_MEM, libmpiconstants), Cint)) +@const_ref MPI_ERR_NO_SPACE Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_NO_SPACE, libmpiconstants), Cint)) +@const_ref MPI_ERR_NO_SUCH_FILE Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_NO_SUCH_FILE, libmpiconstants), Cint)) +@const_ref MPI_ERR_OP Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_OP, libmpiconstants), Cint)) +@const_ref MPI_ERR_OTHER Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_OTHER, libmpiconstants), Cint)) +@const_ref MPI_ERR_PENDING Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_PENDING, libmpiconstants), Cint)) +@const_ref MPI_ERR_PORT Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_PORT, libmpiconstants), Cint)) +@const_ref MPI_ERR_QUOTA Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_QUOTA, libmpiconstants), Cint)) +@const_ref MPI_ERR_RANK Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_RANK, libmpiconstants), Cint)) +@const_ref MPI_ERR_READ_ONLY Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_READ_ONLY, libmpiconstants), Cint)) +@const_ref MPI_ERR_REQUEST Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_REQUEST, libmpiconstants), Cint)) +@const_ref MPI_ERR_RMA_ATTACH Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_RMA_ATTACH, libmpiconstants), Cint)) +@const_ref MPI_ERR_RMA_CONFLICT Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_RMA_CONFLICT, libmpiconstants), Cint)) +@const_ref MPI_ERR_RMA_FLAVOR Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_RMA_FLAVOR, libmpiconstants), Cint)) +@const_ref MPI_ERR_RMA_RANGE Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_RMA_RANGE, libmpiconstants), Cint)) +@const_ref MPI_ERR_RMA_SHARED Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_RMA_SHARED, libmpiconstants), Cint)) +@const_ref MPI_ERR_RMA_SYNC Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_RMA_SYNC, libmpiconstants), Cint)) +@const_ref MPI_ERR_ROOT Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_ROOT, libmpiconstants), Cint)) +@const_ref MPI_ERR_SERVICE Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_SERVICE, libmpiconstants), Cint)) +@const_ref MPI_ERR_SIZE Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_SIZE, libmpiconstants), Cint)) +@const_ref MPI_ERR_SPAWN Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_SPAWN, libmpiconstants), Cint)) +@const_ref MPI_ERR_TAG Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_TAG, libmpiconstants), Cint)) +@const_ref MPI_ERR_TOPOLOGY Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_TOPOLOGY, libmpiconstants), Cint)) +@const_ref MPI_ERR_TRUNCATE Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_TRUNCATE, libmpiconstants), Cint)) +@const_ref MPI_ERR_TYPE Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_TYPE, libmpiconstants), Cint)) +@const_ref MPI_ERR_UNKNOWN Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_UNKNOWN, libmpiconstants), Cint)) +@const_ref MPI_ERR_UNSUPPORTED_DATAREP Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_UNSUPPORTED_DATAREP, libmpiconstants), Cint)) +@const_ref MPI_ERR_UNSUPPORTED_OPERATION Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_UNSUPPORTED_OPERATION, libmpiconstants), Cint)) +@const_ref MPI_ERR_WIN Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_WIN, libmpiconstants), Cint)) + +@const_ref MPI_SUCCESS Cint unsafe_load(cglobal((:MPICONSTANTS_SUCCESS, libmpiconstants), Cint)) +@const_ref MPI_LOCK_EXCLUSIVE Cint unsafe_load(cglobal((:MPICONSTANTS_LOCK_EXCLUSIVE, libmpiconstants), Cint)) +@const_ref MPI_LOCK_SHARED Cint unsafe_load(cglobal((:MPICONSTANTS_LOCK_SHARED, libmpiconstants), Cint)) +@const_ref MPI_MODE_APPEND Cint unsafe_load(cglobal((:MPICONSTANTS_MODE_APPEND, libmpiconstants), Cint)) +@const_ref MPI_MODE_CREATE Cint unsafe_load(cglobal((:MPICONSTANTS_MODE_CREATE, libmpiconstants), Cint)) +@const_ref MPI_MODE_DELETE_ON_CLOSE Cint unsafe_load(cglobal((:MPICONSTANTS_MODE_DELETE_ON_CLOSE, libmpiconstants), Cint)) +@const_ref MPI_MODE_EXCL Cint unsafe_load(cglobal((:MPICONSTANTS_MODE_EXCL, libmpiconstants), Cint)) +@const_ref MPI_MODE_NOCHECK Cint unsafe_load(cglobal((:MPICONSTANTS_MODE_NOCHECK, libmpiconstants), Cint)) +@const_ref MPI_MODE_NOPRECEDE Cint unsafe_load(cglobal((:MPICONSTANTS_MODE_NOPRECEDE, libmpiconstants), Cint)) +@const_ref MPI_MODE_NOPUT Cint unsafe_load(cglobal((:MPICONSTANTS_MODE_NOPUT, libmpiconstants), Cint)) +@const_ref MPI_MODE_NOSTORE Cint unsafe_load(cglobal((:MPICONSTANTS_MODE_NOSTORE, libmpiconstants), Cint)) +@const_ref MPI_MODE_NOSUCCEED Cint unsafe_load(cglobal((:MPICONSTANTS_MODE_NOSUCCEED, libmpiconstants), Cint)) +@const_ref MPI_MODE_RDONLY Cint unsafe_load(cglobal((:MPICONSTANTS_MODE_RDONLY, libmpiconstants), Cint)) +@const_ref MPI_MODE_RDWR Cint unsafe_load(cglobal((:MPICONSTANTS_MODE_RDWR, libmpiconstants), Cint)) +@const_ref MPI_MODE_SEQUENTIAL Cint unsafe_load(cglobal((:MPICONSTANTS_MODE_SEQUENTIAL, libmpiconstants), Cint)) +@const_ref MPI_MODE_UNIQUE_OPEN Cint unsafe_load(cglobal((:MPICONSTANTS_MODE_UNIQUE_OPEN, libmpiconstants), Cint)) +@const_ref MPI_MODE_WRONLY Cint unsafe_load(cglobal((:MPICONSTANTS_MODE_WRONLY, libmpiconstants), Cint)) +@const_ref MPI_ORDER_C Cint unsafe_load(cglobal((:MPICONSTANTS_ORDER_C, libmpiconstants), Cint)) +@const_ref MPI_ORDER_FORTRAN Cint unsafe_load(cglobal((:MPICONSTANTS_ORDER_FORTRAN, libmpiconstants), Cint)) +@const_ref MPI_SEEK_CUR Cint unsafe_load(cglobal((:MPICONSTANTS_SEEK_CUR, libmpiconstants), Cint)) +@const_ref MPI_SEEK_END Cint unsafe_load(cglobal((:MPICONSTANTS_SEEK_END, libmpiconstants), Cint)) +@const_ref MPI_SEEK_SET Cint unsafe_load(cglobal((:MPICONSTANTS_SEEK_SET, libmpiconstants), Cint)) +@const_ref MPI_THREAD_SINGLE Cint unsafe_load(cglobal((:MPICONSTANTS_THREAD_SINGLE, libmpiconstants), Cint)) +@const_ref MPI_THREAD_FUNNELED Cint unsafe_load(cglobal((:MPICONSTANTS_THREAD_FUNNELED, libmpiconstants), Cint)) +@const_ref MPI_THREAD_SERIALIZED Cint unsafe_load(cglobal((:MPICONSTANTS_THREAD_SERIALIZED, libmpiconstants), Cint)) +@const_ref MPI_THREAD_MULTIPLE Cint unsafe_load(cglobal((:MPICONSTANTS_THREAD_MULTIPLE, libmpiconstants), Cint)) +@const_ref MPI_TYPECLASS_COMPLEX Cint unsafe_load(cglobal((:MPICONSTANTS_TYPECLASS_COMPLEX, libmpiconstants), Cint)) +@const_ref MPI_TYPECLASS_INTEGER Cint unsafe_load(cglobal((:MPICONSTANTS_TYPECLASS_INTEGER, libmpiconstants), Cint)) +@const_ref MPI_TYPECLASS_REAL Cint unsafe_load(cglobal((:MPICONSTANTS_TYPECLASS_REAL, libmpiconstants), Cint)) + +@const_ref MPI_ARGV_NULL Ptr{Cchar} unsafe_load(cglobal((:MPICONSTANTS_ARGV_NULL, libmpiconstants), Ptr{Ptr{Cchar}})) +@const_ref MPI_ARGVS_NULL Ptr{Cchar} unsafe_load(cglobal((:MPICONSTANTS_ARGVS_NULL, libmpiconstants), Ptr{Ptr{Ptr{Cchar}}})) +# MPI_UNWEIGHTED Ptr{Cvoid} unsafe_load(cglobal((:MPICONSTANTS_UNWEIGHTED, libmpiconstants), Ptr{Cint})) +# MPI_WEIGHTS_EMPTY Ptr{Cvoid} unsafe_load(cglobal((:MPICONSTANTS_WEIGHTS_EMPTY, libmpiconstants), Ptr{Cint})) +@const_ref MPI_BOTTOM Ptr{Cvoid} unsafe_load(cglobal((:MPICONSTANTS_BOTTOM, libmpiconstants), Ptr{Cvoid})) +@const_ref MPI_IN_PLACE Ptr{Cvoid} unsafe_load(cglobal((:MPICONSTANTS_IN_PLACE, libmpiconstants), Ptr{Cvoid})) + +@const_ref MPI_COMM_NULL MPI_Comm unsafe_load(cglobal((:MPICONSTANTS_COMM_NULL , libmpiconstants), MPI_Comm)) +@const_ref MPI_COMM_SELF MPI_Comm unsafe_load(cglobal((:MPICONSTANTS_COMM_SELF , libmpiconstants), MPI_Comm)) +@const_ref MPI_COMM_WORLD MPI_Comm unsafe_load(cglobal((:MPICONSTANTS_COMM_WORLD, libmpiconstants), MPI_Comm)) + +@const_ref MPI_COMM_DUP_FN MPI_Comm_copy_attr_function unsafe_load(cglobal((:MPICONSTANTS_COMM_DUP_FN, libmpiconstants), MPI_Comm_copy_attr_function)) +@const_ref MPI_COMM_NULL_COPY_FN MPI_Comm_copy_attr_function unsafe_load(cglobal((:MPICONSTANTS_COMM_NULL_COPY_FN, libmpiconstants), MPI_Comm_copy_attr_function)) +@const_ref MPI_COMM_NULL_DELETE_FN MPI_Comm_delete_attr_function unsafe_load(cglobal((:MPICONSTANTS_COMM_NULL_DELETE_FN, libmpiconstants), MPI_Comm_delete_attr_function)) + +@const_ref MPI_NULL_COPY_FN MPI_Copy_function unsafe_load(cglobal((:MPICONSTANTS_NULL_COPY_FN, libmpiconstants), MPI_Copy_function)) + +@const_ref MPI_2DOUBLE_PRECISION MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_2DOUBLE_PRECISION, libmpiconstants), MPI_Datatype)) +@const_ref MPI_2INT MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_2INT, libmpiconstants), MPI_Datatype)) +@const_ref MPI_2INTEGER MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_2INTEGER, libmpiconstants), MPI_Datatype)) +@const_ref MPI_2REAL MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_2REAL, libmpiconstants), MPI_Datatype)) +@const_ref MPI_AINT MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_AINT, libmpiconstants), MPI_Datatype)) +@const_ref MPI_BYTE MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_BYTE, libmpiconstants), MPI_Datatype)) +@const_ref MPI_CHAR MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_CHAR, libmpiconstants), MPI_Datatype)) +@const_ref MPI_CHARACTER MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_CHARACTER, libmpiconstants), MPI_Datatype)) +@const_ref MPI_COMPLEX MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_COMPLEX, libmpiconstants), MPI_Datatype)) +@const_ref MPI_COMPLEX16 MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_COMPLEX16, libmpiconstants), MPI_Datatype)) +# MPI_COMPLEX32 MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_COMPLEX32, libmpiconstants), MPI_Datatype)) +@const_ref MPI_COMPLEX8 MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_COMPLEX8, libmpiconstants), MPI_Datatype)) +@const_ref MPI_COUNT MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_COUNT, libmpiconstants), MPI_Datatype)) +@const_ref MPI_CXX_BOOL MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_CXX_BOOL, libmpiconstants), MPI_Datatype)) +@const_ref MPI_CXX_DOUBLE_COMPLEX MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_CXX_DOUBLE_COMPLEX, libmpiconstants), MPI_Datatype)) +@const_ref MPI_CXX_FLOAT_COMPLEX MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_CXX_FLOAT_COMPLEX, libmpiconstants), MPI_Datatype)) +@const_ref MPI_CXX_LONG_DOUBLE_COMPLEX MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_CXX_LONG_DOUBLE_COMPLEX, libmpiconstants), MPI_Datatype)) +@const_ref MPI_C_BOOL MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_C_BOOL, libmpiconstants), MPI_Datatype)) +@const_ref MPI_C_COMPLEX MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_C_COMPLEX, libmpiconstants), MPI_Datatype)) +@const_ref MPI_C_DOUBLE_COMPLEX MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_C_DOUBLE_COMPLEX, libmpiconstants), MPI_Datatype)) +@const_ref MPI_C_FLOAT_COMPLEX MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_C_FLOAT_COMPLEX, libmpiconstants), MPI_Datatype)) +@const_ref MPI_C_LONG_DOUBLE_COMPLEX MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_C_LONG_DOUBLE_COMPLEX, libmpiconstants), MPI_Datatype)) +@const_ref MPI_DATATYPE_NULL MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_DATATYPE_NULL, libmpiconstants), MPI_Datatype)) +@const_ref MPI_DOUBLE MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_DOUBLE, libmpiconstants), MPI_Datatype)) +@const_ref MPI_DOUBLE_COMPLEX MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_DOUBLE_COMPLEX, libmpiconstants), MPI_Datatype)) +@const_ref MPI_DOUBLE_INT MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_DOUBLE_INT, libmpiconstants), MPI_Datatype)) +@const_ref MPI_DOUBLE_PRECISION MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_DOUBLE_PRECISION, libmpiconstants), MPI_Datatype)) +@const_ref MPI_FLOAT MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_FLOAT, libmpiconstants), MPI_Datatype)) +@const_ref MPI_FLOAT_INT MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_FLOAT_INT, libmpiconstants), MPI_Datatype)) +@const_ref MPI_INT MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_INT, libmpiconstants), MPI_Datatype)) +@const_ref MPI_INT16_T MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_INT16_T, libmpiconstants), MPI_Datatype)) +@const_ref MPI_INT32_T MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_INT32_T, libmpiconstants), MPI_Datatype)) +@const_ref MPI_INT64_T MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_INT64_T, libmpiconstants), MPI_Datatype)) +@const_ref MPI_INT8_T MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_INT8_T, libmpiconstants), MPI_Datatype)) +@const_ref MPI_INTEGER MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_INTEGER, libmpiconstants), MPI_Datatype)) +@const_ref MPI_INTEGER1 MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_INTEGER1, libmpiconstants), MPI_Datatype)) +@const_ref MPI_INTEGER2 MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_INTEGER2, libmpiconstants), MPI_Datatype)) +@const_ref MPI_INTEGER4 MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_INTEGER4, libmpiconstants), MPI_Datatype)) +@const_ref MPI_INTEGER8 MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_INTEGER8, libmpiconstants), MPI_Datatype)) +@const_ref MPI_LOGICAL MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_LOGICAL, libmpiconstants), MPI_Datatype)) +@const_ref MPI_LONG MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_LONG, libmpiconstants), MPI_Datatype)) +@const_ref MPI_LONG_DOUBLE MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_LONG_DOUBLE, libmpiconstants), MPI_Datatype)) +@const_ref MPI_LONG_DOUBLE_INT MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_LONG_DOUBLE_INT, libmpiconstants), MPI_Datatype)) +@const_ref MPI_LONG_INT MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_LONG_INT, libmpiconstants), MPI_Datatype)) +@const_ref MPI_LONG_LONG MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_LONG_LONG, libmpiconstants), MPI_Datatype)) +@const_ref MPI_LONG_LONG_INT MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_LONG_LONG_INT, libmpiconstants), MPI_Datatype)) +@const_ref MPI_OFFSET MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_OFFSET, libmpiconstants), MPI_Datatype)) +@const_ref MPI_PACKED MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_PACKED, libmpiconstants), MPI_Datatype)) +@const_ref MPI_REAL MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_REAL, libmpiconstants), MPI_Datatype)) +# MPI_REAL16 MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_REAL16, libmpiconstants), MPI_Datatype)) +@const_ref MPI_REAL4 MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_REAL4, libmpiconstants), MPI_Datatype)) +@const_ref MPI_REAL8 MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_REAL8, libmpiconstants), MPI_Datatype)) +@const_ref MPI_SHORT MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_SHORT, libmpiconstants), MPI_Datatype)) +@const_ref MPI_SHORT_INT MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_SHORT_INT, libmpiconstants), MPI_Datatype)) +@const_ref MPI_SIGNED_CHAR MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_SIGNED_CHAR, libmpiconstants), MPI_Datatype)) +@const_ref MPI_UINT16_T MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_UINT16_T, libmpiconstants), MPI_Datatype)) +@const_ref MPI_UINT32_T MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_UINT32_T, libmpiconstants), MPI_Datatype)) +@const_ref MPI_UINT64_T MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_UINT64_T, libmpiconstants), MPI_Datatype)) +@const_ref MPI_UINT8_T MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_UINT8_T, libmpiconstants), MPI_Datatype)) +@const_ref MPI_UNSIGNED MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_UNSIGNED, libmpiconstants), MPI_Datatype)) +@const_ref MPI_UNSIGNED_CHAR MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_UNSIGNED_CHAR, libmpiconstants), MPI_Datatype)) +@const_ref MPI_UNSIGNED_LONG MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_UNSIGNED_LONG, libmpiconstants), MPI_Datatype)) +@const_ref MPI_UNSIGNED_LONG_LONG MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_UNSIGNED_LONG_LONG, libmpiconstants), MPI_Datatype)) +@const_ref MPI_UNSIGNED_SHORT MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_UNSIGNED_SHORT, libmpiconstants), MPI_Datatype)) +@const_ref MPI_WCHAR MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_WCHAR, libmpiconstants), MPI_Datatype)) + +@const_ref MPI_NULL_DELETE_FN MPI_Delete_function unsafe_load(cglobal((:MPICONSTANTS_NULL_DELETE_FN, libmpiconstants), MPI_Delete_function)) + +@const_ref MPI_ERRHANDLER_NULL MPI_Errhandler unsafe_load(cglobal((:MPICONSTANTS_ERRHANDLER_NULL, libmpiconstants), MPI_Errhandler)) +@const_ref MPI_ERRORS_ARE_FATAL MPI_Errhandler unsafe_load(cglobal((:MPICONSTANTS_ERRORS_ARE_FATAL, libmpiconstants), MPI_Errhandler)) +@const_ref MPI_ERRORS_RETURN MPI_Errhandler unsafe_load(cglobal((:MPICONSTANTS_ERRORS_RETURN, libmpiconstants), MPI_Errhandler)) + +@const_ref MPI_FILE_NULL MPI_File unsafe_load(cglobal((:MPICONSTANTS_FILE_NULL, libmpiconstants), MPI_File)) + +@const_ref MPI_GROUP_EMPTY MPI_Group unsafe_load(cglobal((:MPICONSTANTS_GROUP_EMPTY, libmpiconstants), MPI_Group)) +@const_ref MPI_GROUP_NULL MPI_Group unsafe_load(cglobal((:MPICONSTANTS_GROUP_NULL, libmpiconstants), MPI_Group)) + +@const_ref MPI_INFO_ENV MPI_Info unsafe_load(cglobal((:MPICONSTANTS_INFO_ENV, libmpiconstants), MPI_Info)) +@const_ref MPI_INFO_NULL MPI_Info unsafe_load(cglobal((:MPICONSTANTS_INFO_NULL, libmpiconstants), MPI_Info)) + +@const_ref MPI_MESSAGE_NO_PROC MPI_Message unsafe_load(cglobal((:MPICONSTANTS_MESSAGE_NO_PROC, libmpiconstants), MPI_Message)) +@const_ref MPI_MESSAGE_NULL MPI_Message unsafe_load(cglobal((:MPICONSTANTS_MESSAGE_NULL, libmpiconstants), MPI_Message)) + +@const_ref MPI_DISPLACEMENT_CURRENT MPI_Offset unsafe_load(cglobal((:MPICONSTANTS_DISPLACEMENT_CURRENT, libmpiconstants), MPI_Offset)) + +@const_ref MPI_BAND MPI_Op unsafe_load(cglobal((:MPICONSTANTS_BAND, libmpiconstants), MPI_Op)) +@const_ref MPI_BOR MPI_Op unsafe_load(cglobal((:MPICONSTANTS_BOR, libmpiconstants), MPI_Op)) +@const_ref MPI_BXOR MPI_Op unsafe_load(cglobal((:MPICONSTANTS_BXOR, libmpiconstants), MPI_Op)) +@const_ref MPI_LAND MPI_Op unsafe_load(cglobal((:MPICONSTANTS_LAND, libmpiconstants), MPI_Op)) +@const_ref MPI_LOR MPI_Op unsafe_load(cglobal((:MPICONSTANTS_LOR, libmpiconstants), MPI_Op)) +@const_ref MPI_LXOR MPI_Op unsafe_load(cglobal((:MPICONSTANTS_LXOR, libmpiconstants), MPI_Op)) +@const_ref MPI_MAX MPI_Op unsafe_load(cglobal((:MPICONSTANTS_MAX, libmpiconstants), MPI_Op)) +@const_ref MPI_MAXLOC MPI_Op unsafe_load(cglobal((:MPICONSTANTS_MAXLOC, libmpiconstants), MPI_Op)) +@const_ref MPI_MIN MPI_Op unsafe_load(cglobal((:MPICONSTANTS_MIN, libmpiconstants), MPI_Op)) +@const_ref MPI_MINLOC MPI_Op unsafe_load(cglobal((:MPICONSTANTS_MINLOC, libmpiconstants), MPI_Op)) +@const_ref MPI_NO_OP MPI_Op unsafe_load(cglobal((:MPICONSTANTS_NO_OP, libmpiconstants), MPI_Op)) +@const_ref MPI_OP_NULL MPI_Op unsafe_load(cglobal((:MPICONSTANTS_OP_NULL, libmpiconstants), MPI_Op)) +@const_ref MPI_PROD MPI_Op unsafe_load(cglobal((:MPICONSTANTS_PROD, libmpiconstants), MPI_Op)) +@const_ref MPI_REPLACE MPI_Op unsafe_load(cglobal((:MPICONSTANTS_REPLACE, libmpiconstants), MPI_Op)) +@const_ref MPI_SUM MPI_Op unsafe_load(cglobal((:MPICONSTANTS_SUM, libmpiconstants), MPI_Op)) + +@const_ref MPI_REQUEST_NULL MPI_Request unsafe_load(cglobal((:MPICONSTANTS_REQUEST_NULL, libmpiconstants), MPI_Request)) + +@const_ref MPI_STATUS_IGNORE Ptr{MPI_Status} unsafe_load(cglobal((:MPICONSTANTS_STATUS_IGNORE, libmpiconstants), Ptr{MPI_Status})) +@const_ref MPI_STATUSES_IGNORE Ptr{MPI_Status} unsafe_load(cglobal((:MPICONSTANTS_STATUSES_IGNORE, libmpiconstants), Ptr{MPI_Status})) + +@const_ref MPI_TYPE_DUP_FN MPI_Type_copy_attr_function unsafe_load(cglobal((:MPICONSTANTS_TYPE_DUP_FN, libmpiconstants), MPI_Type_copy_attr_function)) +@const_ref MPI_TYPE_NULL_COPY_FN MPI_Type_copy_attr_function unsafe_load(cglobal((:MPICONSTANTS_TYPE_NULL_COPY_FN, libmpiconstants), MPI_Type_copy_attr_function)) +@const_ref MPI_TYPE_NULL_DELETE_FN MPI_Type_delete_attr_function unsafe_load(cglobal((:MPICONSTANTS_TYPE_NULL_DELETE_FN, libmpiconstants), MPI_Type_delete_attr_function)) + +@const_ref MPI_WIN_NULL MPI_Win unsafe_load(cglobal((:MPICONSTANTS_WIN_NULL, libmpiconstants), MPI_Win)) + +@const_ref MPI_WIN_DUP_FN MPI_Win_copy_attr_function unsafe_load(cglobal((:MPICONSTANTS_WIN_DUP_FN, libmpiconstants), MPI_Win_copy_attr_function)) +@const_ref MPI_WIN_NULL_COPY_FN MPI_Win_copy_attr_function unsafe_load(cglobal((:MPICONSTANTS_WIN_NULL_COPY_FN, libmpiconstants), MPI_Win_copy_attr_function)) + +@const_ref MPI_WIN_NULL_DELETE_FN MPI_Win_delete_attr_function unsafe_load(cglobal((:MPICONSTANTS_WIN_NULL_DELETE_FN, libmpiconstants), MPI_Win_delete_attr_function)) diff --git a/src/consts/openmpi.jl b/src/consts/openmpi.jl new file mode 100644 index 000000000..f67ecf022 --- /dev/null +++ b/src/consts/openmpi.jl @@ -0,0 +1,354 @@ +# Compile-time constants +# logic derived from +# https://github.com/open-mpi/ompi/blob/master/ompi/include/mpi.h.in + +# Implementation limits: +const MPI_MAX_DATAREP_STRING = Cint(128) +const MPI_MAX_ERROR_STRING = Cint(256) +const MPI_MAX_INFO_KEY = Cint(36) +const MPI_MAX_INFO_VAL = Cint(256) +const MPI_MAX_LIBRARY_VERSION_STRING = Cint(256) +const MPI_MAX_OBJECT_NAME = Cint(64) +const MPI_MAX_PORT_NAME = Cint(1024) +const MPI_MAX_PROCESSOR_NAME = Cint(256) + +# Types + +# Various (signed) integer types: +const MPI_Aint = Int +const MPI_Fint = Int32 +const MPI_Count = Int +const MPI_Offset = Int + +# Status: +struct MPI_Status + MPI_SOURCE::Cint + MPI_TAG::Cint + MPI_ERROR::Cint + _private0::Cint + _private1::Csize_t +end + +# Opaque handles: +const MPI_Comm = Ptr{Cvoid} +const MPI_Datatype = Ptr{Cvoid} +const MPI_Errhandler = Ptr{Cvoid} +const MPI_File = Ptr{Cvoid} +const MPI_Group = Ptr{Cvoid} +const MPI_Info = Ptr{Cvoid} +const MPI_Message = Ptr{Cvoid} +const MPI_Op = Ptr{Cvoid} +const MPI_Request = Ptr{Cvoid} +const MPI_Win = Ptr{Cvoid} + +# Function pointers: +const MPI_Comm_copy_attr_function = Ptr{Cvoid} +const MPI_Comm_delete_attr_function = Ptr{Cvoid} +const MPI_Comm_errhandler_function = Ptr{Cvoid} +const MPI_Comm_errhandler_fn = MPI_Comm_errhandler_function +const MPI_Copy_function = MPI_Comm_copy_attr_function +const MPI_Datarep_conversion_function = Ptr{Cvoid} +const MPI_Datarep_extent_function = Ptr{Cvoid} +const MPI_Delete_function = Ptr{Cvoid} +const MPI_File_errhandler_function = Ptr{Cvoid} +const MPI_File_errhandler_fn = Ptr{Cvoid} +const MPI_Grequest_cancel_function = Ptr{Cvoid} +const MPI_Grequest_free_function = Ptr{Cvoid} +const MPI_Grequest_query_function = Ptr{Cvoid} +const MPI_Type_copy_attr_function = Ptr{Cvoid} +const MPI_Type_delete_attr_function = Ptr{Cvoid} +const MPI_User_function = Ptr{Cvoid} +const MPI_Win_copy_attr_function = Ptr{Cvoid} +const MPI_Win_delete_attr_function = Ptr{Cvoid} +const MPI_Win_errhandler_function = Ptr{Cvoid} +const MPI_Win_errhandler_fn = MPI_Win_errhandler_function + +# Run-time constants + +@const_ref MPI_ANY_SOURCE Cint -1 +@const_ref MPI_ANY_TAG Cint -1 +@const_ref MPI_PROC_NULL Cint -2 +@const_ref MPI_ROOT Cint -4 + +@const_ref MPI_CART Cint 1 +@const_ref MPI_GRAPH Cint 2 +@const_ref MPI_DIST_GRAPH Cint 3 + +@const_ref MPI_IDENT Cint 0 +@const_ref MPI_CONGRUENT Cint 1 +@const_ref MPI_SIMILAR Cint 2 +@const_ref MPI_UNEQUAL Cint 3 + +@const_ref MPI_KEYVAL_INVALID Cint -1 +@const_ref MPI_UNDEFINED Cint -32766 + +@const_ref MPI_TAG_UB Cint 0 +@const_ref MPI_HOST Cint 1 +@const_ref MPI_IO Cint 2 +@const_ref MPI_WTIME_IS_GLOBAL Cint 3 +@const_ref MPI_APPNUM Cint 4 +@const_ref MPI_LASTUSEDCODE Cint 5 +@const_ref MPI_UNIVERSE_SIZE Cint 6 + +@const_ref MPI_WIN_BASE Cint 7 +@const_ref MPI_WIN_SIZE Cint 8 +@const_ref MPI_WIN_DISP_UNIT Cint 9 +@const_ref MPI_WIN_CREATE_FLAVOR Cint 10 +@const_ref MPI_WIN_MODEL Cint 11 + +@const_ref MPI_COMBINER_NAMED Cint 0 +@const_ref MPI_COMBINER_DUP Cint 1 +@const_ref MPI_COMBINER_CONTIGUOUS Cint 2 +@const_ref MPI_COMBINER_VECTOR Cint 3 +@const_ref MPI_COMBINER_HVECTOR_INTEGER Cint 4 +@const_ref MPI_COMBINER_HVECTOR Cint 5 +@const_ref MPI_COMBINER_INDEXED Cint 6 +@const_ref MPI_COMBINER_HINDEXED_INTEGER Cint 7 +@const_ref MPI_COMBINER_HINDEXED Cint 8 +@const_ref MPI_COMBINER_INDEXED_BLOCK Cint 9 +@const_ref MPI_COMBINER_STRUCT_INTEGER Cint 10 +@const_ref MPI_COMBINER_STRUCT Cint 11 +@const_ref MPI_COMBINER_SUBARRAY Cint 12 +@const_ref MPI_COMBINER_DARRAY Cint 13 +@const_ref MPI_COMBINER_F90_REAL Cint 14 +@const_ref MPI_COMBINER_F90_COMPLEX Cint 15 +@const_ref MPI_COMBINER_F90_INTEGER Cint 16 +@const_ref MPI_COMBINER_RESIZED Cint 17 +@const_ref MPI_COMBINER_HINDEXED_BLOCK Cint 18 + +@const_ref MPI_COMM_TYPE_SHARED Cint 0 + +@const_ref MPI_DISTRIBUTE_BLOCK Cint 0 +@const_ref MPI_DISTRIBUTE_CYCLIC Cint 1 +@const_ref MPI_DISTRIBUTE_NONE Cint 2 + +@const_ref MPI_SUCCESS Cint 0 +@const_ref MPI_ERR_BUFFER Cint 1 +@const_ref MPI_ERR_COUNT Cint 2 +@const_ref MPI_ERR_TYPE Cint 3 +@const_ref MPI_ERR_TAG Cint 4 +@const_ref MPI_ERR_COMM Cint 5 +@const_ref MPI_ERR_RANK Cint 6 +@const_ref MPI_ERR_REQUEST Cint 7 +@const_ref MPI_ERR_ROOT Cint 8 +@const_ref MPI_ERR_GROUP Cint 9 +@const_ref MPI_ERR_OP Cint 10 +@const_ref MPI_ERR_TOPOLOGY Cint 11 +@const_ref MPI_ERR_DIMS Cint 12 +@const_ref MPI_ERR_ARG Cint 13 +@const_ref MPI_ERR_UNKNOWN Cint 14 +@const_ref MPI_ERR_TRUNCATE Cint 15 +@const_ref MPI_ERR_OTHER Cint 16 +@const_ref MPI_ERR_INTERN Cint 17 +@const_ref MPI_ERR_IN_STATUS Cint 18 +@const_ref MPI_ERR_PENDING Cint 19 +@const_ref MPI_ERR_ACCESS Cint 20 +@const_ref MPI_ERR_AMODE Cint 21 +@const_ref MPI_ERR_ASSERT Cint 22 +@const_ref MPI_ERR_BAD_FILE Cint 23 +@const_ref MPI_ERR_BASE Cint 24 +@const_ref MPI_ERR_CONVERSION Cint 25 +@const_ref MPI_ERR_DISP Cint 26 +@const_ref MPI_ERR_DUP_DATAREP Cint 27 +@const_ref MPI_ERR_FILE_EXISTS Cint 28 +@const_ref MPI_ERR_FILE_IN_USE Cint 29 +@const_ref MPI_ERR_FILE Cint 30 +@const_ref MPI_ERR_INFO_KEY Cint 31 +@const_ref MPI_ERR_INFO_NOKEY Cint 32 +@const_ref MPI_ERR_INFO_VALUE Cint 33 +@const_ref MPI_ERR_INFO Cint 34 +@const_ref MPI_ERR_IO Cint 35 +@const_ref MPI_ERR_KEYVAL Cint 36 +@const_ref MPI_ERR_LOCKTYPE Cint 37 +@const_ref MPI_ERR_NAME Cint 38 +@const_ref MPI_ERR_NO_MEM Cint 39 +@const_ref MPI_ERR_NOT_SAME Cint 40 +@const_ref MPI_ERR_NO_SPACE Cint 41 +@const_ref MPI_ERR_NO_SUCH_FILE Cint 42 +@const_ref MPI_ERR_PORT Cint 43 +@const_ref MPI_ERR_QUOTA Cint 44 +@const_ref MPI_ERR_READ_ONLY Cint 45 +@const_ref MPI_ERR_RMA_CONFLICT Cint 46 +@const_ref MPI_ERR_RMA_SYNC Cint 47 +@const_ref MPI_ERR_SERVICE Cint 48 +@const_ref MPI_ERR_SIZE Cint 49 +@const_ref MPI_ERR_SPAWN Cint 50 +@const_ref MPI_ERR_UNSUPPORTED_DATAREP Cint 51 +@const_ref MPI_ERR_UNSUPPORTED_OPERATION Cint 52 +@const_ref MPI_ERR_WIN Cint 53 +@const_ref MPI_T_ERR_MEMORY Cint 54 +@const_ref MPI_T_ERR_NOT_INITIALIZED Cint 55 +@const_ref MPI_T_ERR_CANNOT_INIT Cint 56 +@const_ref MPI_T_ERR_INVALID_INDEX Cint 57 +@const_ref MPI_T_ERR_INVALID_ITEM Cint 58 +@const_ref MPI_T_ERR_INVALID_HANDLE Cint 59 +@const_ref MPI_T_ERR_OUT_OF_HANDLES Cint 60 +@const_ref MPI_T_ERR_OUT_OF_SESSIONS Cint 61 +@const_ref MPI_T_ERR_INVALID_SESSION Cint 62 +@const_ref MPI_T_ERR_CVAR_SET_NOT_NOW Cint 63 +@const_ref MPI_T_ERR_CVAR_SET_NEVER Cint 64 +@const_ref MPI_T_ERR_PVAR_NO_STARTSTOP Cint 65 +@const_ref MPI_T_ERR_PVAR_NO_WRITE Cint 66 +@const_ref MPI_T_ERR_PVAR_NO_ATOMIC Cint 67 +@const_ref MPI_ERR_RMA_RANGE Cint 68 +@const_ref MPI_ERR_RMA_ATTACH Cint 69 +@const_ref MPI_ERR_RMA_FLAVOR Cint 70 +@const_ref MPI_ERR_RMA_SHARED Cint 71 +@const_ref MPI_T_ERR_INVALID Cint 72 +@const_ref MPI_T_ERR_INVALID_NAME Cint 73 +@const_ref MPI_ERR_PROC_ABORTED Cint 74 +@const_ref MPI_ERR_PROC_FAILED Cint 75 +@const_ref MPI_ERR_PROC_FAILED_PENDING Cint 76 +@const_ref MPI_ERR_REVOKED Cint 77 + + +@const_ref MPI_LOCK_EXCLUSIVE Cint 1 +@const_ref MPI_LOCK_SHARED Cint 2 + + +@const_ref MPI_MODE_CREATE Cint 1 +@const_ref MPI_MODE_RDONLY Cint 2 +@const_ref MPI_MODE_WRONLY Cint 4 +@const_ref MPI_MODE_RDWR Cint 8 +@const_ref MPI_MODE_DELETE_ON_CLOSE Cint 16 +@const_ref MPI_MODE_UNIQUE_OPEN Cint 32 +@const_ref MPI_MODE_EXCL Cint 64 +@const_ref MPI_MODE_APPEND Cint 128 +@const_ref MPI_MODE_SEQUENTIAL Cint 256 + +@const_ref MPI_MODE_NOCHECK Cint 1 +@const_ref MPI_MODE_NOPRECEDE Cint 2 +@const_ref MPI_MODE_NOPUT Cint 4 +@const_ref MPI_MODE_NOSTORE Cint 8 +@const_ref MPI_MODE_NOSUCCEED Cint 16 + +@const_ref MPI_ORDER_C Cint 0 +@const_ref MPI_ORDER_FORTRAN Cint 1 + + +@const_ref MPI_SEEK_SET Cint 600 +@const_ref MPI_SEEK_CUR Cint 602 +@const_ref MPI_SEEK_END Cint 604 + +@const_ref MPI_THREAD_SINGLE Cint 0 +@const_ref MPI_THREAD_FUNNELED Cint 1 +@const_ref MPI_THREAD_SERIALIZED Cint 2 +@const_ref MPI_THREAD_MULTIPLE Cint 3 + +@const_ref MPI_TYPECLASS_INTEGER Cint 1 +@const_ref MPI_TYPECLASS_REAL Cint 2 +@const_ref MPI_TYPECLASS_COMPLEX Cint 3 + +@const_ref MPI_ARGV_NULL Ptr{Cvoid} C_NULL +@const_ref MPI_ARGVS_NULL Ptr{Cvoid} C_NULL + +@const_ref MPI_UNWEIGHTED Ptr{Cvoid} 2 +@const_ref MPI_WEIGHTS_EMPTY Ptr{Cvoid} 3 +@const_ref MPI_BOTTOM Ptr{Cvoid} 0 +@const_ref MPI_IN_PLACE Ptr{Cvoid} 1 + +@const_ref MPI_COMM_NULL MPI_Comm cglobal((:ompi_mpi_comm_null, libmpi)) +@const_ref MPI_COMM_SELF MPI_Comm cglobal((:ompi_mpi_comm_self, libmpi)) +@const_ref MPI_COMM_WORLD MPI_Comm cglobal((:ompi_mpi_comm_world, libmpi)) + +@const_ref MPI_COMM_DUP_FN MPI_Comm_copy_attr_function cglobal((:OMPI_C_MPI_COMM_DUP_FN, libmpi)) +@const_ref MPI_COMM_NULL_COPY_FN MPI_Comm_copy_attr_function cglobal((:OMPI_C_MPI_COMM_NULL_COPY_FN, libmpi)) +@const_ref MPI_COMM_NULL_DELETE_FN MPI_Comm_delete_attr_function cglobal((:OMPI_C_MPI_COMM_NULL_DELETE_FN, libmpi)) + +@const_ref MPI_DATATYPE_NULL MPI_Datatype cglobal((:ompi_mpi_datatype_null, libmpi)) + +@const_ref MPI_BYTE MPI_Datatype cglobal((:ompi_mpi_byte, libmpi)) +@const_ref MPI_PACKED MPI_Datatype cglobal((:ompi_mpi_packed, libmpi)) +@const_ref MPI_CHAR MPI_Datatype cglobal((:ompi_mpi_char, libmpi)) +@const_ref MPI_SHORT MPI_Datatype cglobal((:ompi_mpi_short, libmpi)) +@const_ref MPI_INT MPI_Datatype cglobal((:ompi_mpi_int, libmpi)) +@const_ref MPI_LONG MPI_Datatype cglobal((:ompi_mpi_long, libmpi)) +@const_ref MPI_FLOAT MPI_Datatype cglobal((:ompi_mpi_float, libmpi)) +@const_ref MPI_DOUBLE MPI_Datatype cglobal((:ompi_mpi_double, libmpi)) +# @const_ref MPI_LONG_DOUBLE MPI_Datatype cglobal((:ompi_mpi_long_double, libmpi)) +@const_ref MPI_UNSIGNED_CHAR MPI_Datatype cglobal((:ompi_mpi_unsigned_char, libmpi)) +@const_ref MPI_SIGNED_CHAR MPI_Datatype cglobal((:ompi_mpi_signed_char, libmpi)) +@const_ref MPI_UNSIGNED_SHORT MPI_Datatype cglobal((:ompi_mpi_unsigned_short, libmpi)) +@const_ref MPI_UNSIGNED_LONG MPI_Datatype cglobal((:ompi_mpi_unsigned_long, libmpi)) +@const_ref MPI_UNSIGNED MPI_Datatype cglobal((:ompi_mpi_unsigned, libmpi)) +@const_ref MPI_FLOAT_INT MPI_Datatype cglobal((:ompi_mpi_float_int, libmpi)) +@const_ref MPI_DOUBLE_INT MPI_Datatype cglobal((:ompi_mpi_double_int, libmpi)) +@const_ref MPI_LONG_DOUBLE_INT MPI_Datatype cglobal((:ompi_mpi_longdbl_int, libmpi)) +@const_ref MPI_LONG_INT MPI_Datatype cglobal((:ompi_mpi_long_int, libmpi)) +@const_ref MPI_SHORT_INT MPI_Datatype cglobal((:ompi_mpi_short_int, libmpi)) +@const_ref MPI_2INT MPI_Datatype cglobal((:ompi_mpi_2int, libmpi)) +@const_ref MPI_UB MPI_Datatype cglobal((:ompi_mpi_ub, libmpi)) +@const_ref MPI_LB MPI_Datatype cglobal((:ompi_mpi_lb, libmpi)) +@const_ref MPI_WCHAR MPI_Datatype cglobal((:ompi_mpi_wchar, libmpi)) +@const_ref MPI_LONG_LONG_INT MPI_Datatype cglobal((:ompi_mpi_long_long_int, libmpi)) +const MPI_LONG_LONG = MPI_LONG_LONG_INT +@const_ref MPI_UNSIGNED_LONG_LONG MPI_Datatype cglobal((:ompi_mpi_unsigned_long_long, libmpi)) +@const_ref MPI_2COMPLEX MPI_Datatype cglobal((:ompi_mpi_2cplex, libmpi)) +@const_ref MPI_2DOUBLE_COMPLEX MPI_Datatype cglobal((:ompi_mpi_2dblcplex, libmpi)) + +@const_ref MPI_INT8_T MPI_Datatype cglobal((:ompi_mpi_int8_t, libmpi)) +@const_ref MPI_UINT8_T MPI_Datatype cglobal((:ompi_mpi_uint8_t, libmpi)) +@const_ref MPI_INT16_T MPI_Datatype cglobal((:ompi_mpi_int16_t, libmpi)) +@const_ref MPI_UINT16_T MPI_Datatype cglobal((:ompi_mpi_uint16_t, libmpi)) +@const_ref MPI_INT32_T MPI_Datatype cglobal((:ompi_mpi_int32_t, libmpi)) +@const_ref MPI_UINT32_T MPI_Datatype cglobal((:ompi_mpi_uint32_t, libmpi)) +@const_ref MPI_INT64_T MPI_Datatype cglobal((:ompi_mpi_int64_t, libmpi)) +@const_ref MPI_UINT64_T MPI_Datatype cglobal((:ompi_mpi_uint64_t, libmpi)) +@const_ref MPI_AINT MPI_Datatype cglobal((:ompi_mpi_aint, libmpi)) +@const_ref MPI_OFFSET MPI_Datatype cglobal((:ompi_mpi_offset, libmpi)) +@const_ref MPI_C_BOOL MPI_Datatype cglobal((:ompi_mpi_c_bool, libmpi)) +@const_ref MPI_C_FLOAT_COMPLEX MPI_Datatype cglobal((:ompi_mpi_c_float_complex, libmpi)) +const MPI_C_COMPLEX = MPI_C_FLOAT_COMPLEX +@const_ref MPI_C_DOUBLE_COMPLEX MPI_Datatype cglobal((:ompi_mpi_c_double_complex, libmpi)) +# @const_ref MPI_C_LONG_DOUBLE_COMPLEX MPI_Datatype cglobal((:ompi_mpi_c_long_double_complex, libmpi)) +@const_ref MPI_COUNT MPI_Datatype cglobal((:ompi_mpi_count, libmpi)) + + +@const_ref MPI_ERRHANDLER_NULL MPI_Errhandler cglobal((:ompi_mpi_errhandler_null, libmpi)) +@const_ref MPI_ERRORS_ARE_FATAL MPI_Errhandler cglobal((:ompi_mpi_errors_are_fatal, libmpi)) +@const_ref MPI_ERRORS_RETURN MPI_Errhandler cglobal((:ompi_mpi_errors_return, libmpi)) +# @const_ref MPI_ERRORS_ABORT MPI_Errhandler cglobal((:ompi_mpi_errors_abort, libmpi)) + +@const_ref MPI_FILE_NULL MPI_File cglobal((:ompi_mpi_file_null, libmpi)) + +@const_ref MPI_GROUP_EMPTY MPI_Group cglobal((:ompi_mpi_group_empty, libmpi)) +@const_ref MPI_GROUP_NULL MPI_Group cglobal((:ompi_mpi_group_null, libmpi)) + +@const_ref MPI_INFO_ENV MPI_Info cglobal((:ompi_mpi_info_env, libmpi)) +@const_ref MPI_INFO_NULL MPI_Info cglobal((:ompi_mpi_info_null, libmpi)) + +@const_ref MPI_MESSAGE_NO_PROC MPI_Message cglobal((:ompi_message_no_proc, libmpi)) +@const_ref MPI_MESSAGE_NULL MPI_Message cglobal((:ompi_message_null, libmpi)) + +@const_ref MPI_DISPLACEMENT_CURRENT MPI_Offset -54278278 + +@const_ref MPI_OP_NULL MPI_Op cglobal((:ompi_mpi_op_null, libmpi)) +@const_ref MPI_MAX MPI_Op cglobal((:ompi_mpi_op_max, libmpi)) +@const_ref MPI_MIN MPI_Op cglobal((:ompi_mpi_op_min, libmpi)) +@const_ref MPI_SUM MPI_Op cglobal((:ompi_mpi_op_sum, libmpi)) +@const_ref MPI_PROD MPI_Op cglobal((:ompi_mpi_op_prod, libmpi)) +@const_ref MPI_LAND MPI_Op cglobal((:ompi_mpi_op_land, libmpi)) +@const_ref MPI_BAND MPI_Op cglobal((:ompi_mpi_op_band, libmpi)) +@const_ref MPI_LOR MPI_Op cglobal((:ompi_mpi_op_lor, libmpi)) +@const_ref MPI_BOR MPI_Op cglobal((:ompi_mpi_op_bor, libmpi)) +@const_ref MPI_LXOR MPI_Op cglobal((:ompi_mpi_op_lxor, libmpi)) +@const_ref MPI_BXOR MPI_Op cglobal((:ompi_mpi_op_bxor, libmpi)) +@const_ref MPI_MINLOC MPI_Op cglobal((:ompi_mpi_op_minloc, libmpi)) +@const_ref MPI_MAXLOC MPI_Op cglobal((:ompi_mpi_op_maxloc, libmpi)) +@const_ref MPI_REPLACE MPI_Op cglobal((:ompi_mpi_op_replace, libmpi)) +@const_ref MPI_NO_OP MPI_Op cglobal((:ompi_mpi_op_no_op, libmpi)) + +@const_ref MPI_REQUEST_NULL MPI_Request cglobal((:ompi_request_null, libmpi)) + +@const_ref MPI_STATUS_IGNORE Ptr{MPI_Status} C_NULL +@const_ref MPI_STATUSES_IGNORE Ptr{MPI_Status} C_NULL + +@const_ref MPI_TYPE_DUP_FN MPI_Comm_copy_attr_function cglobal((:OMPI_C_MPI_TYPE_DUP_FN, libmpi), MPI_Comm_copy_attr_function) +@const_ref MPI_TYPE_NULL_COPY_FN MPI_Type_copy_attr_function cglobal((:OMPI_C_MPI_TYPE_NULL_COPY_FN, libmpi), MPI_Comm_copy_attr_function) +@const_ref MPI_TYPE_NULL_DELETE_FN MPI_Type_delete_attr_function cglobal((:OMPI_C_MPI_TYPE_NULL_DELETE_FN, libmpi), MPI_Type_delete_attr_function) + +@const_ref MPI_WIN_NULL MPI_Win cglobal((:ompi_mpi_win_null, libmpi)) + +@const_ref MPI_WIN_DUP_FN MPI_Win_copy_attr_function cglobal((:OMPI_C_MPI_WIN_DUP_FN, libmpi), MPI_Win_copy_attr_function) +@const_ref MPI_WIN_NULL_COPY_FN MPI_Win_copy_attr_function cglobal((:OMPI_C_MPI_WIN_NULL_COPY_FN, libmpi), MPI_Win_copy_attr_function) +@const_ref MPI_WIN_NULL_DELETE_FN MPI_Win_delete_attr_function cglobal((:OMPI_C_MPI_WIN_NULL_DELETE_FN, libmpi), MPI_Win_delete_attr_function) diff --git a/src/datatypes.jl b/src/datatypes.jl index 9dc077fe4..dec8f4f2c 100644 --- a/src/datatypes.jl +++ b/src/datatypes.jl @@ -71,7 +71,7 @@ end # names function get_name(datatype::Datatype) - buffer = Array{UInt8}(undef, MPI_MAX_OBJECT_NAME) + buffer = Array{UInt8}(undef, Consts.MPI_MAX_OBJECT_NAME) lenref = Ref{Cint}() @mpichk ccall((:MPI_Type_get_name, libmpi), Cint, (MPI_Datatype, Ptr{UInt8}, Ptr{Cint}), @@ -118,7 +118,7 @@ for (mpiname, T) in [ :UNSIGNED => Cuint :LONG => Clong :UNSIGNED_LONG => Culong - :LONG_LONG => Clonglong + :LONG_LONG_INT => Clonglong :UNSIGNED_LONG_LONG => Culonglong :CHAR => Cchar :SIGNED_CHAR => Cchar diff --git a/src/environment.jl b/src/environment.jl index acd2b9f9d..f93be9e1a 100644 --- a/src/environment.jl +++ b/src/environment.jl @@ -21,10 +21,7 @@ hello world hello world ``` """ -function mpiexec(fn) - _mpiexec(cmd -> fn(`$cmd $(Base.shell_split(get(ENV, "JULIA_MPIEXEC_ARGS", "")))`)) -end - +mpiexec # Administrative functions function _warn_if_wrong_mpi() diff --git a/src/error.jl b/src/error.jl index 0a181c77e..43aa71f58 100644 --- a/src/error.jl +++ b/src/error.jl @@ -11,7 +11,7 @@ end function error_string(err::MPIError) len_ref = Ref{Cint}() - str_buf = Vector{UInt8}(undef, MPI_MAX_ERROR_STRING) + str_buf = Vector{UInt8}(undef, Consts.MPI_MAX_ERROR_STRING) # int MPI_Error_string(int errorcode, char *string, int *resultlen) @mpichk ccall((:MPI_Error_string, libmpi), Cint, (Cint, Ptr{UInt8}, Ref{Cint}), err.code, str_buf, len_ref) diff --git a/src/info.jl b/src/info.jl index 3f593d139..bbb60423b 100644 --- a/src/info.jl +++ b/src/info.jl @@ -56,7 +56,7 @@ end function Base.setindex!(info::Info, value::AbstractString, key::Symbol) skey = String(key) @assert isascii(skey) && isascii(value) && - length(skey) <= MPI_MAX_INFO_KEY && length(value) <= MPI_MAX_INFO_VAL + length(skey) <= Consts.MPI_MAX_INFO_KEY && length(value) <= Consts.MPI_MAX_INFO_VAL @mpichk ccall((:MPI_Info_set, libmpi), Cint, (MPI_Info, Cstring, Cstring), info, skey, value) end @@ -87,7 +87,7 @@ end function Base.getindex(info::Info, key::Symbol) skey = String(key) - @assert isascii(skey) && length(skey) <= MPI_MAX_INFO_KEY + @assert isascii(skey) && length(skey) <= Consts.MPI_MAX_INFO_KEY valuelen = Ref{Cint}() flag = Ref{Cint}() # int MPI_Info_get_valuelen(MPI_Info info, const char *key, int *valuelen, int *flag) @@ -115,7 +115,7 @@ end function Base.delete!(info::Info,key::Symbol) skey = String(key) - @assert isascii(skey) && length(skey) <= MPI_MAX_INFO_KEY + @assert isascii(skey) && length(skey) <= Consts.MPI_MAX_INFO_KEY @mpichk ccall((:MPI_Info_delete, libmpi), Cint, (MPI_Info, Cstring), info, skey) end @@ -131,7 +131,7 @@ function Base.length(info::Info) end function nthkey(info::Info, n::Integer) - buffer = Vector{UInt8}(undef, MPI_MAX_INFO_KEY+1) + buffer = Vector{UInt8}(undef, Consts.MPI_MAX_INFO_KEY+1) @mpichk ccall((:MPI_Info_get_nthkey, libmpi), Cint, (MPI_Info, Cint, Ptr{UInt8}), info, n, buffer) i = findfirst(isequal(UInt8(0)), buffer) diff --git a/src/io.jl b/src/io.jl index 5770207ed..dd858e17e 100644 --- a/src/io.jl +++ b/src/io.jl @@ -486,4 +486,35 @@ function get_position_shared(file::FileHandle) return r[] end +""" + MPI.File.get_atomicity(file::FileHandle) + +Get the consistency option for the `fh`. If `false` it is non-atomic. + +# External links +$(_doc_external("MPI_File_get_atomicity")) +""" +function get_atomicity(file::FileHandle) + r = Ref{Cint}() + # int MPI_File_get_atomicity(MPI_File fh, Int *flag) + @mpichk ccall((:MPI_File_get_atomicity, libmpi), Cint, + (MPI_File, Ptr{Cint}), file, r) + return r[] == 1 +end + +""" + MPI.File.set_atomicity(file::FileHandle, flag::Bool) + +Set the consitency option for the `fh`. + +# External links +$(_doc_external("MPI_File_get_atomicity")) +""" +function set_atomicity(file::FileHandle, flag::Bool) + # int MPI_File_set_atomicity(MPI_File fh, Int flag) + @mpichk ccall((:MPI_File_set_atomicity, libmpi), Cint, + (MPI_File, Cint), file, flag) + return nothing +end + end # module diff --git a/src/nonblocking.jl b/src/nonblocking.jl index f266656cc..07c573c19 100644 --- a/src/nonblocking.jl +++ b/src/nonblocking.jl @@ -14,7 +14,7 @@ number of entries received. """ const Status = MPI_Status -@eval const STATUS_ZERO = Status($([Cint(0) for i in 1:sizeof(Status) ÷ sizeof(Cint)]...)) +const STATUS_ZERO = Status(map(zero,fieldtypes(Status))...) function Base.getproperty(status::Status, name::Symbol) name ≡ :error && return status.MPI_ERROR diff --git a/test/Project.toml b/test/Project.toml new file mode 100644 index 000000000..8e7a1d404 --- /dev/null +++ b/test/Project.toml @@ -0,0 +1,7 @@ +[deps] +CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" +DoubleFloats = "497a8b3b-efae-58df-a0af-a86822472b78" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" +MPIPreferences = "3da0fdf6-3ccc-4f1b-acd9-58baa6c99267" +Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" +Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" diff --git a/test/runtests.jl b/test/runtests.jl index 302d2a222..4ca1c75c8 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,5 +1,7 @@ using Test, MPI +using MPIPreferences + # load test packages to trigger precompilation using DoubleFloats if get(ENV, "JULIA_MPI_TEST_ARRAYTYPE", "") == "CuArray" @@ -18,7 +20,14 @@ end nprocs_str = get(ENV, "JULIA_MPI_TEST_NPROCS", "") nprocs = nprocs_str == "" ? clamp(Sys.CPU_THREADS, 2, 4) : parse(Int, nprocs_str) -@info "Running MPI tests" ArrayType nprocs +@info "Running MPI tests" ArrayType nprocs MPIPreferences.abi MPIPreferences.binary + +if haskey(ENV,"JULIA_MPI_TEST_BINARY") + @test ENV["JULIA_MPI_TEST_BINARY"] == MPIPreferences.binary +end +if haskey(ENV,"JULIA_MPI_TEST_ABI") + @test ENV["JULIA_MPI_TEST_ABI"] == MPIPreferences.abi +end testdir = @__DIR__ istest(f) = endswith(f, ".jl") && startswith(f, "test_") diff --git a/test/test_io_shared.jl b/test/test_io_shared.jl index e949c504f..621f020de 100644 --- a/test/test_io_shared.jl +++ b/test/test_io_shared.jl @@ -20,6 +20,12 @@ MPI.Barrier(comm) fh = MPI.File.open(comm, filename, read=true, write=true, create=true) @test MPI.File.get_position_shared(fh) == 0 +if !MPI.File.get_atomicity(fh) + MPI.File.set_atomicity(fh, true) +end + +@test MPI.File.get_atomicity(fh) + MPI.Barrier(comm) MPI.File.sync(fh) diff --git a/test/test_shared_win.jl b/test/test_shared_win.jl index 9066c56a1..de2944df2 100644 --- a/test/test_shared_win.jl +++ b/test/test_shared_win.jl @@ -51,7 +51,7 @@ function main() @test all(shared_arr[:, 1] .== 1:100) @test all(shared_arr[:, 2] .== 901:1000) if node_rank <= 1 - len, elsize_bytes, baseptr = @test_deprecated MPI.Win_shared_query(win, owner_rank) + len, elsize_bytes, baseptr = MPI.Win_shared_query(Ptr{Float32}, win, owner_rank) @test elsize_bytes == sizeof(Float32) @test len == sizeof(shared_arr) @test baseptr == pointer(shared_arr)