TRIQS/mpi 1.3.0
C++ interface to MPI
Loading...
Searching...
No Matches
lazy.hpp
Go to the documentation of this file.
1// Copyright (c) 2024 Simons Foundation
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0.txt
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Authors: Thomas Hahn, Alexander Hampel, Olivier Parcollet, Nils Wentzell
16
22#pragma once
23
24#include "./communicator.hpp"
25
26#include <mpi.h>
27
28namespace mpi {
29
30 namespace tag {
31
36 struct reduce {};
37
42 struct scatter {};
43
48 struct gather {};
49
50 } // namespace tag
51
63 template <typename Tag, typename T> struct lazy {
65 T rhs;
66
69
71 int root{};
72
74 bool all{};
75
77 MPI_Op op{};
78 };
79
84 template <typename T> inline constexpr bool is_mpi_lazy = false;
85
92 template <typename Tag, typename T> inline constexpr bool is_mpi_lazy<lazy<Tag, T>> = true;
93
96} // namespace mpi
C++ wrapper around MPI_Comm providing various convenience functions.
Provides a C++ wrapper class for an MPI_Comm object.
constexpr bool is_mpi_lazy
Type trait to check if a type is mpi::lazy.
Definition lazy.hpp:84
Represents a lazy MPI communication.
Definition lazy.hpp:63
bool all
Whether to use the MPI_Allxxx operation.
Definition lazy.hpp:74
int root
Rank of the root process.
Definition lazy.hpp:71
communicator c
mpi::communicator used in the lazy communication.
Definition lazy.hpp:68
T rhs
Object to be communicated.
Definition lazy.hpp:65
MPI_Op op
MPI_Op used in the lazy communication (only relevant if mpi::tag::reduce is used).
Definition lazy.hpp:77
Tag to specify a lazy MPI gather call.
Definition lazy.hpp:48
Tag to specify a lazy MPI reduce call.
Definition lazy.hpp:36
Tag to specify a lazy MPI scatter call.
Definition lazy.hpp:42