Commit 98c76f78 authored by Xin Zhao's avatar Xin Zhao Committed by Pavan Balaji
Browse files

Rename eltype, n_elements and element_size to better names.


Signed-off-by: Pavan Balaji's avatarPavan Balaji <balaji@anl.gov>
parent 5132e070
......@@ -112,7 +112,7 @@ int MPIR_Create_unnamed_predefined( MPI_Datatype old, int combiner,
MPI_Datatype old_basic = MPI_DATATYPE_NULL;
MPI_Datatype new_basic = MPI_DATATYPE_NULL;
/* we used MPID_Type_contiguous and then stomped it's contents
* information, so make sure that the eltype is usable by
* information, so make sure that the basic_type is usable by
* MPID_Type_commit */
MPID_Datatype_get_basic_type(old, old_basic);
MPID_Datatype_get_basic_type(new_dtp->handle, new_basic);
......
......@@ -175,11 +175,11 @@ PMPI_LOCAL MPI_Count MPIR_Type_get_elements(MPI_Count *bytes_p,
{
return MPIR_Type_get_basic_type_elements(bytes_p, count, datatype);
}
else if (datatype_ptr->element_size >= 0) {
else if (datatype_ptr->builtin_element_size >= 0) {
MPI_Datatype basic_type = MPI_DATATYPE_NULL;
MPID_Datatype_get_basic_type(datatype_ptr->eltype, basic_type);
MPID_Datatype_get_basic_type(datatype_ptr->basic_type, basic_type);
return MPIR_Type_get_basic_type_elements(bytes_p,
count * datatype_ptr->n_elements,
count * datatype_ptr->n_builtin_elements,
basic_type);
}
else {
......@@ -295,7 +295,7 @@ int MPIR_Get_elements_x_impl(const MPI_Status *status, MPI_Datatype datatype, MP
* - type with multiple element types (nastiest)
*/
if (HANDLE_GET_KIND(datatype) == HANDLE_KIND_BUILTIN ||
(datatype_ptr->element_size != -1 && datatype_ptr->size > 0))
(datatype_ptr->builtin_element_size != -1 && datatype_ptr->size > 0))
{
byte_count = MPIR_STATUS_GET_COUNT(*status);
......@@ -307,7 +307,7 @@ int MPIR_Get_elements_x_impl(const MPI_Status *status, MPI_Datatype datatype, MP
*/
if (HANDLE_GET_KIND(datatype) != HANDLE_KIND_BUILTIN) {
MPI_Datatype basic_type = MPI_DATATYPE_NULL;
MPID_Datatype_get_basic_type(datatype_ptr->eltype, basic_type);
MPID_Datatype_get_basic_type(datatype_ptr->basic_type, basic_type);
*elements = MPIR_Type_get_basic_type_elements(&byte_count,
-1,
basic_type);
......@@ -343,7 +343,7 @@ int MPIR_Get_elements_x_impl(const MPI_Status *status, MPI_Datatype datatype, MP
}
}
else /* derived type with weird element type or weird size */ {
MPIU_Assert(datatype_ptr->element_size == -1);
MPIU_Assert(datatype_ptr->builtin_element_size == -1);
byte_count = MPIR_STATUS_GET_COUNT(*status);
*elements = MPIR_Type_get_elements(&byte_count, -1, datatype);
......
......@@ -76,7 +76,7 @@ static int fill_in_derived_dtp_info(MPIDI_RMA_Op_t * rma_op, MPID_Datatype * dtp
rma_op->dtype_info.extent = dtp->extent;
rma_op->dtype_info.dataloop_size = dtp->dataloop_size;
rma_op->dtype_info.dataloop_depth = dtp->dataloop_depth;
rma_op->dtype_info.eltype = dtp->eltype;
rma_op->dtype_info.basic_type = dtp->basic_type;
rma_op->dtype_info.dataloop = dtp->dataloop;
rma_op->dtype_info.ub = dtp->ub;
rma_op->dtype_info.lb = dtp->lb;
......@@ -692,10 +692,10 @@ static int issue_acc_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
}
else {
MPID_Datatype_get_ptr(rma_op->origin_datatype, origin_dtp_ptr);
MPIU_Assert(origin_dtp_ptr != NULL && origin_dtp_ptr->eltype != MPI_DATATYPE_NULL);
MPID_Datatype_get_size_macro(origin_dtp_ptr->eltype, predefined_dtp_size);
MPIU_Assert(origin_dtp_ptr != NULL && origin_dtp_ptr->basic_type != MPI_DATATYPE_NULL);
MPID_Datatype_get_size_macro(origin_dtp_ptr->basic_type, predefined_dtp_size);
predefined_dtp_count = total_len / predefined_dtp_size;
MPID_Datatype_get_extent_macro(origin_dtp_ptr->eltype, predefined_dtp_extent);
MPID_Datatype_get_extent_macro(origin_dtp_ptr->basic_type, predefined_dtp_extent);
}
MPIU_Assert(predefined_dtp_count > 0 && predefined_dtp_size > 0 && predefined_dtp_extent > 0);
......@@ -867,10 +867,10 @@ static int issue_get_acc_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
}
else {
MPID_Datatype_get_ptr(rma_op->origin_datatype, origin_dtp_ptr);
MPIU_Assert(origin_dtp_ptr != NULL && origin_dtp_ptr->eltype != MPI_DATATYPE_NULL);
MPID_Datatype_get_size_macro(origin_dtp_ptr->eltype, predefined_dtp_size);
MPIU_Assert(origin_dtp_ptr != NULL && origin_dtp_ptr->basic_type != MPI_DATATYPE_NULL);
MPID_Datatype_get_size_macro(origin_dtp_ptr->basic_type, predefined_dtp_size);
predefined_dtp_count = total_len / predefined_dtp_size;
MPID_Datatype_get_extent_macro(origin_dtp_ptr->eltype, predefined_dtp_extent);
MPID_Datatype_get_extent_macro(origin_dtp_ptr->basic_type, predefined_dtp_extent);
}
MPIU_Assert(predefined_dtp_count > 0 && predefined_dtp_size > 0 && predefined_dtp_extent > 0);
......
......@@ -349,8 +349,8 @@ static inline int MPIDI_CH3I_Shm_acc_op(const void *origin_addr, int origin_coun
total_len = origin_dtp_size * origin_count;
MPID_Datatype_get_ptr(origin_datatype, origin_dtp_ptr);
MPIU_Assert(origin_dtp_ptr != NULL && origin_dtp_ptr->eltype != MPI_DATATYPE_NULL);
predefined_type = origin_dtp_ptr->eltype;
MPIU_Assert(origin_dtp_ptr != NULL && origin_dtp_ptr->basic_type != MPI_DATATYPE_NULL);
predefined_type = origin_dtp_ptr->basic_type;
MPID_Datatype_get_size_macro(predefined_type, predefined_dtp_size);
predefined_dtp_count = total_len / predefined_dtp_size;
MPID_Datatype_get_extent_macro(predefined_type, predefined_dtp_extent);
......@@ -496,8 +496,8 @@ static inline int MPIDI_CH3I_Shm_get_acc_op(const void *origin_addr, int origin_
total_len = origin_dtp_size * origin_count;
MPID_Datatype_get_ptr(origin_datatype, origin_dtp_ptr);
MPIU_Assert(origin_dtp_ptr != NULL && origin_dtp_ptr->eltype != MPI_DATATYPE_NULL);
predefined_type = origin_dtp_ptr->eltype;
MPIU_Assert(origin_dtp_ptr != NULL && origin_dtp_ptr->basic_type != MPI_DATATYPE_NULL);
predefined_type = origin_dtp_ptr->basic_type;
MPID_Datatype_get_size_macro(predefined_type, predefined_dtp_size);
predefined_dtp_count = total_len / predefined_dtp_size;
MPID_Datatype_get_extent_macro(predefined_type, predefined_dtp_extent);
......
......@@ -35,7 +35,7 @@ typedef struct MPIDI_RMA_dtype_info { /* for derived datatypes */
void *dataloop; /* pointer needed to update pointers
* within dataloop on remote side */
int dataloop_depth;
int eltype;
int basic_type;
MPI_Aint ub, lb, true_ub, true_lb;
int has_sticky_ub, has_sticky_lb;
} MPIDI_RMA_dtype_info;
......
......@@ -868,7 +868,7 @@ static inline int do_accumulate_op(void *source_buf, int source_count, MPI_Datat
MPID_Segment_pack_vector(segp, first, &last, dloop_vec, &vec_len);
type = dtp->eltype;
type = dtp->basic_type;
MPIU_Assert(type != MPI_DATATYPE_NULL);
MPIU_Assert(type == source_dtp);
......
......@@ -168,7 +168,7 @@ int MPIDI_CH3_ReqHandler_AccumRecvComplete(MPIDI_VC_t * vc, MPID_Request * rreq,
if (MPIR_DATATYPE_IS_PREDEFINED(rreq->dev.datatype))
predef_datatype = rreq->dev.datatype;
else {
predef_datatype = rreq->dev.datatype_ptr->eltype;
predef_datatype = rreq->dev.datatype_ptr->basic_type;
}
MPIU_Assert(predef_datatype != MPI_DATATYPE_NULL);
......@@ -242,7 +242,7 @@ int MPIDI_CH3_ReqHandler_GaccumRecvComplete(MPIDI_VC_t * vc, MPID_Request * rreq
if (MPIR_DATATYPE_IS_PREDEFINED(rreq->dev.datatype))
predef_datatype = rreq->dev.datatype;
else {
predef_datatype = rreq->dev.datatype_ptr->eltype;
predef_datatype = rreq->dev.datatype_ptr->basic_type;
}
MPIU_Assert(predef_datatype != MPI_DATATYPE_NULL);
......@@ -544,8 +544,8 @@ int MPIDI_CH3_ReqHandler_AccumDerivedDTRecvComplete(MPIDI_VC_t * vc ATTRIBUTE((u
/* update new request to get the data */
MPIDI_Request_set_type(rreq, MPIDI_REQUEST_TYPE_ACCUM_RECV);
MPID_Datatype_get_size_macro(new_dtp->eltype, predef_type_size);
MPID_Datatype_get_extent_macro(new_dtp->eltype, predef_type_extent);
MPID_Datatype_get_size_macro(new_dtp->basic_type, predef_type_size);
MPID_Datatype_get_extent_macro(new_dtp->basic_type, predef_type_extent);
MPIU_Assert(!MPIDI_Request_get_srbuf_flag(rreq));
/* allocate a SRBuf for receiving stream unit */
......@@ -580,7 +580,7 @@ int MPIDI_CH3_ReqHandler_AccumDerivedDTRecvComplete(MPIDI_VC_t * vc ATTRIBUTE((u
MPID_Segment_init(rreq->dev.user_buf,
(rreq->dev.recv_data_sz / predef_type_size),
new_dtp->eltype, rreq->dev.segment_ptr, 0);
new_dtp->basic_type, rreq->dev.segment_ptr, 0);
rreq->dev.segment_first = 0;
rreq->dev.segment_size = rreq->dev.recv_data_sz;
......@@ -619,8 +619,8 @@ int MPIDI_CH3_ReqHandler_GaccumDerivedDTRecvComplete(MPIDI_VC_t * vc ATTRIBUTE((
/* update new request to get the data */
MPIDI_Request_set_type(rreq, MPIDI_REQUEST_TYPE_GET_ACCUM_RECV);
MPID_Datatype_get_size_macro(new_dtp->eltype, predef_type_size);
MPID_Datatype_get_extent_macro(new_dtp->eltype, predef_type_extent);
MPID_Datatype_get_size_macro(new_dtp->basic_type, predef_type_size);
MPID_Datatype_get_extent_macro(new_dtp->basic_type, predef_type_extent);
MPIU_Assert(!MPIDI_Request_get_srbuf_flag(rreq));
/* allocate a SRBuf for receiving stream unit */
......@@ -655,7 +655,7 @@ int MPIDI_CH3_ReqHandler_GaccumDerivedDTRecvComplete(MPIDI_VC_t * vc ATTRIBUTE((
MPID_Segment_init(rreq->dev.user_buf,
(rreq->dev.recv_data_sz / predef_type_size),
new_dtp->eltype, rreq->dev.segment_ptr, 0);
new_dtp->basic_type, rreq->dev.segment_ptr, 0);
rreq->dev.segment_first = 0;
rreq->dev.segment_size = rreq->dev.recv_data_sz;
......@@ -911,7 +911,7 @@ static int create_derived_datatype(MPID_Request * req, MPID_Datatype ** dtp)
new_dtp->extent = dtype_info->extent;
new_dtp->dataloop_size = dtype_info->dataloop_size;
new_dtp->dataloop_depth = dtype_info->dataloop_depth;
new_dtp->eltype = dtype_info->eltype;
new_dtp->basic_type = dtype_info->basic_type;
/* set dataloop pointer */
new_dtp->dataloop = req->dev.dataloop;
......
......@@ -553,10 +553,10 @@ int MPIDI_CH3I_Accumulate(const void *origin_addr, int origin_count, MPI_Datatyp
MPID_Datatype_get_extent_macro(origin_datatype, predefined_dtp_extent);
}
else {
MPIU_Assert(origin_dtp->eltype != MPI_DATATYPE_NULL);
MPID_Datatype_get_size_macro(origin_dtp->eltype, predefined_dtp_size);
MPIU_Assert(origin_dtp->basic_type != MPI_DATATYPE_NULL);
MPID_Datatype_get_size_macro(origin_dtp->basic_type, predefined_dtp_size);
predefined_dtp_count = len / predefined_dtp_size;
MPID_Datatype_get_extent_macro(origin_dtp->eltype, predefined_dtp_extent);
MPID_Datatype_get_extent_macro(origin_dtp->basic_type, predefined_dtp_extent);
}
MPIU_Assert(predefined_dtp_count > 0 && predefined_dtp_size > 0 &&
predefined_dtp_extent > 0);
......@@ -868,10 +868,10 @@ int MPIDI_CH3I_Get_accumulate(const void *origin_addr, int origin_count,
MPID_Datatype_get_extent_macro(origin_datatype, predefined_dtp_extent);
}
else {
MPIU_Assert(origin_dtp->eltype != MPI_DATATYPE_NULL);
MPID_Datatype_get_size_macro(origin_dtp->eltype, predefined_dtp_size);
MPIU_Assert(origin_dtp->basic_type != MPI_DATATYPE_NULL);
MPID_Datatype_get_size_macro(origin_dtp->basic_type, predefined_dtp_size);
predefined_dtp_count = orig_len / predefined_dtp_size;
MPID_Datatype_get_extent_macro(origin_dtp->eltype, predefined_dtp_extent);
MPID_Datatype_get_extent_macro(origin_dtp->basic_type, predefined_dtp_extent);
}
MPIU_Assert(predefined_dtp_count > 0 && predefined_dtp_size > 0 &&
predefined_dtp_extent > 0);
......
......@@ -1516,7 +1516,7 @@ int MPIDI_CH3_PktHandler_Get_AccumResp(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
}
else {
MPIU_Assert(req->dev.datatype_ptr != NULL);
predef_type = req->dev.datatype_ptr->eltype;
predef_type = req->dev.datatype_ptr->basic_type;
}
MPID_Datatype_get_extent_macro(predef_type, predef_type_extent);
......
......@@ -64,8 +64,8 @@
#define DLOOP_Handle_get_size_macro(handle_,size_) \
MPID_Datatype_get_size_macro(handle_,size_)
#define DLOOP_Handle_get_basic_type_macro(handle_,eltype_) \
MPID_Datatype_get_basic_type(handle_, eltype_)
#define DLOOP_Handle_get_basic_type_macro(handle_,basic_type_) \
MPID_Datatype_get_basic_type(handle_, basic_type_)
#define DLOOP_Handle_get_extent_macro(handle_,extent_) \
MPID_Datatype_get_extent_macro(handle_,extent_)
......
......@@ -24,24 +24,24 @@
#define MPID_Datatype_add_ref(datatype_ptr) MPIU_Object_add_ref((datatype_ptr))
#define MPID_Datatype_get_basic_type(a,eltype_) do { \
#define MPID_Datatype_get_basic_type(a,basic_type_) do { \
void *ptr; \
switch (HANDLE_GET_KIND(a)) { \
case HANDLE_KIND_DIRECT: \
ptr = MPID_Datatype_direct+HANDLE_INDEX(a); \
eltype_ = ((MPID_Datatype *) ptr)->eltype; \
basic_type_ = ((MPID_Datatype *) ptr)->basic_type; \
break; \
case HANDLE_KIND_INDIRECT: \
ptr = ((MPID_Datatype *) \
MPIU_Handle_get_ptr_indirect(a,&MPID_Datatype_mem)); \
eltype_ = ((MPID_Datatype *) ptr)->eltype; \
basic_type_ = ((MPID_Datatype *) ptr)->basic_type; \
break; \
case HANDLE_KIND_BUILTIN: \
eltype_ = a; \
basic_type_ = a; \
break; \
case HANDLE_KIND_INVALID: \
default: \
eltype_ = 0; \
basic_type_ = 0; \
break; \
\
} \
......@@ -49,8 +49,8 @@
* a builtin type, it must be a pair type composed of different \
* builtin types, so we return MPI_DATATYPE_NULL here. \
*/ \
if (HANDLE_GET_KIND(eltype_) != HANDLE_KIND_BUILTIN) \
eltype_ = MPI_DATATYPE_NULL; \
if (HANDLE_GET_KIND(basic_type_) != HANDLE_KIND_BUILTIN) \
basic_type_ = MPI_DATATYPE_NULL; \
} while(0)
/* MPID_Datatype_release decrements the reference count on the MPID_Datatype
......@@ -376,13 +376,13 @@ typedef struct MPID_Datatype {
/* element information; used for accumulate and get elements
*
* if type is composed of more than one element type, then
* eltype == MPI_DATATYPE_NULL and element_size == -1
* basic_type == MPI_DATATYPE_NULL and builtin_element_size == -1
*/
/* Note that here eltype refers to predefined type, not the builtin
type, whereas n_elements and element_size refers to builtin type. */
int eltype;
MPI_Aint n_elements;
MPI_Aint element_size;
/* Note that here basic_type refers to predefined type, not the builtin
type, whereas n_builtin_elements and builtin_element_size refers to builtin type. */
int basic_type;
MPI_Aint n_builtin_elements;
MPI_Aint builtin_element_size;
/* information on contiguity of type, for processing shortcuts.
*
......
......@@ -97,9 +97,9 @@ int MPID_Type_blockindexed(int count,
new_dtp->has_sticky_ub = 0;
new_dtp->alignsize = el_sz; /* ??? */
new_dtp->n_elements = count * blocklength;
new_dtp->element_size = el_sz;
new_dtp->eltype = el_type;
new_dtp->n_builtin_elements = count * blocklength;
new_dtp->builtin_element_size = el_sz;
new_dtp->basic_type = el_type;
new_dtp->max_contig_blocks = count;
}
......@@ -109,8 +109,8 @@ int MPID_Type_blockindexed(int count,
MPID_Datatype *old_dtp;
MPID_Datatype_get_ptr(oldtype, old_dtp);
el_sz = old_dtp->element_size;
el_type = old_dtp->eltype;
el_sz = old_dtp->builtin_element_size;
el_type = old_dtp->basic_type;
old_lb = old_dtp->lb;
old_true_lb = old_dtp->true_lb;
......@@ -126,9 +126,9 @@ int MPID_Type_blockindexed(int count,
new_dtp->has_sticky_ub = old_dtp->has_sticky_ub;
new_dtp->alignsize = old_dtp->alignsize;
new_dtp->n_elements = count * blocklength * old_dtp->n_elements;
new_dtp->element_size = el_sz;
new_dtp->eltype = el_type;
new_dtp->n_builtin_elements = count * blocklength * old_dtp->n_builtin_elements;
new_dtp->builtin_element_size = el_sz;
new_dtp->basic_type = el_type;
new_dtp->max_contig_blocks = old_dtp->max_contig_blocks * count * blocklength;
}
......
......@@ -82,9 +82,9 @@ int MPID_Type_contiguous(int count,
new_dtp->extent = new_dtp->ub - new_dtp->lb;
new_dtp->alignsize = el_sz;
new_dtp->n_elements = count;
new_dtp->element_size = el_sz;
new_dtp->eltype = el_type;
new_dtp->n_builtin_elements = count;
new_dtp->builtin_element_size = el_sz;
new_dtp->basic_type = el_type;
new_dtp->is_contig = 1;
new_dtp->max_contig_blocks = 1;
......@@ -95,8 +95,8 @@ int MPID_Type_contiguous(int count,
MPID_Datatype *old_dtp;
MPID_Datatype_get_ptr(oldtype, old_dtp);
el_sz = old_dtp->element_size;
el_type = old_dtp->eltype;
el_sz = old_dtp->builtin_element_size;
el_type = old_dtp->basic_type;
new_dtp->size = count * old_dtp->size;
new_dtp->has_sticky_ub = old_dtp->has_sticky_ub;
......@@ -117,9 +117,9 @@ int MPID_Type_contiguous(int count,
new_dtp->extent = new_dtp->ub - new_dtp->lb;
new_dtp->alignsize = old_dtp->alignsize;
new_dtp->n_elements = count * old_dtp->n_elements;
new_dtp->element_size = old_dtp->element_size;
new_dtp->eltype = el_type;
new_dtp->n_builtin_elements = count * old_dtp->n_builtin_elements;
new_dtp->builtin_element_size = old_dtp->builtin_element_size;
new_dtp->basic_type = el_type;
new_dtp->is_contig = old_dtp->is_contig;
if(old_dtp->is_contig)
......
......@@ -119,9 +119,9 @@ int MPID_Type_create_pairtype(MPI_Datatype type,
/* --END ERROR HANDLING-- */
}
new_dtp->n_elements = 2;
new_dtp->element_size = el_size;
new_dtp->eltype = type;
new_dtp->n_builtin_elements = 2;
new_dtp->builtin_element_size = el_size;
new_dtp->basic_type = type;
new_dtp->has_sticky_lb = 0;
new_dtp->true_lb = 0;
......
......@@ -56,10 +56,10 @@ int MPID_Type_create_resized(MPI_Datatype oldtype,
new_dtp->ub = lb + extent;
new_dtp->extent = extent;
new_dtp->alignsize = oldsize; /* FIXME ??? */
new_dtp->n_elements = 1;
new_dtp->element_size = oldsize;
new_dtp->n_builtin_elements = 1;
new_dtp->builtin_element_size = oldsize;
new_dtp->is_contig = (extent == oldsize) ? 1 : 0;
new_dtp->eltype = oldtype;
new_dtp->basic_type = oldtype;
new_dtp->max_contig_blocks = 3; /* lb, data, ub */
}
else
......@@ -79,9 +79,9 @@ int MPID_Type_create_resized(MPI_Datatype oldtype,
new_dtp->ub = lb + extent;
new_dtp->extent = extent;
new_dtp->alignsize = old_dtp->alignsize;
new_dtp->n_elements = old_dtp->n_elements;
new_dtp->element_size = old_dtp->element_size;
new_dtp->eltype = old_dtp->eltype;
new_dtp->n_builtin_elements = old_dtp->n_builtin_elements;
new_dtp->builtin_element_size = old_dtp->builtin_element_size;
new_dtp->basic_type = old_dtp->basic_type;
new_dtp->is_contig =
(extent == old_dtp->size) ? old_dtp->is_contig : 0;
......
......@@ -474,9 +474,9 @@ void MPIDU_Datatype_debug(MPI_Datatype type,
(MPI_Aint) dtp->ub,
(dtp->has_sticky_ub) ? "(sticky)" : "",
(MPI_Aint) dtp->extent,
(MPI_Aint) dtp->element_size,
dtp->element_size == -1 ? "multiple types" :
MPIDU_Datatype_builtin_to_string(dtp->eltype),
(MPI_Aint) dtp->builtin_element_size,
dtp->builtin_element_size == -1 ? "multiple types" :
MPIDU_Datatype_builtin_to_string(dtp->basic_type),
dtp->is_contig ? "is N contig" : "is not N contig"));
MPIU_DBG_OUT(DATATYPE,"# Contents:");
......
......@@ -72,9 +72,9 @@ int MPID_Type_dup(MPI_Datatype oldtype,
new_dtp->cache_id = -1; /* ??? */
new_dtp->name[0] = 0; /* The Object name is not copied on
a dup */
new_dtp->n_elements = old_dtp->n_elements;
new_dtp->element_size = old_dtp->element_size;
new_dtp->eltype = old_dtp->eltype;
new_dtp->n_builtin_elements = old_dtp->n_builtin_elements;
new_dtp->builtin_element_size = old_dtp->builtin_element_size;
new_dtp->basic_type = old_dtp->basic_type;
new_dtp->dataloop = NULL;
new_dtp->dataloop_size = old_dtp->dataloop_size;
......
......@@ -111,8 +111,8 @@ int MPID_Type_indexed(int count,
new_dtp->has_sticky_lb = 0;
MPIU_Assign_trunc(new_dtp->alignsize, el_sz, MPI_Aint);
new_dtp->element_size = el_sz;
new_dtp->eltype = el_type;
new_dtp->builtin_element_size = el_sz;
new_dtp->basic_type = el_type;
new_dtp->max_contig_blocks = count;
}
......@@ -123,13 +123,13 @@ int MPID_Type_indexed(int count,
MPID_Datatype_get_ptr(oldtype, old_dtp);
/* Ensure that "element_size" fits into an int datatype. */
MPID_Ensure_Aint_fits_in_int(old_dtp->element_size);
/* Ensure that "builtin_element_size" fits into an int datatype. */
MPID_Ensure_Aint_fits_in_int(old_dtp->builtin_element_size);
el_sz = old_dtp->element_size;
el_sz = old_dtp->builtin_element_size;
old_sz = old_dtp->size;
el_ct = old_dtp->n_elements;
el_type = old_dtp->eltype;
el_ct = old_dtp->n_builtin_elements;
el_type = old_dtp->basic_type;
old_lb = old_dtp->lb;
old_true_lb = old_dtp->true_lb;
......@@ -140,8 +140,8 @@ int MPID_Type_indexed(int count,
new_dtp->has_sticky_lb = old_dtp->has_sticky_lb;
new_dtp->has_sticky_ub = old_dtp->has_sticky_ub;
new_dtp->element_size = (MPI_Aint) el_sz;
new_dtp->eltype = el_type;
new_dtp->builtin_element_size = (MPI_Aint) el_sz;
new_dtp->basic_type = el_type;
new_dtp->max_contig_blocks = 0;
for(i=0; i<count; i++)
......@@ -207,7 +207,7 @@ int MPID_Type_indexed(int count,
new_dtp->true_ub = max_ub + (old_true_ub - old_ub);
new_dtp->extent = max_ub - min_lb;
new_dtp->n_elements = old_ct * el_ct;
new_dtp->n_builtin_elements = old_ct * el_ct;
/* new type is only contig for N types if it's all one big
* block, its size and extent are the same, and the old type
......
......@@ -248,11 +248,11 @@ int MPID_Type_struct(int count,
{
MPID_Datatype_get_ptr(oldtype_array[i], old_dtp);
/* Ensure that "element_size" fits into an int datatype. */
MPID_Ensure_Aint_fits_in_int(old_dtp->element_size);
/* Ensure that "builtin_element_size" fits into an int datatype. */
MPID_Ensure_Aint_fits_in_int(old_dtp->builtin_element_size);
tmp_el_sz = old_dtp->element_size;
tmp_el_type = old_dtp->eltype;
tmp_el_sz = old_dtp->builtin_element_size;
tmp_el_type = old_dtp->basic_type;
MPID_DATATYPE_BLOCK_LB_UB((MPI_Aint) blocklength_array[i],
displacement_array[i],
......@@ -386,9 +386,9 @@ int MPID_Type_struct(int count,
}
}
new_dtp->n_elements = -1; /* TODO */
new_dtp->element_size = el_sz;
new_dtp->eltype = el_type;
new_dtp->n_builtin_elements = -1; /* TODO */
new_dtp->builtin_element_size = el_sz;
new_dtp->basic_type = el_type;
new_dtp->has_sticky_lb = found_sticky_lb;
new_dtp->true_lb = true_lb_disp;
......
......@@ -93,9 +93,9 @@ int MPID_Type_vector(int count,
new_dtp->has_sticky_ub = 0;
new_dtp->alignsize = el_sz; /* ??? */
new_dtp->n_elements = count * blocklength;
new_dtp->element_size = el_sz;
new_dtp->eltype = el_type;
new_dtp->n_builtin_elements = count * blocklength;
new_dtp->builtin_element_size = el_sz;
new_dtp->basic_type = el_type;
new_dtp->max_contig_blocks = count;
......@@ -105,8 +105,8 @@ int MPID_Type_vector(int count,
MPID_Datatype *old_dtp;
MPID_Datatype_get_ptr(oldtype, old_dtp);
el_sz = old_dtp->element_size;
el_type = old_dtp->eltype;
el_sz = old_dtp->builtin_element_size;
el_type = old_dtp->basic_type;
old_lb = old_dtp->lb;
old_true_lb = old_dtp->true_lb;
......@@ -121,9 +121,9 @@ int MPID_Type_vector(int count,
new_dtp->has_sticky_ub = old_dtp->has_sticky_ub;
new_dtp->alignsize = old_dtp->alignsize;
new_dtp->n_elements = count * blocklength * old_dtp->n_elements;
new_dtp->element_size = el_sz;
new_dtp->eltype = el_type;
new_dtp->n_builtin_elements = count * blocklength * old_dtp->n_builtin_elements;
new_dtp->builtin_element_size = el_sz;
new_dtp->basic_type = el_type;
new_dtp->max_contig_blocks = old_dtp->max_contig_blocks * count * blocklength;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment