Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
ae4b928
[cmake] Remove C as a project language
Wentzell Apr 19, 2024
1ade83c
[actions] Bump actions/cache restore/save to version 4
Wentzell Apr 23, 2024
8111352
[cmake] Bump Version number to 3.3
Wentzell May 14, 2024
f0f0789
Remove redundant sys.path insertion in conf.py.in
Wentzell May 14, 2024
3fb9b7a
fix exception
dominikkiese May 29, 2024
96110d2
[ghactions] Allow both unstable and release branch builds
Wentzell May 31, 2024
7978951
Squash app4triqs/3.3.x to reduce skeleton history when tracking
Wentzell Feb 17, 2022
80f1ebe
Fix serialization example
Wentzell Aug 7, 2024
6e2428e
[cmake] Update Cpp2Py branch to main and bump version req
Wentzell Aug 13, 2024
71dc824
Update example API to include serialization function
Wentzell Aug 14, 2024
b07a3de
[jenkins] For osx builds use gcc14 and python 3.12
Wentzell Sep 5, 2024
bbd45fb
[cmake] Set cmake policies to current cmake version
Wentzell Sep 6, 2024
6e48818
[jenkins] Synchronize jenkinsfile with triqs
Wentzell Sep 9, 2024
32342c7
[jenkins] For osx builds use gcc14 and python 3.12
Wentzell Sep 5, 2024
4ea86b4
[ghactions] Always build against respective TRIQS branch
Wentzell Sep 10, 2024
f63f2e4
[ghactions] Always build against respective TRIQS branch
Wentzell Sep 10, 2024
eb6a60c
Remove warnings on macOS
Thoemi09 Aug 12, 2024
391509d
Add duplicate and free functions to communicator
Thoemi09 Sep 9, 2024
187eb40
Generalize monitor class
Thoemi09 Sep 9, 2024
995b24e
Clean up the changes to monitor.hpp
Thoemi09 Sep 11, 2024
2e0d68a
Add warnings to the docs of split and duplicate in communicator.hpp
Thoemi09 Sep 11, 2024
f11a2f1
Duplicate/Free communicator in monitor class
Thoemi09 Sep 12, 2024
b05e968
Add tags to non-blocking send/recv in monitor.hpp
Thoemi09 Sep 12, 2024
86d6d7a
Apply code review changes to the monitor PR
Thoemi09 Sep 12, 2024
ab0533d
Fix debug check in mpi::monitor.root_check_nodes_and_bcast
Wentzell Sep 17, 2024
8fac2d1
Fix bugs in vector.hpp and add corresponding tests
Thoemi09 Sep 24, 2024
bfbee14
Make abort(int) in communicator const
Thoemi09 Sep 25, 2024
000863e
Make barrier(long) in communicator const
Thoemi09 Sep 26, 2024
6d268a3
Add check_mpi_call function and wrap all MPI calls in it
Thoemi09 Sep 26, 2024
7a99960
Add an all_equal function to generic_communication.hpp
Thoemi09 Sep 26, 2024
c3d525f
Update runner images and compiler version (#16)
Thoemi09 Sep 30, 2024
704343c
[ghactions] Update runner images and compiler version
Thoemi09 Sep 30, 2024
44e9e8e
Fix treatment of rvalues in mpi::all_equal implementation
Thoemi09 Oct 2, 2024
8d579dc
Add collective communications for general contiguous and sized ranges
Thoemi09 Sep 27, 2024
3407bfe
Update vector.hpp to use functions provided by ranges.hpp
Thoemi09 Sep 27, 2024
d263b48
Update string.hpp to use functions provided by ranges.hpp and impleme…
Thoemi09 Sep 27, 2024
4826d40
Add mpi_broadcast, mpi_reduce_in_place and mpi_reduce for std::array
Thoemi09 Sep 27, 2024
9e9a9ef
Clean up includes
Thoemi09 Oct 2, 2024
42d76f7
[doc] Update docs
Thoemi09 Sep 28, 2024
b246b6e
Update runner images and compiler version (#16)
Thoemi09 Sep 30, 2024
b70af52
[ghactions] For pull_request events use target branch name in the tri…
Wentzell Nov 15, 2024
7d6f6fc
Use universal references in generic communciations
Thoemi09 Nov 11, 2024
a22f9a8
[ghactions] Remove custom doxygen build and build docs on macos
Thoemi09 Nov 11, 2024
2621442
[cmake] Fix add_custom_commands to be compliant with cmake 3.31
Wentzell Nov 22, 2024
dcbaab5
[cmake] Fix add_custom_commands to be compliant with cmake 3.31
Wentzell Nov 22, 2024
8a06e32
[ghactions] Synchronize build.yml with nda
Wentzell Jan 30, 2025
35eeb64
Create custom mpi types for serializable custom types
Wentzell Feb 12, 2025
d61b2c6
Remove LDFLAGS from macos builds
Thoemi09 Mar 14, 2025
4d5e2f8
Update various broadcast routines
Thoemi09 Apr 2, 2025
053a31f
Update various reduce routines
Thoemi09 Apr 2, 2025
fa6350e
Update various scatter routines
Thoemi09 Apr 2, 2025
5146870
Update various gather routines
Thoemi09 Apr 2, 2025
0380007
Remove lazy.hpp
Thoemi09 Apr 2, 2025
b584c74
Some basic clean up and doc updates
Thoemi09 Apr 2, 2025
f0a1954
Additional tests for hybrid MPI + OpenMP for loop parallelization
Thoemi09 Apr 10, 2025
4eab58f
[jenkins] Run apt-get update before apt-get install
Wentzell Mar 26, 2025
13a3cfd
[cmake] Remove CPLUS_INCLUDE_VARS and LIBRARY_PATH from vars.sh.in, s…
Wentzell Apr 17, 2025
dfbe792
Remove CPLUS_INCLUDE_VARS and LIBRARY_PATH from modulefile.in, should…
Wentzell Apr 17, 2025
038f877
[doc] Remove redundant sphinx extension folder and adjust conf.py.in
Wentzell May 15, 2025
194a9f5
[cmake] Set LINK_DIRECTORIES for Project library target
Wentzell May 16, 2025
d3ba3d2
[cmake] Synchronize extract_flags.cmake file with triqs
Wentzell May 16, 2025
18d567a
[doc] Add FI support notice to README.md
Thoemi09 Jun 23, 2025
8343fcf
[ghactions] Update Ubuntu package list to use openblas over liblapack
Wentzell Jul 3, 2025
5d81dcc
[jenkins] Update gcc, hdf5, python version numbers for OSX build afte…
Wentzell Jul 15, 2025
23a56cd
Remove redundant Dockerfile.build
Wentzell Jul 16, 2025
502680b
[jenkins] update docker ns to match triqs
dylex Jul 25, 2025
1f6ada0
[jenkins] avoid hardlinks
dylex Jul 25, 2025
858d017
Fix broken link to TRIQS installation page
Thoemi09 Jul 24, 2025
a492857
Add numpydoc option to doc/conf.py.in
Thoemi09 Jul 24, 2025
16c286b
Simplify python module naming convention, regenerate module
Wentzell Jul 29, 2025
946005e
Synchronize Jenkins and GHActions Setup with unstable
Wentzell Aug 5, 2025
28f5ea2
[ghactions] Make sure that SDKROOT is set in OSX environment
Wentzell Aug 13, 2025
27dc673
[ghactions] Bump OSX and gcc version to 15
Wentzell Aug 13, 2025
a73e8a7
[ghactions] Use ninja for parallel builds, modernize and simplify bui…
Wentzell Aug 13, 2025
68e629e
[ghactions] avoid cache key collision for multiple attempts
hmenke Aug 14, 2025
e08a60f
[ghactions] Ninja already provided in osx build env
Wentzell Aug 20, 2025
ccaeb94
[ghactions] Link against brew's libc++ for macos + clang
Thoemi09 Sep 26, 2025
40fb488
Add .claude to gitignore
Wentzell Sep 29, 2025
8440f1a
Merge remote-tracking branch 'app4triqs/3.3.x' into DEV_APP4TRIQS_MERGE
Thoemi09 Sep 30, 2025
ba15956
Track app4triqs skeleton after squash
Thoemi09 Sep 30, 2025
4bc8378
Merge remote-tracking branch 'app4triqs/unstable' into DEV_APP4TRIQS_…
Thoemi09 Sep 30, 2025
bf9cac7
Merge pull request #29 from Thoemi09/DEV_APP4TRIQS_MERGE
Wentzell Sep 30, 2025
590799e
Add MPI one-sided communication with windows, groups, and shared memory
hmenke Sep 26, 2023
000ae1e
Refactor MPI wrappers: standardize naming, improve docs, add error ch…
Thoemi09 May 7, 2025
b7d152b
Add a multi-node CI job for MPI Shared Memory
hmenke Jul 10, 2025
0375e3c
Fix window::size() semantics, standardize comm_ naming, simplify tests
Wentzell Oct 1, 2025
c81cc8a
get() and put() only make sense on the same rank without MPI
hmenke Oct 7, 2025
f9348d2
Fix issue #30: Adjust oversubscribe by using mpi library version chec…
Wentzell Oct 13, 2025
ab99ca4
Add MPI support for std::optional
Wentzell Dec 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 51 additions & 58 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: build

on:
push:
branches: [ unstable ]
branches: [ unstable, '[0-9]+.[0-9]+.x' ]
pull_request:
branches: [ unstable ]
branches: [ unstable, '[0-9]+.[0-9]+.x' ]
workflow_call:
workflow_dispatch:

Expand All @@ -25,107 +25,100 @@ jobs:
strategy:
fail-fast: false
matrix:
include:
- {os: ubuntu-22.04, cc: gcc-12, cxx: g++-12, doc: OFF}
- {os: ubuntu-22.04, cc: clang-15, cxx: clang++-15, doc: ON}
- {os: macos-12, cc: gcc-12, cxx: g++-12, doc: OFF}
- {os: macos-12, cc: clang, cxx: clang++, doc: OFF}
os: [ubuntu-24.04, macos-15]
cxx: [g++, clang++]

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

steps:
- uses: actions/checkout@v4

- uses: actions/cache/restore@v3
- uses: actions/cache/restore@v4
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ matrix.os }}-${{ matrix.cc }}-${{ github.run_id }}
restore-keys:
ccache-${{ matrix.os }}-${{ matrix.cc }}-
key: ccache-${{ matrix.os }}-${{ matrix.cxx }}-${{ github.run_id }}-${{ github.run_attempt }}
restore-keys: |
ccache-${{ matrix.os }}-${{ matrix.cxx }}-

