ALPSCore reference
mpi_pair.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1998-2018 ALPS Collaboration. See COPYRIGHT.TXT
3  * All rights reserved. Use is subject to license terms. See LICENSE.TXT
4  * For use in publications, see ACKNOWLEDGE.TXT
5  */
6 
12 #ifndef ALPS_UTILITIES_MPI_PAIR_HPP_3acdc0894fa949d59f697673f81e1995
13 #define ALPS_UTILITIES_MPI_PAIR_HPP_3acdc0894fa949d59f697673f81e1995
14 
15 #include <utility> // for std::pair
16 #include <alps/utilities/mpi.hpp>
17 #include <string>
18 
19 #include <boost/container/vector.hpp>
20 
21 namespace alps {
22  namespace mpi {
23 
25  // FIXME!: make a test
26  // FIXME: what is exception safety status?
27  template <typename T>
28  inline void broadcast(const alps::mpi::communicator& comm, std::pair<std::string, T>& val, int root) {
30  broadcast(comm, val.first, root);
31  broadcast(comm, val.second, root);
32  }
33 
34  } // mpi::
35 } // alps::
36 
37 
38 #endif /* ALPS_UTILITIES_MPI_PAIR_HPP_3acdc0894fa949d59f697673f81e1995 */
Header for object-oriented interface to MPI (similar to boost::mpi)
Encapsulation of an MPI communicator and some communicator-related operations.
Definition: mpi.hpp:111
void broadcast(const communicator &comm, T *vals, std::size_t count, int root)
Broadcasts array vals of a primitive type T, length count on communicator comm with root root ...
Definition: mpi.hpp:270