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;
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,
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;
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;
#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 */ \
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;