本文整理匯總了C++中BOOST_MPI_CHECK_RESULT函數的典型用法代碼示例。如果您正苦於以下問題:C++ BOOST_MPI_CHECK_RESULT函數的具體用法?C++ BOOST_MPI_CHECK_RESULT怎麽用?C++ BOOST_MPI_CHECK_RESULT使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了BOOST_MPI_CHECK_RESULT函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: get_mpi_datatype
// create and return the custom MPI data type
MPI_Datatype get_mpi_datatype()
{
if (!is_committed)
{
#if defined(MPI_VERSION) && MPI_VERSION >= 2
BOOST_MPI_CHECK_RESULT(MPI_Type_create_struct,
(
addresses.size(),
boost::serialization::detail::get_data(lengths),
boost::serialization::detail::get_data(addresses),
boost::serialization::detail::get_data(types),
&datatype_
));
#else
BOOST_MPI_CHECK_RESULT(MPI_Type_struct,
(
addresses.size(),
boost::serialization::detail::get_data(lengths),
boost::serialization::detail::get_data(addresses),
boost::serialization::detail::get_data(types),
&datatype_
));
#endif
BOOST_MPI_CHECK_RESULT(MPI_Type_commit,(&datatype_));
is_committed = true;
}
return datatype_;
}
示例2: mpi_datatype_primitive
mpi_datatype_primitive(void const* orig)
: is_committed(false),
origin()
{
#if defined(MPI_VERSION) && MPI_VERSION >= 2
BOOST_MPI_CHECK_RESULT(MPI_Get_address,(const_cast<void*>(orig), &origin));
#else
BOOST_MPI_CHECK_RESULT(MPI_Address,(const_cast<void*>(orig), &origin));
#endif
}
示例3: save_impl
void save_impl(void const * p, MPI_Datatype t, int l)
{
BOOST_ASSERT ( !is_committed );
// store address, type and length
MPI_Aint a;
#if defined(MPI_VERSION) && MPI_VERSION >= 2
BOOST_MPI_CHECK_RESULT(MPI_Get_address,(const_cast<void*>(p), &a));
#else
BOOST_MPI_CHECK_RESULT(MPI_Address,(const_cast<void*>(p), &a));
#endif
addresses.push_back(a-origin);
types.push_back(t);
lengths.push_back(l);
}
示例4: BOOST_MPI_CHECK_RESULT
bool communicator::has_cartesian_topology() const
{
int status;
BOOST_MPI_CHECK_RESULT(MPI_Topo_test, ((MPI_Comm)*this, &status));
return status == MPI_CART;
}
示例5: switch
communicator::communicator(const MPI_Comm& comm, comm_create_kind kind)
{
if (comm == MPI_COMM_NULL)
/* MPI_COMM_NULL indicates that the communicator is not usable. */
return;
switch (kind) {
case comm_duplicate:
{
MPI_Comm newcomm;
BOOST_MPI_CHECK_RESULT(MPI_Comm_dup, (comm, &newcomm));
comm_ptr.reset(new MPI_Comm(newcomm), comm_free());
MPI_Errhandler_set(newcomm, MPI_ERRORS_RETURN);
break;
}
case comm_take_ownership:
comm_ptr.reset(new MPI_Comm(comm), comm_free());
break;
case comm_attach:
comm_ptr.reset(new MPI_Comm(comm));
break;
}
}
示例6: BOOST_MPI_CHECK_RESULT
int
cartesian_communicator::ndims() const {
int n = -1;
BOOST_MPI_CHECK_RESULT(MPI_Cartdim_get,
(MPI_Comm(*this), &n));
return n;
}
示例7: communicator
cartesian_communicator::cartesian_communicator(const communicator& comm,
const cartesian_topology& topology,
bool reorder )
: communicator(MPI_COMM_NULL, comm_attach)
{
std::vector<int> dims(topology.size());
std::vector<int> periodic(topology.size());
int tsz = topology.size();
for(int i = 0; i < tsz; ++i) {
dims[i] = topology[i].size;
periodic[i] = topology[i].periodic;
}
// Fill the gaps, if any
if (std::count(dims.begin(), dims.end(), 0) > 0) {
cartesian_dimensions(comm, dims);
}
MPI_Comm newcomm;
BOOST_MPI_CHECK_RESULT(MPI_Cart_create,
((MPI_Comm)comm, dims.size(),
c_data(dims), c_data(periodic),
int(reorder), &newcomm));
if(newcomm != MPI_COMM_NULL) {
comm_ptr.reset(new MPI_Comm(newcomm), comm_free());
}
}
示例8: cbuf
std::vector<int>
cartesian_communicator::coordinates(int rk) const {
std::vector<int> cbuf(ndims());
BOOST_MPI_CHECK_RESULT(MPI_Cart_coords,
(MPI_Comm(*this), rk, cbuf.size(), c_data(cbuf) ));
return cbuf;
}
示例9: BOOST_MPI_CHECK_RESULT
communicator::communicator(const communicator& comm,
const boost::mpi::group& subgroup)
{
MPI_Comm newcomm;
BOOST_MPI_CHECK_RESULT(MPI_Comm_create,
((MPI_Comm)comm, (MPI_Group)subgroup, &newcomm));
comm_ptr.reset(new MPI_Comm(newcomm), comm_free());
}
示例10: r
std::pair<int, int>
cartesian_communicator::shifted_ranks(int dim, int disp) const {
std::pair<int, int> r(-1,-1);
assert(0 <= dim && dim < ndims());
BOOST_MPI_CHECK_RESULT(MPI_Cart_shift,
(MPI_Comm(*this), dim, disp, &(r.first), &(r.second)));
return r;
}
示例11: user_op
explicit user_op(Op& op)
{
BOOST_MPI_CHECK_RESULT(MPI_Op_create,
(&user_op<Op, T>::perform,
is_commutative<Op, T>::value,
&mpi_op));
op_ptr = &op;
}
示例12: BOOST_MPI_CHECK_RESULT
status communicator::probe(int source, int tag) const
{
typedef optional<status> result_type;
status stat;
BOOST_MPI_CHECK_RESULT(MPI_Probe,
(source, tag, MPI_Comm(*this), &stat.m_status));
return stat;
}
示例13: all_gather_impl
void
all_gather_impl(const communicator& comm, const T* in_values, int n,
T* out_values, mpl::true_)
{
MPI_Datatype type = get_mpi_datatype<T>(*in_values);
BOOST_MPI_CHECK_RESULT(MPI_Allgather,
(const_cast<T*>(in_values), n, type,
out_values, n, type, comm));
}
示例14: scatter_impl
void
scatter_impl(const communicator& comm, const T* in_values, T* out_values,
int n, int root, mpl::true_)
{
MPI_Datatype type = get_mpi_datatype<T>(*in_values);
BOOST_MPI_CHECK_RESULT(MPI_Scatter,
(const_cast<T*>(in_values), n, type,
out_values, n, type, root, comm));
}
示例15: assert
int
cartesian_communicator::rank(const std::vector<int>& coords ) const {
int r = -1;
assert(int(coords.size()) == ndims());
BOOST_MPI_CHECK_RESULT(MPI_Cart_rank,
(MPI_Comm(*this), c_data(const_cast<std::vector<int>&>(coords)),
&r));
return r;
}