- name: Set cxx variables
run: |
if [[ ${{ matrix.os }} == 'macos-15' && ${{ matrix.cxx }} == 'g++' ]]; then
echo "CXX=g++-15" >> $GITHUB_ENV
else
echo "CXX=${{ matrix.cxx }}" >> $GITHUB_ENV
fi

- name: Install ubuntu dependencies
if: matrix.os == 'ubuntu-22.04'
if: ${{ contains(matrix.os, 'ubuntu') }}
run: >
sudo apt-get update &&
sudo apt-get install lsb-release wget software-properties-common &&
wget -O /tmp/llvm.sh https://apt.llvm.org/llvm.sh && sudo chmod +x /tmp/llvm.sh && sudo /tmp/llvm.sh 15 &&
sudo apt-get install
ccache
clang-15
g++-12
cmake
ninja-build
clang
clang-tools
g++
gfortran
hdf5-tools
libblas-dev
libclang-15-dev
libc++-15-dev
libc++abi-15-dev
libomp-15-dev
libboost-dev
libclang-dev
libc++-dev
libc++abi-dev
libomp-dev
libfftw3-dev
libgfortran5
libgmp-dev
libhdf5-dev
liblapack-dev
libopenblas-dev
libopenmpi-dev
openmpi-bin
openmpi-common
openmpi-doc
python3-clang-15
python3-clang
python3-dev
python3-mako
python3-mpi4py
python3-numpy
python3-pip
python3-scipy
python3-sphinx
python3-nbsphinx
python3-ipython

