46 template <
typename T, T (*F)(T const &, T const &)> MPI_Op
map_C_function() {
48 MPI_User_function *map_function = +[](
void *in,
void *inout,
int *len, MPI_Datatype *) {
49 auto *inT =
static_cast<T *
>(in);
50 auto *inoutT =
static_cast<T *
>(inout);
51 for (
int i = 0; i < *len; ++i, ++inT, ++inoutT) { *inoutT = F(*inoutT, *inT); }
53 check_mpi_call(MPI_Op_create(map_function,
true, &myOp),
"MPI_Op_create");