Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[beginning smpi non contignous]
authorjean-noel quintin <jnquintin@dhcp-892b9bdf.ucd.ie>
Thu, 27 Sep 2012 11:17:05 +0000 (12:17 +0100)
committerjean-noel quintin <jnquintin@dhcp-892b9bdf.ucd.ie>
Thu, 27 Sep 2012 11:17:17 +0000 (12:17 +0100)
src/smpi/private.h
src/smpi/smpi_base.c
src/smpi/smpi_mpi_dt.c

index c657011..a53d6dc 100644 (file)
@@ -26,6 +26,10 @@ typedef struct s_smpi_process_data *smpi_process_data_t;
 typedef struct s_smpi_mpi_request {
   void *buf;
   size_t size;
+  size_t contiguous;
+  size_t block_stride;
+  size_t block_length;
+  size_t block_count:
   int src;
   int dst;
   int tag;
@@ -61,6 +65,10 @@ void smpi_global_init(void);
 void smpi_global_destroy(void);
 
 size_t smpi_datatype_size(MPI_Datatype datatype);
+size_t smpi_datatype_contiguous(MPI_Datatype datatype);
+size_t smpi_datatype_block_stride(MPI_Datatype datatype);
+size_t smpi_datatype_block_length(MPI_Datatype datatype);
+size_t smpi_datatype_block_count(MPI_Datatype datatype);
 MPI_Aint smpi_datatype_lb(MPI_Datatype datatype);
 MPI_Aint smpi_datatype_ub(MPI_Datatype datatype);
 int smpi_datatype_extent(MPI_Datatype datatype, MPI_Aint * lb,
index 458eb84..08e057d 100644 (file)
@@ -44,6 +44,12 @@ static MPI_Request build_request(void *buf, int count,
   request->buf = buf;
   // FIXME: this will have to be changed to support non-contiguous datatypes
   request->size = smpi_datatype_size(datatype) * count;
+  request->contiguous=smpi_datatype_contiguous(datatype);
+  if(request->contiguous != 1){
+    request->block_stride = smpi_datatype_block_stride(datatype);
+    request->block_length = smpi_datatype_block_length(datatype);
+    request->block_count = smpi_datatype_block_count(datatype)*count;
+  }
   request->src = src;
   request->dst = dst;
   request->tag = tag;
index ca60a35..4961520 100644 (file)
@@ -19,6 +19,10 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_mpi_dt, smpi,
 
 typedef struct s_smpi_mpi_datatype {
   size_t size;
+  size_t contiguous;
+  size_t block_stride;
+  size_t block_length;
+  size_t block_count:
   MPI_Aint lb;
   MPI_Aint ub;
   int flags;
@@ -27,6 +31,10 @@ typedef struct s_smpi_mpi_datatype {
 #define CREATE_MPI_DATATYPE(name, type)       \
   static s_smpi_mpi_datatype_t mpi_##name = { \
     sizeof(type),  /* size */                 \
+    1,             /*contiguous*/             \
+    0,             /*block_stride*/           \
+    0,             /*block_length*/           \
+    0,             /*block_count*/            \
     0,             /* lb */                   \
     sizeof(type),  /* ub = lb + size */       \
     DT_FLAG_BASIC  /* flags */                \
@@ -107,6 +115,24 @@ size_t smpi_datatype_size(MPI_Datatype datatype)
   return datatype->size;
 }
 
+size_t smpi_datatype_contiguous(MPI_Datatype datatype)
+{
+  return datatype->contiguous;
+}
+
+size_t smpi_datatype_block_stride(MPI_Datatype datatype)
+{
+  return datatype->block_stride;
+}
+size_t smpi_datatype_block_length(MPI_Datatype datatype)
+{
+  return datatype->block_length;
+}
+size_t smpi_datatype_block_count(MPI_Datatype datatype)
+{
+  return datatype->block_count;
+}
+
 MPI_Aint smpi_datatype_lb(MPI_Datatype datatype)
 {
   return datatype->lb;