- name: Install homebrew dependencies
if: matrix.os == 'macos-12'
- name: Set up virtualenv
run: |
brew install ccache gcc@12 llvm hdf5 open-mpi openblas
mkdir $HOME/.venv
python3 -m venv $HOME/.venv/my_python
mkdir -p $HOME/.venv
python3 -m venv --system-site-packages $HOME/.venv/my_python
source $HOME/.venv/my_python/bin/activate
pip install mako numpy scipy mpi4py
pip install -r requirements.txt
echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV
echo "PATH=$PATH" >> $GITHUB_ENV

- name: Build doxygen
if: matrix.doc == 'ON'
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
LIBRARY_PATH: /usr/local/opt/llvm/lib
- name: Install homebrew dependencies
if: ${{ contains(matrix.os, 'macos') }}
run: |
cd $HOME
git clone https://github.com/doxygen/doxygen.git
cd doxygen
git checkout 0a7e79813
mkdir build
cd build
cmake .. -Duse_libclang=ON -Dstatic_libclang=ON -Duse_libc++=OFF -DLLVM_ROOT=/usr/lib/llvm-15/lib/cmake/llvm -DClang_ROOT=/usr/lib/llvm-15/lib/cmake/clang
make -j 2 VERBOSE=1
cp bin/doxygen /usr/local/bin/doxygen
brew update
brew install ccache gcc llvm hdf5 open-mpi openblas doxygen
pip install mako numpy scipy mpi4py
pip install -r requirements.txt
echo "PATH=$(brew --prefix llvm)/bin:$(brew --prefix gcc)/bin:$PATH" >> $GITHUB_ENV
echo "PYTHONPATH=$(brew --prefix llvm)/lib/python3.13/site-packages" >> $GITHUB_ENV
echo "SDKROOT=$(xcrun --show-sdk-path)" >> $GITHUB_ENV
echo "LDFLAGS=-L$(brew --prefix llvm)/lib/c++ -L/opt/homebrew/opt/llvm/lib/unwind -lunwind" >> $GITHUB_ENV

