Exemplo n.º 1
0
 typename std::enable_if<
     boost::proto::matches<
         typename boost::proto::result_of::as_expr<Expr>::type,
         mpi_vector_expr_grammar
     >::value,
     const vector&
 >::type
 operator=(const Expr &expr) {
     (*local_data) = extract_local_expression()(boost::proto::as_child(expr));
     return *this;
 }
Exemplo n.º 2
0
        typename std::enable_if<
            boost::proto::matches<Expr, mpi_vector_expr_grammar>::value, T
        >::type
        operator()(const Expr &expr) const {
            T local = reduce(extract_local_expression()(boost::proto::as_child(expr)));
            T global;

            MPI_Allreduce(&local, &global, 1,
                    mpi_type<T>(), mpi_reduce_op<RDC>(), mpi.comm);

            return global;
        }
Exemplo n.º 3
0
        typename std::enable_if<
            boost::proto::matches<Expr, mpi_multivector_expr_grammar>::value,
            std::array<T, boost::result_of<mutltiex_dimension(Expr)>::type::value>
        >::type
        operator()(const Expr &expr) const {
            std::array<T, boost::result_of<mutltiex_dimension(Expr)>::type::value>
                local = reduce(extract_local_expression()(boost::proto::as_child(expr))),
                global;

            MPI_Allreduce(local.data(), global.data(), boost::result_of<mutltiex_dimension(Expr)>::type::value,
                    mpi_type<T>(), mpi_reduce_op<RDC>(), mpi.comm);

            return global;
        }