Line data Source code
1 : //
2 : // Class Request
3 : // A communication request handle for non-blocking communication.
4 : //
5 : #ifndef IPPL_MPI_REQUEST_H
6 : #define IPPL_MPI_REQUEST_H
7 :
8 : #include "Communicate/Status.h"
9 :
10 : namespace ippl {
11 : namespace mpi {
12 :
13 : class Request {
14 : public:
15 : Request()
16 : : request_m(MPI_REQUEST_NULL) {}
17 :
18 : ~Request();
19 :
20 : // operator MPI_Request&() noexcept { return request_m; }
21 :
22 : // operator const MPI_Request&() const noexcept { return request_m; }
23 :
24 0 : operator MPI_Request*() noexcept { return &request_m; }
25 :
26 : operator const MPI_Request*() const noexcept { return &request_m; }
27 :
28 : bool completed();
29 :
30 0 : void free() { MPI_Request_free(&request_m); }
31 :
32 : void wait() { MPI_Wait(&request_m, MPI_STATUS_IGNORE); }
33 :
34 : private:
35 : MPI_Request request_m;
36 : };
37 : } // namespace mpi
38 : } // namespace ippl
39 :
40 : #endif
|