DIY 3.0 data-parallel out-of-core C++ library

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Examples

- File List

All Classes Namespaces Functions Typedefs Groups Pages
request.hpp
1 namespace diy
2 {
3 namespace mpi
4 {
5 struct request
6 {
7 inline
8 status wait();
9 inline
10 optional<status> test();
11 inline
12 void cancel();
13
14 MPI_Request r;
15 };
16 }
17 }
18
19 diy::mpi::status
20 diy::mpi::request::wait()
21 {
22 #ifndef DIY_NO_MPI
23 status s;
24 MPI_Wait(&r, &s.s);
25 return s;
26 #else
27 DIY_UNSUPPORTED_MPI_CALL(diy::mpi::request::wait);
28 #endif
29 }
30
31 diy::mpi::optional<diy::mpi::status>
32 diy::mpi::request::test()
33 {
34 #ifndef DIY_NO_MPI
35 status s;
36 int flag;
37 MPI_Test(&r, &flag, &s.s);
38 if (flag)
39 return s;
40 #endif
41 return optional<status>();
42 }
43
44 void
45 diy::mpi::request::cancel()
46 {
47 #ifndef DIY_NO_MPI
48 MPI_Cancel(&r);
49 #endif
50 }
diy::mpi::status
Definition: status.hpp:5
diy::mpi::optional
Definition: optional.hpp:6
diy::mpi::request
Definition: request.hpp:5