- name: add clang cxxflags
if: ${{ contains(matrix.cxx, 'clang') }}
- name: Add clang CXXFLAGS
if: ${{ matrix.cxx == 'clang++' }}
run: |
echo "PATH=/usr/local/opt/llvm/bin:$PATH" >> $GITHUB_ENV
echo "CXXFLAGS=-stdlib=libc++" >> $GITHUB_ENV

- name: Build mpi
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
LIBRARY_PATH: /usr/local/opt/llvm/lib
BUILD_DOXYGEN_DOCS: ${{ matrix.os == 'macos-15' && matrix.cxx == 'clang++' && 'ON' || 'OFF' }}
run: |
mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/install -DBuild_Documentation=${{ matrix.doc }}
make -j2 || make -j1 VERBOSE=1
cmake -S . -B build -G Ninja -DCMAKE_INSTALL_PREFIX=$HOME/install -DBuild_Documentation=$BUILD_DOXYGEN_DOCS
cmake --build build --verbose

- name: Test mpi
env:
DYLD_FALLBACK_LIBRARY_PATH: /usr/local/opt/llvm/lib
OPENBLAS_NUM_THREADS: "1"
run: |
cd build
Expand All @@ -135,14 +128,14 @@ jobs:
if: always()
run: ccache -sv

- uses: actions/cache/save@v3
- uses: actions/cache/save@v4
if: always()
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ matrix.os }}-${{ matrix.cc }}-${{ github.run_id }}
key: ccache-${{ matrix.os }}-${{ matrix.cxx }}-${{ github.run_id }}-${{ github.run_attempt }}

- name: Deploy documentation
if: matrix.doc == 'ON' && github.ref == 'refs/heads/unstable'
if: matrix.os == 'macos-15' && matrix.cxx == 'clang++' && github.ref == 'refs/heads/unstable'
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build/doc/html
Expand Down
88 changes: 88 additions & 0 deletions .github/workflows/build_multi_node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: build_multi_node

on:
push:
branches: [ unstable, '[0-9]+.[0-9]+.x' ]
pull_request:
branches: [ unstable, '[0-9]+.[0-9]+.x' ]
workflow_call:
workflow_dispatch:

