[Boost-bugs] [Boost C++ Libraries] #10977: Add functions for obtaining full MPI transfer info of variable

Subject: [Boost-bugs] [Boost C++ Libraries] #10977: Add functions for obtaining full MPI transfer info of variable
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-01-28 18:40:00


#10977: Add functions for obtaining full MPI transfer info of variable
-------------------------------+---------------------
 Reporter: ilja.j.honkonen@… | Owner: troyer
     Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: mpi
  Version: Boost 1.57.0 | Severity: Problem
 Keywords: |
-------------------------------+---------------------
 I have a couple of MPI projects which duplicate functionality, so that
 neither depends on the other, for which boost::mpi would seem like a good
 place.

 In order to transfer something using MPI 3 pieces of info are required: 1)
 the starting address of data, 2) number of items (contiguous in memory) to
 send and 3) the (MPI) type of each item. As far as I can tell functions in
 boost::mpi only return the type but not the count nor the address of
 variables. I'd like to see this functionality in boost or add it myself if
 that's ok. For basic types the function would be e.g.:

 std::tuple<
   void*,
   int,
   MPI_Datatype
> get_mpi_transfer_info(const char& variable) {
   return std::make_tuple(
     (void*) &variable,
     1,
     MPI_CHAR
   );
 }


 For std types in contiguous containers only the count would differ
 (omitting error checking):

 std::tuple<
   void*,
   int,
   MPI_Datatype
> get_mpi_transfer_info(const std::vector<char>& variable) {
   return std::make_tuple(
     (void*) variable.data(),
     variable.size(),
     MPI_CHAR
   );
 }

 For non-standard types the function would try to use the types'
 get_mpi_transfer_info() member function. Here's one of my current
 implementations for this functionality (add missing h to beginning of
 link):
 ttps://github.com/nasailja/gensimcell/blob/master/source/get_var_mpi_datatype.hpp
 It can probably be shortened with better use of overloads, templates, etc.
 but should give a good idea of what I'm after.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/10977>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:17 UTC