22 #ifndef UTILIB_MPIPROXY_HPP_
23 #define UTILIB_MPIPROXY_HPP_
24 #include <UtilLib/config.hpp>
25 #include <UtilLib/include/Log.hpp>
26 #include <UtilLib/include/Exception.hpp>
27 #include <UtilLib/include/Singleton.hpp>
29 #include <boost/mpi/collectives.hpp>
30 #include <boost/mpi/communicator.hpp>
31 #include <boost/mpi/nonblocking.hpp>
32 #include <boost/mpi/request.hpp>
33 namespace mpi = boost::mpi;
104 template <
typename T>
108 const T& value)
const;
124 static std::vector<boost::mpi::request> _mpiStatus;
138 template <
typename T>
143 mpi::communicator world;
144 boost::mpi::broadcast(world, value, root);
148 template <
typename T>
154 mpi::communicator world;
155 _mpiStatus.push_back(world.irecv(source, tag, value));
156 LOG(utilities::logDEBUG4) <<
"recv source: " << source <<
"; tag: " <<
157 tag <<
"; value: " << value;
163 template <
typename T>
167 const T& value)
const {
169 mpi::communicator world;
170 _mpiStatus.push_back(world.isend(dest, tag, value));
171 LOG(utilities::logDEBUG4) <<
"send destination: " << dest <<
"; tag: " <<
172 tag <<
"; value: " << value;
A class to handle all MPI related code. It also provides works if MPI is disabled.
void broadcast(T &value, int root)
void irecv(int source, int tag, T &value) const
void isend(int dest, int tag, const T &value) const