From 389602fbe77f8b946c040fb152cd87fd41bcdf16 Mon Sep 17 00:00:00 2001 From: Alain Miniussi Date: Wed, 1 Aug 2018 14:18:57 +0200 Subject: [PATCH] Hide vector implementation. refs #62 and #67 --- include/boost/mpi/communicator.hpp | 65 +++++++++++++++--------------- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/include/boost/mpi/communicator.hpp b/include/boost/mpi/communicator.hpp index 2804d69..6e55b16 100644 --- a/include/boost/mpi/communicator.hpp +++ b/include/boost/mpi/communicator.hpp @@ -294,14 +294,6 @@ class BOOST_MPI_DECL communicator template void send(int dest, int tag, const std::vector& value) const; - template - void send_vector(int dest, int tag, const std::vector& value, - mpl::true_) const; - - template - void send_vector(int dest, int tag, const std::vector& value, - mpl::false_) const; - /** * @brief Send the skeleton of an object. * @@ -417,14 +409,6 @@ class BOOST_MPI_DECL communicator template status recv(int source, int tag, std::vector& value) const; - template - status recv_vector(int source, int tag, std::vector& value, - mpl::true_) const; - - template - status recv_vector(int source, int tag, std::vector& value, - mpl::false_) const; - /** * @brief Receive a skeleton from a remote process. * @@ -622,14 +606,6 @@ class BOOST_MPI_DECL communicator template request isend(int dest, int tag, const std::vector& values) const; - template - request isend_vector(int dest, int tag, const std::vector& values, - mpl::true_) const; - - template - request isend_vector(int dest, int tag, const std::vector& values, - mpl::false_) const; - /** * @brief Send a message to another process without any data * without blocking. @@ -717,14 +693,6 @@ class BOOST_MPI_DECL communicator template request irecv(int source, int tag, std::vector& values) const; - template - request irecv_vector(int source, int tag, std::vector& values, - mpl::true_) const; - - template - request irecv_vector(int source, int tag, std::vector& values, - mpl::false_) const; - /** * @brief Initiate receipt of a message from a remote process that * carries no data. @@ -1132,6 +1100,39 @@ class BOOST_MPI_DECL communicator request array_irecv_impl(int source, int tag, T* values, int n, mpl::false_) const; + // We're sending/receivig a vector with associated MPI datatype. + // We need to send/recv the size and then the data and make sure + // blocking and non blocking method agrees on the format. + template + request irecv_vector(int source, int tag, std::vector& values, + mpl::true_) const; + template + request isend_vector(int dest, int tag, const std::vector& values, + mpl::true_) const; + template + void send_vector(int dest, int tag, const std::vector& value, + mpl::true_) const; + template + status recv_vector(int source, int tag, std::vector& value, + mpl::true_) const; + + // We're sending/receivig a vector with no associated MPI datatype. + // We need to send/recv it as an archive and make sure + // blocking and non blocking method agrees on the format. + template + request irecv_vector(int source, int tag, std::vector& values, + mpl::false_) const; + template + request isend_vector(int dest, int tag, const std::vector& values, + mpl::false_) const; + template + void send_vector(int dest, int tag, const std::vector& value, + mpl::false_) const; + template + status recv_vector(int source, int tag, std::vector& value, + mpl::false_) const; + + protected: shared_ptr comm_ptr; };