Fixup

parent b9b83aba
......@@ -22,17 +22,6 @@
namespace unsafe_mpi {
template <typename T, typename transmit_type=uint64_t>
static void allgatherv(const boost::mpi::communicator &comm, const std::vector<T> &in, std::vector<T> &out) {
// Trivial (enough) datatypes can be transmit directly via MPI_Allgatherv
// For all others, we have to serialize them using boost::serialize
if (is_trivial_enough<T>::value) {
allgatherv_unsafe<T, transmit_type>(comm, in, out);
} else {
allgatherv_serialize<T>(comm, in, out);
}
}
template <typename T>
static void allgatherv_serialize(const boost::mpi::communicator &comm, const std::vector<T> &in, std::vector<T> &out) {
// Step 1: serialize input data
......@@ -129,5 +118,15 @@ static void allgatherv_unsafe(const boost::mpi::communicator &comm, const std::v
}
}
template <typename T, typename transmit_type=uint64_t>
static void allgatherv(const boost::mpi::communicator &comm, const std::vector<T> &in, std::vector<T> &out) {
// Trivial (enough) datatypes can be transmit directly via MPI_Allgatherv
// For all others, we have to serialize them using boost::serialize
if (is_trivial_enough<T>::value) {
allgatherv_unsafe<T, transmit_type>(comm, in, out);
} else {
allgatherv_serialize<T>(comm, in, out);
}
}
}
......@@ -74,7 +74,7 @@ void broadcast(const boost::mpi::communicator &comm, std::vector<T> &data, int r
ia.resize(archive_size);
// Receive broadcast archive data
auto recvptr = ia.address();
MPI_Bcast(recvptr, archive_size, MPI_PACKED, root, comm);
int status = MPI_Bcast(recvptr, archive_size, MPI_PACKED, root, comm);
if (status != 0) {
ERR << "MPI_Bcast returned non-zero value " << status
<< ", errno: " << errno << std::endl;
......
......@@ -13,7 +13,7 @@
#include <boost/mpi/packed_iarchive.hpp>
#include <boost/mpi/packed_oarchive.hpp>
#Include <boost/serialization/string.hpp>
#include <boost/serialization/string.hpp>
#include <boost/serialization/utility.hpp>
#include <boost/serialization/vector.hpp>
......@@ -21,16 +21,6 @@
namespace unsafe_mpi {
template <typename T, typename transmit_type = uint64_t>
static void gatherv(const boost::mpi::communicator &comm, const std::vector<T> &in, std::vector<T> &out, const int root) {
if (is_trivial_enough<T>::value) {
gatherv_trivial<T, transmit_type>(comm, in, out, root);
} else {
gatherv_serialize<T>(comm, in, out, root);
}
}
template <typename T, typename transmit_type = uint64_t>
static void gatherv_trivial(const boost::mpi::communicator &comm,
const std::vector<T> &in, std::vector<T> &out,
......@@ -153,4 +143,14 @@ static void gatherv_serialize(const boost::mpi::communicator &comm, const std::v
}
template <typename T, typename transmit_type = uint64_t>
static void gatherv(const boost::mpi::communicator &comm, const std::vector<T> &in, std::vector<T> &out, const int root) {
if (is_trivial_enough<T>::value) {
gatherv_trivial<T, transmit_type>(comm, in, out, root);
} else {
gatherv_serialize<T>(comm, in, out, root);
}
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment