Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
handle proper cleanup of mpi datatypes with MPI_Type_free with a refcounter
[simgrid.git] / src / smpi / private.h
index 0898994..0fff8ab 100644 (file)
@@ -22,7 +22,7 @@ typedef struct s_smpi_process_data *smpi_process_data_t;
 #define NON_PERSISTENT 0x2
 #define SEND           0x4
 #define RECV           0x8
-
+#define RECV_DELETE     0x10
 
 // this struct is here to handle the problem of non-contignous data
 // for each such structure these function should be implemented (vector
@@ -42,6 +42,7 @@ typedef struct s_smpi_mpi_datatype{
   int flags;
   /* this let us know how to serialize and unserialize*/
   void *substruct;
+  int in_use;
 } s_smpi_mpi_datatype_t;
 
 //*****************************************************************************************
@@ -58,6 +59,12 @@ typedef struct s_smpi_mpi_request {
   int src;
   int dst;
   int tag;
+  //to handle cases where we have an unknown sender
+  //We can't override src, tag, and size, because the request may be reused later
+  int real_src;
+  int real_tag;
+  int truncated;
+  size_t real_size;
   MPI_Comm comm;
   smx_action_t action;
   unsigned flags;
@@ -99,6 +106,9 @@ MPI_Aint smpi_datatype_get_extent(MPI_Datatype datatype);
 int smpi_datatype_copy(void *sendbuf, int sendcount, MPI_Datatype sendtype,
                        void *recvbuf, int recvcount,
                        MPI_Datatype recvtype);
+void smpi_datatype_use(MPI_Datatype type);
+void smpi_datatype_unuse(MPI_Datatype type);
+
 int smpi_datatype_contiguous(int count, MPI_Datatype old_type,
                        MPI_Datatype* new_type);
 int smpi_datatype_vector(int count, int blocklen, int stride,