env:
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
CCACHE_COMPILERCHECK: content
CCACHE_BASEDIR: ${{ github.workspace }}
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_MAXSIZE: 500M
CCACHE_SLOPPINESS: pch_defines,time_macros,include_file_mtime,include_file_ctime
CCACHE_COMPRESS: "1"
CCACHE_COMPRESSLEVEL: "1"

jobs:
build_multi_node:

strategy:
fail-fast: false

runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4

- uses: actions/cache/restore@v4
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ matrix.os }}-${{ matrix.cc }}-${{ github.run_id }}-${{ github.run_attempt }}
restore-keys: |
ccache-${{ matrix.os }}-${{ matrix.cc }}-

- name: Install ubuntu dependencies
run: >
sudo apt-get update && sudo apt-get install ccache

- name: Build and start Docker Compose
run: |
docker compose build
docker compose up -d
working-directory: .github/workflows/docker

- name: Compile MPI inside the container
run: |
docker exec -t -u runner -w ${{ github.workspace }} docker-vm-1 /bin/bash -euxc '
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=$HOME/install -DBuild_Documentation=Off
cmake --build build/ -j2
'

- name: Run tests inside the container
run: |
docker exec -t -u runner -w ${{ github.workspace }} docker-vm-1 /bin/bash -euxc '
export CTEST_OUTPUT_ON_FAILURE=1
cmake --build build/ --target test
'

- name: Run multi-node window tests
run: |
docker exec -t -u runner -w ${{ github.workspace }} docker-vm-1 /bin/bash -euxc '
cat <<EOF | tee hostfile
docker-vm-1 slots=3
docker-vm-2 slots=1
docker-vm-3 slots=2
EOF

# Test the communication
mpirun -hostfile ./hostfile /bin/bash -c "env | grep \"^OMPI_COMM_.*_RANK\""

# Run the actual test
mpirun -hostfile ./hostfile build/test/c++/mpi_window
'

- name: ccache statistics
if: always()
run: ccache -sv

- uses: actions/cache/save@v4
if: always()
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ matrix.os }}-${{ matrix.cc }}-${{ github.run_id }}-${{ github.run_attempt }}
26 changes: 26 additions & 0 deletions .github/workflows/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM ubuntu:24.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
ca-certificates \
build-essential \
ccache \
cmake \
g++ \
git \
libopenmpi-dev \
openmpi-bin \
openssh-server \
&& rm -rf /var/cache/apt /var/lib/apt/lists
RUN useradd -m runner \
&& passwd -d runner \
&& mkdir -pm0755 /run/sshd \
&& echo "PermitRootLogin yes" >> /etc/ssh/sshd_config.d/99-insecure.conf \
&& echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config.d/99-insecure.conf \
&& echo "PermitEmptyPasswords yes" >> /etc/ssh/sshd_config.d/99-insecure.conf \
&& echo "StrictHostKeyChecking no" >> /etc/ssh/ssh_config.d/99-insecure.conf \
&& echo "LogLevel ERROR" >> /etc/ssh/ssh_config.d/99-insecure.conf
ENV OMPI_MCA_btl_vader_single_copy_mechanism=none
ENV OMPI_MCA_osc=sm,pt2pt
ENV OMPI_MCA_rmaps_base_oversubscribe=yes
CMD ["/usr/sbin/sshd", "-D"]
20 changes: 20 additions & 0 deletions .github/workflows/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
services:
vm:
build: .
deploy:
mode: replicated
replicas: 3
environment:
CMAKE_C_COMPILER_LAUNCHER: ${CMAKE_C_COMPILER_LAUNCHER:-ccache}
CMAKE_CXX_COMPILER_LAUNCHER: ${CMAKE_CXX_COMPILER_LAUNCHER:-ccache}
CCACHE_COMPILERCHECK: ${CCACHE_COMPILERCHECK:-content}
CCACHE_BASEDIR: ${CCACHE_BASEDIR}
CCACHE_DIR: ${CCACHE_DIR:-${CCACHE_BASEDIR}/.ccache}
CCACHE_MAXSIZE: ${CCACHE_MAXSIZE:-500M}
CCACHE_SLOPPINESS: ${CCACHE_SLOPPINESS:-pch_defines,time_macros,include_file_mtime,include_file_ctime}
CCACHE_COMPRESS: ${CCACHE_COMPRESS:-1}
CCACHE_COMPRESSLEVEL: ${CCACHE_COMPRESSLEVEL:-1}
stdin_open: true
tty: true
volumes:
- ${CCACHE_BASEDIR}:${CCACHE_BASEDIR}:z
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ compile_commands.json
doc/_autosummary
doc/cpp2rst_generated
doc/html
.claude
build/
5 changes: 1 addition & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@
# Authors: Philipp Dumitrescu, Olivier Parcollet, Dylan Simon, Nils Wentzell

