Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add a refcount for MPI_Op
[simgrid.git] / src / smpi / include / smpi_request.hpp
index 0c166fd..a4fa0d5 100644 (file)
@@ -49,10 +49,12 @@ class Request : public F2C {
   MPI_Op op_;
   int cancelled_;
   smpi_mpi_generalized_request_funcs generalized_funcs;
+  MPI_Request* nbc_requests_;
+  int nbc_requests_size_;
 
 public:
   Request() = default;
-  Request(void* buf, int count, MPI_Datatype datatype, int src, int dst, int tag, MPI_Comm comm, unsigned flags);
+  Request(void* buf, int count, MPI_Datatype datatype, int src, int dst, int tag, MPI_Comm comm, unsigned flags, MPI_Op op = MPI_REPLACE);
   MPI_Comm comm() { return comm_; }
   size_t size() { return size_; }
   size_t real_size() { return real_size_; }
@@ -66,6 +68,9 @@ public:
   void start();
   void cancel();
   void ref();
+  void set_nbc_requests(MPI_Request* reqs, int size);
+  int get_nbc_requests_size();
+  MPI_Request* get_nbc_requests();
   static void finish_wait(MPI_Request* request, MPI_Status* status);
   static void unref(MPI_Request* request);
   static int wait(MPI_Request* req, MPI_Status* status);
@@ -108,6 +113,8 @@ public:
 
   static int grequest_start( MPI_Grequest_query_function *query_fn, MPI_Grequest_free_function *free_fn, MPI_Grequest_cancel_function *cancel_fn, void *extra_state, MPI_Request *request);
   static int grequest_complete( MPI_Request request);
+  static int get_status(MPI_Request req, int* flag, MPI_Status * status);
+
   int add_f() override;
   static void free_f(int id);
   static Request* f2c(int);