DIY  3.0
data-parallel out-of-core C++ library
 All Classes Namespaces Functions Typedefs Groups Pages
status.hpp
1 namespace diy
2 {
3 namespace mpi
4 {
5  struct status
6  {
7  int source() const { return s.MPI_SOURCE; }
8  int tag() const { return s.MPI_TAG; }
9  int error() const { return s.MPI_ERROR; }
10  bool cancelled() const { int flag; MPI_Test_cancelled(const_cast<MPI_Status*>(&s), &flag); return flag; }
11 
12  template<class T>
13  int count() const;
14 
15  operator MPI_Status&() { return s; }
16  operator const MPI_Status&() const { return s; }
17 
18  MPI_Status s;
19  };
20 }
21 }
22 
23 template<class T>
24 int
25 diy::mpi::status::count() const
26 {
27  int c;
28  MPI_Get_count(const_cast<MPI_Status*>(&s), detail::get_mpi_datatype<T>(), &c);
29  return c;
30 }
Definition: status.hpp:5