cmake_minimum_required(VERSION 3.20 FATAL_ERROR)
cmake_policy(VERSION 3.20)
if(POLICY CMP0144)
cmake_policy(SET CMP0144 NEW)
endif()
cmake_policy(VERSION ${CMAKE_VERSION})

# ############
# Define Project
Expand Down
21 changes: 0 additions & 21 deletions Dockerfile.build

This file was deleted.

10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,13 @@ mpi is a high-level C++ interface to the [Message Passing Interface](https://en.
A reference documentation based on [Doxygen](https://www.doxygen.nl) is provided at [triqs.github.io/mpi](https://triqs.github.io/mpi).

For usage examples we refer the users to our [tests](https://github.com/TRIQS/mpi/tree/unstable/test/c++).

## Support

<picture>
<source media="(prefers-color-scheme: dark)" width="20%" srcset="doc/_static/CCQ-dark.png">
<img alt="Flatiron Center for Computational Quantum Physics logo." width="20%" src="doc/_static/CCQ.png">
</picture>

TRIQS/mpi is supported by the Flatiron Institute, a division of the Simons Foundation.

9 changes: 5 additions & 4 deletions c++/mpi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ target_link_libraries(${PROJECT_NAME}_c INTERFACE itertools::itertools_c)
message(STATUS "-------- MPI detection -------------")

set(MPI_CXX_SKIP_MPICXX TRUE CACHE BOOL "If true, the MPI-2 C++ bindings are disabled using definitions.")
set(MPI_DETERMINE_LIBRARY_VERSION TRUE)
find_package(MPI REQUIRED COMPONENTS CXX)

# Create an interface target
Expand All @@ -51,11 +52,11 @@ if(NOT MPIEXEC_EXECUTABLE)
set(MPIEXEC_EXECUTABLE ${MPIEXEC} CACHE FILENAME "MPI Executable")
endif()

# Compatibility to Open-MPI 3.0.0: check whether MPI executable has option --oversubscribe and add it
execute_process(COMMAND ${MPIEXEC_EXECUTABLE} --oversubscribe ${MPIEXEC_NUMPROC_FLAG} 4 ${MPIEXEC_PREFLAGS} ls ${MPIEXEC_POSTFLAGS} RESULT_VARIABLE HAS_NO_OVERSUBSCRIBE OUTPUT_QUIET ERROR_QUIET)
if(NOT HAS_NO_OVERSUBSCRIBE)
# Open-MPI 3.0+ requires --oversubscribe flag
if(MPI_CXX_LIBRARY_VERSION_STRING MATCHES "Open MPI v([0-9]+)" AND CMAKE_MATCH_1 GREATER_EQUAL 3)
message(STATUS "MPI Version: ${MPI_CXX_LIBRARY_VERSION_STRING}")
list(APPEND MPIEXEC_PREFLAGS --oversubscribe)
set(MPIEXEC_PREFLAGS ${MPIEXEC_PREFLAGS} CACHE STRING "These flags will be directly before the executable that is being run by mpiexec." FORCE)
set(MPIEXEC_PREFLAGS ${MPIEXEC_PREFLAGS} CACHE STRING "Flags to pass to mpiexec directly before the executable to run." FORCE)
endif()

# ========= Static Analyzer Checks ==========
Expand Down
Loading
Loading