當前位置: 首頁>>代碼示例>>C++>>正文


C++ BOOST_MPI_CHECK_RESULT函數代碼示例

本文整理匯總了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_;
    }
開發者ID:13W,項目名稱:icq-desktop,代碼行數:31,代碼來源:mpi_datatype_primitive.hpp

示例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
    }
開發者ID:13W,項目名稱:icq-desktop,代碼行數:10,代碼來源:mpi_datatype_primitive.hpp

示例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);
    }
開發者ID:13W,項目名稱:icq-desktop,代碼行數:16,代碼來源:mpi_datatype_primitive.hpp

示例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;
}
開發者ID:AsherBond,項目名稱:PDAL,代碼行數:7,代碼來源:communicator.cpp

示例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;
  }
}
開發者ID:AsherBond,項目名稱:PDAL,代碼行數:25,代碼來源:communicator.cpp

示例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;
}
開發者ID:LocutusOfBorg,項目名稱:poedit,代碼行數:7,代碼來源:cartesian_communicator.cpp

示例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());
  }
}
開發者ID:LocutusOfBorg,項目名稱:poedit,代碼行數:25,代碼來源:cartesian_communicator.cpp

示例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;
}
開發者ID:LocutusOfBorg,項目名稱:poedit,代碼行數:7,代碼來源:cartesian_communicator.cpp

示例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());
}
開發者ID:darwin,項目名稱:boost,代碼行數:8,代碼來源:communicator.cpp

示例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;
}
開發者ID:LocutusOfBorg,項目名稱:poedit,代碼行數:8,代碼來源:cartesian_communicator.cpp

示例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;
    }
開發者ID:SCUSIT,項目名稱:PDAL,代碼行數:9,代碼來源:operations.hpp

示例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;
}
開發者ID:vbudovski,項目名稱:mpi,代碼行數:9,代碼來源:communicator.cpp

示例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));
}
開發者ID:LocutusOfBorg,項目名稱:poedit,代碼行數:9,代碼來源:all_gather.hpp

示例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));
 }
開發者ID:Niko-r,項目名稱:geofeatures,代碼行數:9,代碼來源:scatter.hpp

示例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;
}
開發者ID:LocutusOfBorg,項目名稱:poedit,代碼行數:9,代碼來源:cartesian_communicator.cpp


注:本文中的BOOST_MPI_CHECK_RESULT函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。