Opened 8 years ago

#10977 new Feature Requests

Add functions for obtaining full MPI transfer info of variable

Reported by: ilja.j.honkonen@… Owned by: Matthias Troyer
Milestone: To Be Determined Component: mpi
Version: Boost 1.57.0 Severity: Problem
Keywords: Cc:

Description

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.

Change History (0)

Note: See TracTickets for help on using tickets.