53 template <MemoryGf G>
void mpi_broadcast(G &&g, mpi::communicator c,
int root) {
54 constexpr bool is_view = std::decay_t<G>::is_view;
59 mpi::broadcast(g._mesh, c, root);
63 mpi::broadcast(m, c, root);
64 EXPECTS(m.mesh_hash() == g.mesh().mesh_hash());
68 mpi::broadcast(g.data(), c, root);
97 template <MemoryGf G1, MemoryGf G2>
99 int root,
bool all, MPI_Op op) {
100 constexpr bool is_view = std::decay_t<G2>::is_view;
103 EXPECTS(mpi::all_equal(g_in.mesh().mesh_hash(), c));
106 if (c.rank() == root || all) {
108 EXPECTS(g_in.mesh().mesh_hash() == g_out.mesh().mesh_hash());
110 g_out._mesh = g_in.mesh();
115 mpi::reduce_into(g_in.data(), g_out.data(), c, root, all, op);
138 template <MemoryGf G>
auto mpi_reduce(G
const &g, mpi::communicator c = {},
int root = 0,
bool all =
false, MPI_Op op = MPI_SUM) {
139 auto res =
typename G::regular_type{};
Provides the Green's function class.
void mpi_broadcast(BG &&bg, mpi::communicator c={}, int root=0)
Implementation of an MPI broadcast for triqs::gfs::block_gf and triqs::gfs::block_gf_view types.
void mpi_reduce_into(BG1 const &bg_in, BG2 &&bg_out, mpi::communicator c={}, int root=0, bool all=false, MPI_Op op=MPI_SUM)
Implementation of an MPI reduce for triqs::gfs::block_gf and triqs::gfs::block_gf_view types that red...
auto mpi_reduce(BG const &bg, mpi::communicator c={}, int root=0, bool all=false, MPI_Op op=MPI_SUM)
Implementation of an MPI reduce for triqs::gfs::block_gf and triqs::gfs::block_gf_view types.
Common macros used in TRIQS.
Trait that detects view types by checking for inheritance from is_view_tag.