NULL, /* pointer on extended struct*/ \
0 /* in_use counter */ \
}; \
-MPI_Datatype name = &mpi_##name;
+const MPI_Datatype name = &mpi_##name;
#define CREATE_MPI_DATATYPE_NULL(name) \
static s_smpi_mpi_datatype_t mpi_##name = { \
NULL, /* pointer on extended struct*/ \
0 /* in_use counter */ \
}; \
-MPI_Datatype name = &mpi_##name;
+const MPI_Datatype name = &mpi_##name;
//The following are datatypes for the MPI functions MPI_MAXLOC and MPI_MINLOC.
typedef struct {
{
int retval;
if(old_type->has_subtype){
- //handle this case as a hvector with stride equals to the extent of the datatype
- return smpi_datatype_hvector(count, 1, smpi_datatype_get_extent(old_type), old_type, new_type);
+ //handle this case as a hvector with stride equals to the extent of the datatype
+ return smpi_datatype_hvector(count, 1, smpi_datatype_get_extent(old_type), old_type, new_type);
}
s_smpi_mpi_contiguous_t* subtype = smpi_datatype_contiguous_create( lb,
smpi_datatype_size(old_type));
smpi_datatype_create(new_type,
- count * smpi_datatype_size(old_type),
- lb,lb + count * smpi_datatype_size(old_type),
- 1,subtype, DT_FLAG_CONTIGUOUS);
+ count * smpi_datatype_size(old_type),
+ lb,lb + count * smpi_datatype_size(old_type),
+ 1,subtype, DT_FLAG_CONTIGUOUS);
retval=MPI_SUCCESS;
return retval;
}
smpi_datatype_size(old_type));
smpi_datatype_create(new_type, count * blocklen * smpi_datatype_size(old_type),
- lb,ub,
+ lb,ub,
1,
subtype,
DT_FLAG_VECTOR);
size += blocklens[i];
if(indices[i]*smpi_datatype_get_extent(old_type)+smpi_datatype_lb(old_type)<lb)
- lb = indices[i]*smpi_datatype_get_extent(old_type)+smpi_datatype_lb(old_type);
+ lb = indices[i]*smpi_datatype_get_extent(old_type)+smpi_datatype_lb(old_type);
if(indices[i]*smpi_datatype_get_extent(old_type)+blocklens[i]*smpi_datatype_ub(old_type)>ub)
- ub = indices[i]*smpi_datatype_get_extent(old_type)+blocklens[i]*smpi_datatype_ub(old_type);
+ ub = indices[i]*smpi_datatype_get_extent(old_type)+blocklens[i]*smpi_datatype_ub(old_type);
if ( (i< count -1) && (indices[i]+blocklens[i] != indices[i+1]) )contiguous=0;
}
old_type,
smpi_datatype_size(old_type));
smpi_datatype_create(new_type, size * smpi_datatype_size(old_type),
- lb,
+ lb,
ub
,1, subtype, DT_FLAG_DATA);
}else{
old_type,
smpi_datatype_size(old_type));
smpi_datatype_create(new_type, size * smpi_datatype_size(old_type),
- 0,size * smpi_datatype_size(old_type),
- 1, subtype, DT_FLAG_DATA|DT_FLAG_CONTIGUOUS);
+ 0,size * smpi_datatype_size(old_type),
+ 1, subtype, DT_FLAG_DATA|DT_FLAG_CONTIGUOUS);
}
retval=MPI_SUCCESS;
return retval;